@atlaskit/editor-plugin-code-block 3.5.13 → 3.5.15

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,19 @@
1
1
  # @atlaskit/editor-plugin-code-block
2
2
 
3
+ ## 3.5.15
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 3.5.14
10
+
11
+ ### Patch Changes
12
+
13
+ - [#98963](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/98963)
14
+ [`3638dcf79b6c7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3638dcf79b6c7) -
15
+ ED-26126 Cleanup code wrapping language bug fg
16
+
3
17
  ## 3.5.13
4
18
 
5
19
  ### Patch Changes
@@ -11,7 +11,6 @@ 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");
15
14
  var _editorCommands = require("../editor-commands");
16
15
  var _mainState = require("../pm-plugins/main-state");
17
16
  var _classNames = require("../ui/class-names");
@@ -165,9 +164,6 @@ var CodeBlockView = exports.CodeBlockView = /*#__PURE__*/function () {
165
164
  return false;
166
165
  }
167
166
  if (node !== this.node) {
168
- if (!(0, _platformFeatureFlags.fg)('editor_code_block_wrapping_language_change_bug')) {
169
- (0, _codeBlock.transferCodeBlockWrappedValue)(this.node, node);
170
- }
171
167
  if (node.attrs.language !== this.node.attrs.language) {
172
168
  this.contentDOM.setAttribute('data-language', node.attrs.language || '');
173
169
  }
@@ -142,14 +142,8 @@ var validateWordWrappedDecorators = exports.validateWordWrappedDecorators = func
142
142
  codeBlockNodes.forEach(function (node) {
143
143
  var isCodeBlockWrappedInState = (0, _codeBlock.isCodeBlockWordWrapEnabled)(node.node);
144
144
  var isCodeBlockWrappedByDecorator = getWordWrapDecoratorsFromNodePos(node.pos, decorationSet).length !== 0;
145
- if ((0, _platformFeatureFlags.fg)('editor_code_block_wrapping_language_change_bug')) {
146
- if (isCodeBlockWrappedInState !== isCodeBlockWrappedByDecorator) {
147
- updatedDecorationSet = updateDecorationSetWithWordWrappedDecorator(decorationSet, tr, node);
148
- }
149
- } else {
150
- if (isCodeBlockWrappedInState && !isCodeBlockWrappedByDecorator) {
151
- updatedDecorationSet = updateDecorationSetWithWordWrappedDecorator(decorationSet, tr, node);
152
- }
145
+ if (isCodeBlockWrappedInState !== isCodeBlockWrappedByDecorator) {
146
+ updatedDecorationSet = updateDecorationSetWithWordWrappedDecorator(decorationSet, tr, node);
153
147
  }
154
148
  });
155
149
  return updatedDecorationSet;
@@ -104,9 +104,7 @@ var createPlugin = exports.createPlugin = function createPlugin(_ref) {
104
104
  var updatedDecorationSet = pluginState.decorations.map(tr.mapping, tr.doc);
105
105
  var codeBlockNodes = (0, _platformFeatureFlags.fg)('editor_code_wrapping_perf_improvement_ed-25141') ? (0, _utils.getAllChangedCodeBlocksInTransaction)(tr) : (0, _utils.getAllCodeBlockNodesInDoc)(newState);
106
106
  if (codeBlockNodes) {
107
- if ((0, _platformFeatureFlags.fg)('editor_code_block_wrapping_language_change_bug')) {
108
- (0, _codeBlock.updateCodeBlockWrappedStateNodeKeys)(codeBlockNodes, _oldState);
109
- }
107
+ (0, _codeBlock.updateCodeBlockWrappedStateNodeKeys)(codeBlockNodes, _oldState);
110
108
  updatedDecorationSet = (0, _decorators.updateCodeBlockDecorations)(tr, codeBlockNodes, updatedDecorationSet);
111
109
  }
112
110
  var newPluginState = _objectSpread(_objectSpread({}, pluginState), {}, {
@@ -1,8 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import { browser } from '@atlaskit/editor-common/browser';
3
- import { codeBlockWrappedStates, defaultWordWrapState, transferCodeBlockWrappedValue } from '@atlaskit/editor-common/code-block';
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';
6
5
  import { resetShouldIgnoreFollowingMutations } from '../editor-commands';
7
6
  import { getPluginState } from '../pm-plugins/main-state';
8
7
  import { codeBlockClassNames } from '../ui/class-names';
@@ -143,9 +142,6 @@ export class CodeBlockView {
143
142
  return false;
144
143
  }
145
144
  if (node !== this.node) {
146
- if (!fg('editor_code_block_wrapping_language_change_bug')) {
147
- transferCodeBlockWrappedValue(this.node, node);
148
- }
149
145
  if (node.attrs.language !== this.node.attrs.language) {
150
146
  this.contentDOM.setAttribute('data-language', node.attrs.language || '');
151
147
  }
@@ -132,14 +132,8 @@ export const validateWordWrappedDecorators = (tr, codeBlockNodes, decorationSet)
132
132
  codeBlockNodes.forEach(node => {
133
133
  const isCodeBlockWrappedInState = isCodeBlockWordWrapEnabled(node.node);
134
134
  const isCodeBlockWrappedByDecorator = getWordWrapDecoratorsFromNodePos(node.pos, decorationSet).length !== 0;
135
- if (fg('editor_code_block_wrapping_language_change_bug')) {
136
- if (isCodeBlockWrappedInState !== isCodeBlockWrappedByDecorator) {
137
- updatedDecorationSet = updateDecorationSetWithWordWrappedDecorator(decorationSet, tr, node);
138
- }
139
- } else {
140
- if (isCodeBlockWrappedInState && !isCodeBlockWrappedByDecorator) {
141
- updatedDecorationSet = updateDecorationSetWithWordWrappedDecorator(decorationSet, tr, node);
142
- }
135
+ if (isCodeBlockWrappedInState !== isCodeBlockWrappedByDecorator) {
136
+ updatedDecorationSet = updateDecorationSetWithWordWrappedDecorator(decorationSet, tr, node);
143
137
  }
144
138
  });
145
139
  return updatedDecorationSet;
@@ -94,9 +94,7 @@ export const createPlugin = ({
94
94
  let updatedDecorationSet = pluginState.decorations.map(tr.mapping, tr.doc);
95
95
  const codeBlockNodes = fg('editor_code_wrapping_perf_improvement_ed-25141') ? getAllChangedCodeBlocksInTransaction(tr) : getAllCodeBlockNodesInDoc(newState);
96
96
  if (codeBlockNodes) {
97
- if (fg('editor_code_block_wrapping_language_change_bug')) {
98
- updateCodeBlockWrappedStateNodeKeys(codeBlockNodes, _oldState);
99
- }
97
+ updateCodeBlockWrappedStateNodeKeys(codeBlockNodes, _oldState);
100
98
  updatedDecorationSet = updateCodeBlockDecorations(tr, codeBlockNodes, updatedDecorationSet);
101
99
  }
102
100
  const newPluginState = {
@@ -2,9 +2,8 @@ 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
4
  import { browser } from '@atlaskit/editor-common/browser';
5
- import { codeBlockWrappedStates, defaultWordWrapState, transferCodeBlockWrappedValue } from '@atlaskit/editor-common/code-block';
5
+ import { codeBlockWrappedStates, defaultWordWrapState } from '@atlaskit/editor-common/code-block';
6
6
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
7
- import { fg } from '@atlaskit/platform-feature-flags';
8
7
  import { resetShouldIgnoreFollowingMutations } from '../editor-commands';
9
8
  import { getPluginState } from '../pm-plugins/main-state';
10
9
  import { codeBlockClassNames } from '../ui/class-names';
@@ -159,9 +158,6 @@ export var CodeBlockView = /*#__PURE__*/function () {
159
158
  return false;
160
159
  }
161
160
  if (node !== this.node) {
162
- if (!fg('editor_code_block_wrapping_language_change_bug')) {
163
- transferCodeBlockWrappedValue(this.node, node);
164
- }
165
161
  if (node.attrs.language !== this.node.attrs.language) {
166
162
  this.contentDOM.setAttribute('data-language', node.attrs.language || '');
167
163
  }
@@ -135,14 +135,8 @@ export var validateWordWrappedDecorators = function validateWordWrappedDecorator
135
135
  codeBlockNodes.forEach(function (node) {
136
136
  var isCodeBlockWrappedInState = isCodeBlockWordWrapEnabled(node.node);
137
137
  var isCodeBlockWrappedByDecorator = getWordWrapDecoratorsFromNodePos(node.pos, decorationSet).length !== 0;
138
- if (fg('editor_code_block_wrapping_language_change_bug')) {
139
- if (isCodeBlockWrappedInState !== isCodeBlockWrappedByDecorator) {
140
- updatedDecorationSet = updateDecorationSetWithWordWrappedDecorator(decorationSet, tr, node);
141
- }
142
- } else {
143
- if (isCodeBlockWrappedInState && !isCodeBlockWrappedByDecorator) {
144
- updatedDecorationSet = updateDecorationSetWithWordWrappedDecorator(decorationSet, tr, node);
145
- }
138
+ if (isCodeBlockWrappedInState !== isCodeBlockWrappedByDecorator) {
139
+ updatedDecorationSet = updateDecorationSetWithWordWrappedDecorator(decorationSet, tr, node);
146
140
  }
147
141
  });
148
142
  return updatedDecorationSet;
@@ -99,9 +99,7 @@ export var createPlugin = function createPlugin(_ref) {
99
99
  var updatedDecorationSet = pluginState.decorations.map(tr.mapping, tr.doc);
100
100
  var codeBlockNodes = fg('editor_code_wrapping_perf_improvement_ed-25141') ? getAllChangedCodeBlocksInTransaction(tr) : getAllCodeBlockNodesInDoc(newState);
101
101
  if (codeBlockNodes) {
102
- if (fg('editor_code_block_wrapping_language_change_bug')) {
103
- updateCodeBlockWrappedStateNodeKeys(codeBlockNodes, _oldState);
104
- }
102
+ updateCodeBlockWrappedStateNodeKeys(codeBlockNodes, _oldState);
105
103
  updatedDecorationSet = updateCodeBlockDecorations(tr, codeBlockNodes, updatedDecorationSet);
106
104
  }
107
105
  var newPluginState = _objectSpread(_objectSpread({}, pluginState), {}, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-code-block",
3
- "version": "3.5.13",
3
+ "version": "3.5.15",
4
4
  "description": "Code block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,13 +33,13 @@
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^46.1.0",
35
35
  "@atlaskit/code": "^15.6.0",
36
- "@atlaskit/editor-common": "^98.0.0",
36
+ "@atlaskit/editor-common": "^99.0.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
38
38
  "@atlaskit/editor-plugin-composition": "^1.2.0",
39
39
  "@atlaskit/editor-plugin-decorations": "^1.3.0",
40
40
  "@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
41
41
  "@atlaskit/editor-prosemirror": "6.2.1",
42
- "@atlaskit/icon": "^23.1.0",
42
+ "@atlaskit/icon": "^23.3.0",
43
43
  "@atlaskit/platform-feature-flags": "^0.3.0",
44
44
  "@atlaskit/prosemirror-input-rules": "^3.2.0",
45
45
  "@babel/runtime": "^7.0.0"
@@ -96,9 +96,6 @@
96
96
  "code_block_auto_insertion_bug_fix": {
97
97
  "type": "boolean"
98
98
  },
99
- "editor_code_block_wrapping_language_change_bug": {
100
- "type": "boolean"
101
- },
102
99
  "editor_nest_media_and_codeblock_in_quotes_jira": {
103
100
  "type": "boolean"
104
101
  },