@atlaskit/editor-plugin-code-block 3.5.13 → 3.5.14
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 +8 -0
- package/dist/cjs/nodeviews/code-block.js +0 -4
- package/dist/cjs/pm-plugins/decorators.js +2 -8
- package/dist/cjs/pm-plugins/main.js +1 -3
- package/dist/es2019/nodeviews/code-block.js +1 -5
- package/dist/es2019/pm-plugins/decorators.js +2 -8
- package/dist/es2019/pm-plugins/main.js +1 -3
- package/dist/esm/nodeviews/code-block.js +1 -5
- package/dist/esm/pm-plugins/decorators.js +2 -8
- package/dist/esm/pm-plugins/main.js +1 -3
- package/package.json +1 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-code-block
|
|
2
2
|
|
|
3
|
+
## 3.5.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#98963](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/98963)
|
|
8
|
+
[`3638dcf79b6c7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3638dcf79b6c7) -
|
|
9
|
+
ED-26126 Cleanup code wrapping language bug fg
|
|
10
|
+
|
|
3
11
|
## 3.5.13
|
|
4
12
|
|
|
5
13
|
### 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 (
|
|
146
|
-
|
|
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
|
-
|
|
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
|
|
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 (
|
|
136
|
-
|
|
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
|
-
|
|
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
|
|
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 (
|
|
139
|
-
|
|
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
|
-
|
|
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.
|
|
3
|
+
"version": "3.5.14",
|
|
4
4
|
"description": "Code block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.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
|
},
|