@atlaskit/editor-plugin-code-block-advanced 6.0.3 → 6.0.4
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/extensions/firstCodeBlockInDocument.js +1 -2
- package/dist/cjs/nodeviews/extensions/keymap/index.js +2 -3
- package/dist/es2019/nodeviews/extensions/firstCodeBlockInDocument.js +1 -2
- package/dist/es2019/nodeviews/extensions/keymap/index.js +2 -3
- package/dist/esm/nodeviews/extensions/firstCodeBlockInDocument.js +1 -2
- package/dist/esm/nodeviews/extensions/keymap/index.js +2 -3
- package/package.json +1 -4
- package/src/nodeviews/extensions/firstCodeBlockInDocument.ts +1 -3
- package/src/nodeviews/extensions/keymap/index.ts +2 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-code-block-advanced
|
|
2
2
|
|
|
3
|
+
## 6.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`d24d26320c940`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d24d26320c940) -
|
|
8
|
+
FD-100510 clean up fg platform_editor_breakout_resizing_hello_release
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 6.0.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.firstCodeBlockInDocument = void 0;
|
|
7
7
|
var _view = require("@codemirror/view");
|
|
8
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
8
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
10
9
|
/**
|
|
11
10
|
* Keeps 'first-node-in-document' class if it was added to a codeBlock by
|
|
@@ -16,7 +15,7 @@ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equa
|
|
|
16
15
|
* @example
|
|
17
16
|
*/
|
|
18
17
|
var firstCodeBlockInDocument = exports.firstCodeBlockInDocument = function firstCodeBlockInDocument(getPos) {
|
|
19
|
-
if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_controls', 'cohort', 'variant1') && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_breakout_resizing', 'isEnabled', true)
|
|
18
|
+
if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_controls', 'cohort', 'variant1') && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_breakout_resizing', 'isEnabled', true)) {
|
|
20
19
|
return _view.EditorView.editorAttributes.of({
|
|
21
20
|
class: (getPos === null || getPos === void 0 ? void 0 : getPos()) === 0 ? 'first-node-in-document' : ''
|
|
22
21
|
});
|
|
@@ -11,7 +11,6 @@ var _view = require("@codemirror/view");
|
|
|
11
11
|
var _browser = require("@atlaskit/editor-common/browser");
|
|
12
12
|
var _commands2 = require("@atlaskit/editor-prosemirror/commands");
|
|
13
13
|
var _history = require("@atlaskit/editor-prosemirror/history");
|
|
14
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
14
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
16
15
|
var _backspace = require("./backspace");
|
|
17
16
|
var _maybeEscape = require("./maybeEscape");
|
|
@@ -169,7 +168,7 @@ var codeBlockKeymap = function codeBlockKeymap(_ref2) {
|
|
|
169
168
|
mac: 'Cmd-Alt-]',
|
|
170
169
|
run: function run() {
|
|
171
170
|
// Pass synthetic event to prosemirror
|
|
172
|
-
if ((0, _expValEquals.expValEquals)('platform_editor_breakout_resizing', 'isEnabled', true)
|
|
171
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_breakout_resizing', 'isEnabled', true)) {
|
|
173
172
|
view.dispatchEvent(new KeyboardEvent('keydown', {
|
|
174
173
|
key: ']',
|
|
175
174
|
code: 'BracketRight',
|
|
@@ -186,7 +185,7 @@ var codeBlockKeymap = function codeBlockKeymap(_ref2) {
|
|
|
186
185
|
mac: 'Cmd-Alt-[',
|
|
187
186
|
run: function run() {
|
|
188
187
|
// Pass synthetic event to prosemirror
|
|
189
|
-
if ((0, _expValEquals.expValEquals)('platform_editor_breakout_resizing', 'isEnabled', true)
|
|
188
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_breakout_resizing', 'isEnabled', true)) {
|
|
190
189
|
view.dispatchEvent(new KeyboardEvent('keydown', {
|
|
191
190
|
key: ']',
|
|
192
191
|
code: 'BracketLeft',
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { EditorView as CodeMirror } from '@codemirror/view';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -11,7 +10,7 @@ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equ
|
|
|
11
10
|
* @example
|
|
12
11
|
*/
|
|
13
12
|
export const firstCodeBlockInDocument = getPos => {
|
|
14
|
-
if (expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') && expValEqualsNoExposure('platform_editor_breakout_resizing', 'isEnabled', true)
|
|
13
|
+
if (expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') && expValEqualsNoExposure('platform_editor_breakout_resizing', 'isEnabled', true)) {
|
|
15
14
|
return CodeMirror.editorAttributes.of({
|
|
16
15
|
class: (getPos === null || getPos === void 0 ? void 0 : getPos()) === 0 ? 'first-node-in-document' : ''
|
|
17
16
|
});
|
|
@@ -3,7 +3,6 @@ import { keymap as cmKeymap } from '@codemirror/view';
|
|
|
3
3
|
import { browser } from '@atlaskit/editor-common/browser';
|
|
4
4
|
import { exitCode, selectAll } from '@atlaskit/editor-prosemirror/commands';
|
|
5
5
|
import { undo, redo } from '@atlaskit/editor-prosemirror/history';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
7
|
import { backspaceKeymap } from './backspace';
|
|
9
8
|
import { maybeEscapeKeymap } from './maybeEscape';
|
|
@@ -147,7 +146,7 @@ const codeBlockKeymap = ({
|
|
|
147
146
|
mac: 'Cmd-Alt-]',
|
|
148
147
|
run: () => {
|
|
149
148
|
// Pass synthetic event to prosemirror
|
|
150
|
-
if (expValEquals('platform_editor_breakout_resizing', 'isEnabled', true)
|
|
149
|
+
if (expValEquals('platform_editor_breakout_resizing', 'isEnabled', true)) {
|
|
151
150
|
view.dispatchEvent(new KeyboardEvent('keydown', {
|
|
152
151
|
key: ']',
|
|
153
152
|
code: 'BracketRight',
|
|
@@ -164,7 +163,7 @@ const codeBlockKeymap = ({
|
|
|
164
163
|
mac: 'Cmd-Alt-[',
|
|
165
164
|
run: () => {
|
|
166
165
|
// Pass synthetic event to prosemirror
|
|
167
|
-
if (expValEquals('platform_editor_breakout_resizing', 'isEnabled', true)
|
|
166
|
+
if (expValEquals('platform_editor_breakout_resizing', 'isEnabled', true)) {
|
|
168
167
|
view.dispatchEvent(new KeyboardEvent('keydown', {
|
|
169
168
|
key: ']',
|
|
170
169
|
code: 'BracketLeft',
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { EditorView as CodeMirror } from '@codemirror/view';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -11,7 +10,7 @@ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equ
|
|
|
11
10
|
* @example
|
|
12
11
|
*/
|
|
13
12
|
export var firstCodeBlockInDocument = function firstCodeBlockInDocument(getPos) {
|
|
14
|
-
if (expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') && expValEqualsNoExposure('platform_editor_breakout_resizing', 'isEnabled', true)
|
|
13
|
+
if (expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') && expValEqualsNoExposure('platform_editor_breakout_resizing', 'isEnabled', true)) {
|
|
15
14
|
return CodeMirror.editorAttributes.of({
|
|
16
15
|
class: (getPos === null || getPos === void 0 ? void 0 : getPos()) === 0 ? 'first-node-in-document' : ''
|
|
17
16
|
});
|
|
@@ -4,7 +4,6 @@ import { keymap as cmKeymap } from '@codemirror/view';
|
|
|
4
4
|
import { browser } from '@atlaskit/editor-common/browser';
|
|
5
5
|
import { exitCode, selectAll } from '@atlaskit/editor-prosemirror/commands';
|
|
6
6
|
import { undo, redo } from '@atlaskit/editor-prosemirror/history';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
8
|
import { backspaceKeymap } from './backspace';
|
|
10
9
|
import { maybeEscapeKeymap } from './maybeEscape';
|
|
@@ -162,7 +161,7 @@ var codeBlockKeymap = function codeBlockKeymap(_ref2) {
|
|
|
162
161
|
mac: 'Cmd-Alt-]',
|
|
163
162
|
run: function run() {
|
|
164
163
|
// Pass synthetic event to prosemirror
|
|
165
|
-
if (expValEquals('platform_editor_breakout_resizing', 'isEnabled', true)
|
|
164
|
+
if (expValEquals('platform_editor_breakout_resizing', 'isEnabled', true)) {
|
|
166
165
|
view.dispatchEvent(new KeyboardEvent('keydown', {
|
|
167
166
|
key: ']',
|
|
168
167
|
code: 'BracketRight',
|
|
@@ -179,7 +178,7 @@ var codeBlockKeymap = function codeBlockKeymap(_ref2) {
|
|
|
179
178
|
mac: 'Cmd-Alt-[',
|
|
180
179
|
run: function run() {
|
|
181
180
|
// Pass synthetic event to prosemirror
|
|
182
|
-
if (expValEquals('platform_editor_breakout_resizing', 'isEnabled', true)
|
|
181
|
+
if (expValEquals('platform_editor_breakout_resizing', 'isEnabled', true)) {
|
|
183
182
|
view.dispatchEvent(new KeyboardEvent('keydown', {
|
|
184
183
|
key: ']',
|
|
185
184
|
code: 'BracketLeft',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-code-block-advanced",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.4",
|
|
4
4
|
"description": "CodeBlockAdvanced plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -99,9 +99,6 @@
|
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
101
|
"platform-feature-flags": {
|
|
102
|
-
"platform_editor_breakout_resizing_hello_release": {
|
|
103
|
-
"type": "boolean"
|
|
104
|
-
},
|
|
105
102
|
"platform_editor_adf_with_localid": {
|
|
106
103
|
"type": "boolean"
|
|
107
104
|
},
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type Extension } from '@codemirror/state';
|
|
2
2
|
import { EditorView as CodeMirror } from '@codemirror/view';
|
|
3
3
|
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -15,8 +14,7 @@ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equ
|
|
|
15
14
|
export const firstCodeBlockInDocument = (getPos: () => number | undefined): Extension => {
|
|
16
15
|
if (
|
|
17
16
|
expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') &&
|
|
18
|
-
expValEqualsNoExposure('platform_editor_breakout_resizing', 'isEnabled', true)
|
|
19
|
-
fg('platform_editor_breakout_resizing_hello_release')
|
|
17
|
+
expValEqualsNoExposure('platform_editor_breakout_resizing', 'isEnabled', true)
|
|
20
18
|
) {
|
|
21
19
|
return CodeMirror.editorAttributes.of({
|
|
22
20
|
class: getPos?.() === 0 ? 'first-node-in-document' : '',
|
|
@@ -9,7 +9,6 @@ import { exitCode, selectAll } from '@atlaskit/editor-prosemirror/commands';
|
|
|
9
9
|
import { undo, redo } from '@atlaskit/editor-prosemirror/history';
|
|
10
10
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
11
11
|
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
12
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
12
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
14
13
|
|
|
15
14
|
import { backspaceKeymap } from './backspace';
|
|
@@ -170,10 +169,7 @@ const codeBlockKeymap = ({
|
|
|
170
169
|
mac: 'Cmd-Alt-]',
|
|
171
170
|
run: () => {
|
|
172
171
|
// Pass synthetic event to prosemirror
|
|
173
|
-
if (
|
|
174
|
-
expValEquals('platform_editor_breakout_resizing', 'isEnabled', true) &&
|
|
175
|
-
fg('platform_editor_breakout_resizing_hello_release')
|
|
176
|
-
) {
|
|
172
|
+
if (expValEquals('platform_editor_breakout_resizing', 'isEnabled', true)) {
|
|
177
173
|
view.dispatchEvent(
|
|
178
174
|
new KeyboardEvent('keydown', {
|
|
179
175
|
key: ']',
|
|
@@ -193,10 +189,7 @@ const codeBlockKeymap = ({
|
|
|
193
189
|
mac: 'Cmd-Alt-[',
|
|
194
190
|
run: () => {
|
|
195
191
|
// Pass synthetic event to prosemirror
|
|
196
|
-
if (
|
|
197
|
-
expValEquals('platform_editor_breakout_resizing', 'isEnabled', true) &&
|
|
198
|
-
fg('platform_editor_breakout_resizing_hello_release')
|
|
199
|
-
) {
|
|
192
|
+
if (expValEquals('platform_editor_breakout_resizing', 'isEnabled', true)) {
|
|
200
193
|
view.dispatchEvent(
|
|
201
194
|
new KeyboardEvent('keydown', {
|
|
202
195
|
key: ']',
|