@atlaskit/editor-plugin-breakout 1.6.1 → 1.7.0
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 +25 -0
- package/dist/cjs/commands/remove-breakout.js +15 -1
- package/dist/cjs/commands/set-breakout-mode.js +15 -1
- package/dist/es2019/commands/remove-breakout.js +15 -1
- package/dist/es2019/commands/set-breakout-mode.js +15 -1
- package/dist/esm/commands/remove-breakout.js +15 -1
- package/dist/esm/commands/set-breakout-mode.js +15 -1
- package/package.json +9 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-breakout
|
|
2
2
|
|
|
3
|
+
## 1.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#128347](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/128347)
|
|
8
|
+
[`e33566cebd5d1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e33566cebd5d1) -
|
|
9
|
+
[ED-24175] bump @atlaskit/adf-schema to 40.8.1 and @atlassian/adf-schema-json to 1.22.0 to
|
|
10
|
+
promotecodeblocks & media in quotes, and nested expands in expands to full schema, and allow
|
|
11
|
+
quotes in panels and decisions in lists in stage0 schema, and a validator spec change
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
17
|
+
## 1.6.2
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [#125133](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/125133)
|
|
22
|
+
[`d804e5dd3216b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d804e5dd3216b) -
|
|
23
|
+
ED-24226 - Add state to manage the toggle word wrap state of code blocks. New WeakMap added in
|
|
24
|
+
editor-common/src/code-block, as word wrap state is shared throughout the editor. Covers regular
|
|
25
|
+
changes to code block by the user via the node view update function. Covers breakout of code block
|
|
26
|
+
node. Does not cover drag&drop & cut&paste edge cases.
|
|
27
|
+
|
|
3
28
|
## 1.6.1
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.removeBreakout = removeBreakout;
|
|
7
|
+
var _codeBlock = require("@atlaskit/editor-common/code-block");
|
|
7
8
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
8
10
|
var _findBreakoutNode = require("../utils/find-breakout-node");
|
|
9
11
|
var _singlePlayerExpand = require("../utils/single-player-expand");
|
|
10
12
|
function removeBreakout(isLivePage) {
|
|
@@ -17,7 +19,19 @@ function removeBreakout(isLivePage) {
|
|
|
17
19
|
return m.type.name !== 'breakout';
|
|
18
20
|
});
|
|
19
21
|
var tr = state.tr.setNodeMarkup(node.pos, node.node.type, node.node.attrs, marks);
|
|
20
|
-
(0,
|
|
22
|
+
if ((0, _platformFeatureFlags.fg)('editor_support_code_block_wrapping')) {
|
|
23
|
+
if (node.node.type === state.schema.nodes.expand) {
|
|
24
|
+
(0, _singlePlayerExpand.updateExpandedState)(tr, node, isLivePage);
|
|
25
|
+
} else if (node.node.type === state.schema.nodes.codeBlock) {
|
|
26
|
+
var newNode = tr.doc.nodeAt(node.pos);
|
|
27
|
+
var oldNode = node.node;
|
|
28
|
+
if (newNode) {
|
|
29
|
+
(0, _codeBlock.transferCodeBlockWrappedValue)(oldNode, newNode);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
} else {
|
|
33
|
+
(0, _singlePlayerExpand.updateExpandedState)(tr, node, isLivePage);
|
|
34
|
+
}
|
|
21
35
|
tr.setMeta('scrollIntoView', false);
|
|
22
36
|
if (state.selection instanceof _state.NodeSelection) {
|
|
23
37
|
if (state.selection.$anchor.pos === node.pos) {
|
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.setBreakoutMode = setBreakoutMode;
|
|
7
|
+
var _codeBlock = require("@atlaskit/editor-common/code-block");
|
|
7
8
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
8
10
|
var _findBreakoutNode = require("../utils/find-breakout-node");
|
|
9
11
|
var _singlePlayerExpand = require("../utils/single-player-expand");
|
|
10
12
|
function setBreakoutMode(mode, isLivePage) {
|
|
@@ -16,7 +18,19 @@ function setBreakoutMode(mode, isLivePage) {
|
|
|
16
18
|
var tr = state.tr.setNodeMarkup(node.pos, node.node.type, node.node.attrs, [state.schema.marks.breakout.create({
|
|
17
19
|
mode: mode
|
|
18
20
|
})]);
|
|
19
|
-
(0,
|
|
21
|
+
if ((0, _platformFeatureFlags.fg)('editor_support_code_block_wrapping')) {
|
|
22
|
+
if (node.node.type === state.schema.nodes.expand) {
|
|
23
|
+
(0, _singlePlayerExpand.updateExpandedState)(tr, node, isLivePage);
|
|
24
|
+
} else if (node.node.type === state.schema.nodes.codeBlock) {
|
|
25
|
+
var newNode = tr.doc.nodeAt(node.pos);
|
|
26
|
+
var oldNode = node.node;
|
|
27
|
+
if (newNode) {
|
|
28
|
+
(0, _codeBlock.transferCodeBlockWrappedValue)(oldNode, newNode);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
} else {
|
|
32
|
+
(0, _singlePlayerExpand.updateExpandedState)(tr, node, isLivePage);
|
|
33
|
+
}
|
|
20
34
|
tr.setMeta('scrollIntoView', false);
|
|
21
35
|
if (state.selection instanceof _state.NodeSelection) {
|
|
22
36
|
if (state.selection.$anchor.pos === node.pos) {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { transferCodeBlockWrappedValue } from '@atlaskit/editor-common/code-block';
|
|
1
2
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
4
|
import { findSupportedNodeForBreakout } from '../utils/find-breakout-node';
|
|
3
5
|
import { updateExpandedState } from '../utils/single-player-expand';
|
|
4
6
|
export function removeBreakout(isLivePage) {
|
|
@@ -9,7 +11,19 @@ export function removeBreakout(isLivePage) {
|
|
|
9
11
|
}
|
|
10
12
|
const marks = node.node.marks.filter(m => m.type.name !== 'breakout');
|
|
11
13
|
const tr = state.tr.setNodeMarkup(node.pos, node.node.type, node.node.attrs, marks);
|
|
12
|
-
|
|
14
|
+
if (fg('editor_support_code_block_wrapping')) {
|
|
15
|
+
if (node.node.type === state.schema.nodes.expand) {
|
|
16
|
+
updateExpandedState(tr, node, isLivePage);
|
|
17
|
+
} else if (node.node.type === state.schema.nodes.codeBlock) {
|
|
18
|
+
const newNode = tr.doc.nodeAt(node.pos);
|
|
19
|
+
const oldNode = node.node;
|
|
20
|
+
if (newNode) {
|
|
21
|
+
transferCodeBlockWrappedValue(oldNode, newNode);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
} else {
|
|
25
|
+
updateExpandedState(tr, node, isLivePage);
|
|
26
|
+
}
|
|
13
27
|
tr.setMeta('scrollIntoView', false);
|
|
14
28
|
if (state.selection instanceof NodeSelection) {
|
|
15
29
|
if (state.selection.$anchor.pos === node.pos) {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { transferCodeBlockWrappedValue } from '@atlaskit/editor-common/code-block';
|
|
1
2
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
4
|
import { findSupportedNodeForBreakout } from '../utils/find-breakout-node';
|
|
3
5
|
import { updateExpandedState } from '../utils/single-player-expand';
|
|
4
6
|
export function setBreakoutMode(mode, isLivePage) {
|
|
@@ -10,7 +12,19 @@ export function setBreakoutMode(mode, isLivePage) {
|
|
|
10
12
|
const tr = state.tr.setNodeMarkup(node.pos, node.node.type, node.node.attrs, [state.schema.marks.breakout.create({
|
|
11
13
|
mode
|
|
12
14
|
})]);
|
|
13
|
-
|
|
15
|
+
if (fg('editor_support_code_block_wrapping')) {
|
|
16
|
+
if (node.node.type === state.schema.nodes.expand) {
|
|
17
|
+
updateExpandedState(tr, node, isLivePage);
|
|
18
|
+
} else if (node.node.type === state.schema.nodes.codeBlock) {
|
|
19
|
+
const newNode = tr.doc.nodeAt(node.pos);
|
|
20
|
+
const oldNode = node.node;
|
|
21
|
+
if (newNode) {
|
|
22
|
+
transferCodeBlockWrappedValue(oldNode, newNode);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
updateExpandedState(tr, node, isLivePage);
|
|
27
|
+
}
|
|
14
28
|
tr.setMeta('scrollIntoView', false);
|
|
15
29
|
if (state.selection instanceof NodeSelection) {
|
|
16
30
|
if (state.selection.$anchor.pos === node.pos) {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { transferCodeBlockWrappedValue } from '@atlaskit/editor-common/code-block';
|
|
1
2
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
4
|
import { findSupportedNodeForBreakout } from '../utils/find-breakout-node';
|
|
3
5
|
import { updateExpandedState } from '../utils/single-player-expand';
|
|
4
6
|
export function removeBreakout(isLivePage) {
|
|
@@ -11,7 +13,19 @@ export function removeBreakout(isLivePage) {
|
|
|
11
13
|
return m.type.name !== 'breakout';
|
|
12
14
|
});
|
|
13
15
|
var tr = state.tr.setNodeMarkup(node.pos, node.node.type, node.node.attrs, marks);
|
|
14
|
-
|
|
16
|
+
if (fg('editor_support_code_block_wrapping')) {
|
|
17
|
+
if (node.node.type === state.schema.nodes.expand) {
|
|
18
|
+
updateExpandedState(tr, node, isLivePage);
|
|
19
|
+
} else if (node.node.type === state.schema.nodes.codeBlock) {
|
|
20
|
+
var newNode = tr.doc.nodeAt(node.pos);
|
|
21
|
+
var oldNode = node.node;
|
|
22
|
+
if (newNode) {
|
|
23
|
+
transferCodeBlockWrappedValue(oldNode, newNode);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
} else {
|
|
27
|
+
updateExpandedState(tr, node, isLivePage);
|
|
28
|
+
}
|
|
15
29
|
tr.setMeta('scrollIntoView', false);
|
|
16
30
|
if (state.selection instanceof NodeSelection) {
|
|
17
31
|
if (state.selection.$anchor.pos === node.pos) {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { transferCodeBlockWrappedValue } from '@atlaskit/editor-common/code-block';
|
|
1
2
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
4
|
import { findSupportedNodeForBreakout } from '../utils/find-breakout-node';
|
|
3
5
|
import { updateExpandedState } from '../utils/single-player-expand';
|
|
4
6
|
export function setBreakoutMode(mode, isLivePage) {
|
|
@@ -10,7 +12,19 @@ export function setBreakoutMode(mode, isLivePage) {
|
|
|
10
12
|
var tr = state.tr.setNodeMarkup(node.pos, node.node.type, node.node.attrs, [state.schema.marks.breakout.create({
|
|
11
13
|
mode: mode
|
|
12
14
|
})]);
|
|
13
|
-
|
|
15
|
+
if (fg('editor_support_code_block_wrapping')) {
|
|
16
|
+
if (node.node.type === state.schema.nodes.expand) {
|
|
17
|
+
updateExpandedState(tr, node, isLivePage);
|
|
18
|
+
} else if (node.node.type === state.schema.nodes.codeBlock) {
|
|
19
|
+
var newNode = tr.doc.nodeAt(node.pos);
|
|
20
|
+
var oldNode = node.node;
|
|
21
|
+
if (newNode) {
|
|
22
|
+
transferCodeBlockWrappedValue(oldNode, newNode);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
updateExpandedState(tr, node, isLivePage);
|
|
27
|
+
}
|
|
14
28
|
tr.setMeta('scrollIntoView', false);
|
|
15
29
|
if (state.selection instanceof NodeSelection) {
|
|
16
30
|
if (state.selection.$anchor.pos === node.pos) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-breakout",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Breakout plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,16 +31,16 @@
|
|
|
31
31
|
".": "./src/index.ts"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@atlaskit/adf-schema": "^40.
|
|
35
|
-
"@atlaskit/editor-common": "^87.
|
|
34
|
+
"@atlaskit/adf-schema": "^40.8.1",
|
|
35
|
+
"@atlaskit/editor-common": "^87.6.0",
|
|
36
36
|
"@atlaskit/editor-plugin-editor-viewmode": "^2.1.0",
|
|
37
37
|
"@atlaskit/editor-plugin-width": "^1.2.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "5.0.1",
|
|
39
39
|
"@atlaskit/editor-shared-styles": "^2.13.0",
|
|
40
|
-
"@atlaskit/icon": "^22.
|
|
40
|
+
"@atlaskit/icon": "^22.11.0",
|
|
41
41
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
42
42
|
"@atlaskit/theme": "^12.11.0",
|
|
43
|
-
"@atlaskit/tokens": "^1.
|
|
43
|
+
"@atlaskit/tokens": "^1.57.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
45
45
|
"@emotion/react": "^11.7.1"
|
|
46
46
|
},
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@af/integration-testing": "*",
|
|
53
53
|
"@af/visual-regression": "*",
|
|
54
|
-
"@atlaskit/editor-plugin-code-block": "^3.
|
|
54
|
+
"@atlaskit/editor-plugin-code-block": "^3.3.0",
|
|
55
55
|
"@atlaskit/editor-plugin-composition": "^1.2.0",
|
|
56
56
|
"@atlaskit/editor-plugin-decorations": "^1.2.0",
|
|
57
57
|
"@atlaskit/ssr": "*",
|
|
@@ -100,6 +100,9 @@
|
|
|
100
100
|
},
|
|
101
101
|
"platform.editor.core.increase-full-page-guttering": {
|
|
102
102
|
"type": "boolean"
|
|
103
|
+
},
|
|
104
|
+
"editor_support_code_block_wrapping": {
|
|
105
|
+
"type": "boolean"
|
|
103
106
|
}
|
|
104
107
|
}
|
|
105
108
|
}
|