@atlaskit/editor-plugin-code-block-advanced 4.0.0 → 4.0.1

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,11 @@
1
1
  # @atlaskit/editor-plugin-code-block-advanced
2
2
 
3
+ ## 4.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
3
9
  ## 4.0.0
4
10
 
5
11
  ### Patch Changes
@@ -9,6 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _adfSchema = require("@atlaskit/adf-schema");
10
10
  var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
11
11
  var _styles = require("@atlaskit/editor-common/styles");
12
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
13
  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; }
13
14
  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; }
14
15
  var codeBlockClassNames = {
@@ -67,12 +68,14 @@ var _toDOM = function toDOM(node, formattedAriaLabel, config) {
67
68
  'data-label': content
68
69
  }]], ['div', {
69
70
  class: codeBlockClassNames.content
70
- }, ['code', {
71
+ }, ['code', _objectSpread({
71
72
  'data-language': node.attrs.language || '',
72
73
  spellcheck: 'false',
73
74
  'data-testid': 'code-block--code',
74
75
  'aria-label': formattedAriaLabel
75
- }, 0]]], ['div', {
76
+ }, (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') && {
77
+ 'data-local-id': node.attrs.localId
78
+ }), 0]]], ['div', {
76
79
  class: codeBlockClassNames.end,
77
80
  contenteditable: 'false'
78
81
  }]];
@@ -1,6 +1,7 @@
1
1
  import { codeBlock } from '@atlaskit/adf-schema';
2
2
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
3
3
  import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
4
5
  const codeBlockClassNames = {
5
6
  container: CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER,
6
7
  start: CodeBlockSharedCssClassName.CODEBLOCK_START,
@@ -59,7 +60,10 @@ const toDOM = (node, formattedAriaLabel, config) => {
59
60
  'data-language': node.attrs.language || '',
60
61
  spellcheck: 'false',
61
62
  'data-testid': 'code-block--code',
62
- 'aria-label': formattedAriaLabel
63
+ 'aria-label': formattedAriaLabel,
64
+ ...(fg('platform_editor_adf_with_localid') && {
65
+ 'data-local-id': node.attrs.localId
66
+ })
63
67
  }, 0]]], ['div', {
64
68
  class: codeBlockClassNames.end,
65
69
  contenteditable: 'false'
@@ -4,6 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  import { codeBlock } from '@atlaskit/adf-schema';
5
5
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
6
6
  import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
7
8
  var codeBlockClassNames = {
8
9
  container: CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER,
9
10
  start: CodeBlockSharedCssClassName.CODEBLOCK_START,
@@ -60,12 +61,14 @@ var _toDOM = function toDOM(node, formattedAriaLabel, config) {
60
61
  'data-label': content
61
62
  }]], ['div', {
62
63
  class: codeBlockClassNames.content
63
- }, ['code', {
64
+ }, ['code', _objectSpread({
64
65
  'data-language': node.attrs.language || '',
65
66
  spellcheck: 'false',
66
67
  'data-testid': 'code-block--code',
67
68
  'aria-label': formattedAriaLabel
68
- }, 0]]], ['div', {
69
+ }, fg('platform_editor_adf_with_localid') && {
70
+ 'data-local-id': node.attrs.localId
71
+ }), 0]]], ['div', {
69
72
  class: codeBlockClassNames.end,
70
73
  contenteditable: 'false'
71
74
  }]];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-code-block-advanced",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "CodeBlockAdvanced plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -36,10 +36,10 @@
36
36
  "@atlaskit/editor-plugin-selection": "^4.0.0",
37
37
  "@atlaskit/editor-plugin-selection-marker": "^4.0.0",
38
38
  "@atlaskit/editor-prosemirror": "7.0.0",
39
- "@atlaskit/editor-toolbar": "^0.6.0",
39
+ "@atlaskit/editor-toolbar": "^0.7.0",
40
40
  "@atlaskit/icon": "^28.1.0",
41
41
  "@atlaskit/platform-feature-flags": "^1.1.0",
42
- "@atlaskit/tmp-editor-statsig": "^12.0.0",
42
+ "@atlaskit/tmp-editor-statsig": "^12.2.0",
43
43
  "@atlaskit/tokens": "^6.1.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "@codemirror/autocomplete": "6.18.4",
@@ -55,7 +55,7 @@
55
55
  "codemirror-lang-elixir": "4.0.0"
56
56
  },
57
57
  "peerDependencies": {
58
- "@atlaskit/editor-common": "^108.0.0",
58
+ "@atlaskit/editor-common": "^108.1.0",
59
59
  "react": "^18.2.0",
60
60
  "react-intl-next": "npm:react-intl@^5.18.1"
61
61
  },
@@ -104,6 +104,9 @@
104
104
  },
105
105
  "platform_editor_code_syntax_highlight_actionscript": {
106
106
  "type": "boolean"
107
+ },
108
+ "platform_editor_adf_with_localid": {
109
+ "type": "boolean"
107
110
  }
108
111
  }
109
112
  }
@@ -2,6 +2,7 @@ import { codeBlock } from '@atlaskit/adf-schema';
2
2
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
3
3
  import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
4
4
  import type { NodeSpec, DOMOutputSpec, Node } from '@atlaskit/editor-prosemirror/model';
5
+ import { fg } from '@atlaskit/platform-feature-flags';
5
6
  import { token } from '@atlaskit/tokens';
6
7
 
7
8
  interface Config {
@@ -94,6 +95,7 @@ const toDOM = (node: Node, formattedAriaLabel: string, config: Config): DOMOutpu
94
95
  spellcheck: 'false',
95
96
  'data-testid': 'code-block--code',
96
97
  'aria-label': formattedAriaLabel,
98
+ ...(fg('platform_editor_adf_with_localid') && { 'data-local-id': node.attrs.localId }),
97
99
  },
98
100
  0,
99
101
  ],