@atlaskit/editor-plugin-breakout 12.2.3 → 12.2.5
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-breakout
|
|
2
2
|
|
|
3
|
+
## 12.2.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`02a6a65136967`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/02a6a65136967) -
|
|
8
|
+
[EDITOR-8101] add breakout to existing resizable top-level panels and dividers when doc has not
|
|
9
|
+
changed
|
|
10
|
+
|
|
11
|
+
## 12.2.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 12.2.3
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -11,6 +11,7 @@ var _utils = require("@atlaskit/editor-common/utils");
|
|
|
11
11
|
var _document = require("@atlaskit/editor-common/utils/document");
|
|
12
12
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
13
13
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
14
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
15
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
15
16
|
var _handleKeyDown = require("./handle-key-down");
|
|
16
17
|
var _resizingMarkView = require("./resizing-mark-view");
|
|
@@ -137,7 +138,19 @@ var createResizingPlugin = exports.createResizingPlugin = function createResizin
|
|
|
137
138
|
panel_c1 = _newState$schema$node.panel_c1;
|
|
138
139
|
var breakoutResizableNodes = (0, _experiments.editorExperiment)('platform_synced_block', true) ? (0, _utils.getBreakoutResizableNodeTypes)(newState.schema, isRuleAndPanelResizingEnabled) : isRuleAndPanelResizingEnabled ? new Set([expand, codeBlock, layoutSection, rule, panel, panel_c1]) : new Set([expand, codeBlock, layoutSection]);
|
|
139
140
|
var isFullWidthEnabled = !((options === null || options === void 0 ? void 0 : options.allowBreakoutButton) === true);
|
|
140
|
-
|
|
141
|
+
var hasTopLevelPanelOrRuleWithoutBreakout = false;
|
|
142
|
+
// platform_editor_lovability_resize_patch_1 is a kill switch
|
|
143
|
+
if (isRuleAndPanelResizingEnabled && !(0, _platformFeatureFlags.fg)('platform_editor_lovability_resize_patch_1')) {
|
|
144
|
+
var breakout = newState.schema.marks.breakout;
|
|
145
|
+
newState.doc.forEach(function (node) {
|
|
146
|
+
if ([panel, panel_c1, rule].includes(node.type) && !node.marks.some(function (mark) {
|
|
147
|
+
return mark.type === breakout;
|
|
148
|
+
})) {
|
|
149
|
+
hasTopLevelPanelOrRuleWithoutBreakout = true;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
if ((0, _document.isReplaceDocOperation)(transactions, oldState) || hasTopLevelPanelOrRuleWithoutBreakout) {
|
|
141
154
|
newState.doc.forEach(function (node, pos) {
|
|
142
155
|
var _addBreakoutToResizab = addBreakoutToResizableNode({
|
|
143
156
|
node: node,
|
|
@@ -3,6 +3,7 @@ import { getBreakoutResizableNodeTypes, stepAddsOneOf } from '@atlaskit/editor-c
|
|
|
3
3
|
import { getChangedNodes, isReplaceDocOperation } from '@atlaskit/editor-common/utils/document';
|
|
4
4
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorCalculatedWideLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
8
|
import { handleKeyDown } from './handle-key-down';
|
|
8
9
|
import { ResizingMarkView } from './resizing-mark-view';
|
|
@@ -133,7 +134,19 @@ export const createResizingPlugin = (api, getIntl, nodeViewPortalProviderAPI, op
|
|
|
133
134
|
} = newState.schema.nodes;
|
|
134
135
|
const breakoutResizableNodes = editorExperiment('platform_synced_block', true) ? getBreakoutResizableNodeTypes(newState.schema, isRuleAndPanelResizingEnabled) : isRuleAndPanelResizingEnabled ? new Set([expand, codeBlock, layoutSection, rule, panel, panel_c1]) : new Set([expand, codeBlock, layoutSection]);
|
|
135
136
|
const isFullWidthEnabled = !((options === null || options === void 0 ? void 0 : options.allowBreakoutButton) === true);
|
|
136
|
-
|
|
137
|
+
let hasTopLevelPanelOrRuleWithoutBreakout = false;
|
|
138
|
+
// platform_editor_lovability_resize_patch_1 is a kill switch
|
|
139
|
+
if (isRuleAndPanelResizingEnabled && !fg('platform_editor_lovability_resize_patch_1')) {
|
|
140
|
+
const {
|
|
141
|
+
breakout
|
|
142
|
+
} = newState.schema.marks;
|
|
143
|
+
newState.doc.forEach(node => {
|
|
144
|
+
if ([panel, panel_c1, rule].includes(node.type) && !node.marks.some(mark => mark.type === breakout)) {
|
|
145
|
+
hasTopLevelPanelOrRuleWithoutBreakout = true;
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
if (isReplaceDocOperation(transactions, oldState) || hasTopLevelPanelOrRuleWithoutBreakout) {
|
|
137
150
|
newState.doc.forEach((node, pos) => {
|
|
138
151
|
const {
|
|
139
152
|
updatedTr,
|
|
@@ -6,6 +6,7 @@ import { getBreakoutResizableNodeTypes, stepAddsOneOf } from '@atlaskit/editor-c
|
|
|
6
6
|
import { getChangedNodes, isReplaceDocOperation } from '@atlaskit/editor-common/utils/document';
|
|
7
7
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
8
8
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorCalculatedWideLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
10
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
10
11
|
import { handleKeyDown } from './handle-key-down';
|
|
11
12
|
import { ResizingMarkView } from './resizing-mark-view';
|
|
@@ -130,7 +131,19 @@ export var createResizingPlugin = function createResizingPlugin(api, getIntl, no
|
|
|
130
131
|
panel_c1 = _newState$schema$node.panel_c1;
|
|
131
132
|
var breakoutResizableNodes = editorExperiment('platform_synced_block', true) ? getBreakoutResizableNodeTypes(newState.schema, isRuleAndPanelResizingEnabled) : isRuleAndPanelResizingEnabled ? new Set([expand, codeBlock, layoutSection, rule, panel, panel_c1]) : new Set([expand, codeBlock, layoutSection]);
|
|
132
133
|
var isFullWidthEnabled = !((options === null || options === void 0 ? void 0 : options.allowBreakoutButton) === true);
|
|
133
|
-
|
|
134
|
+
var hasTopLevelPanelOrRuleWithoutBreakout = false;
|
|
135
|
+
// platform_editor_lovability_resize_patch_1 is a kill switch
|
|
136
|
+
if (isRuleAndPanelResizingEnabled && !fg('platform_editor_lovability_resize_patch_1')) {
|
|
137
|
+
var breakout = newState.schema.marks.breakout;
|
|
138
|
+
newState.doc.forEach(function (node) {
|
|
139
|
+
if ([panel, panel_c1, rule].includes(node.type) && !node.marks.some(function (mark) {
|
|
140
|
+
return mark.type === breakout;
|
|
141
|
+
})) {
|
|
142
|
+
hasTopLevelPanelOrRuleWithoutBreakout = true;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
if (isReplaceDocOperation(transactions, oldState) || hasTopLevelPanelOrRuleWithoutBreakout) {
|
|
134
147
|
newState.doc.forEach(function (node, pos) {
|
|
135
148
|
var _addBreakoutToResizab = addBreakoutToResizableNode({
|
|
136
149
|
node: node,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-breakout",
|
|
3
|
-
"version": "12.2.
|
|
3
|
+
"version": "12.2.5",
|
|
4
4
|
"description": "Breakout plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"@atlaskit/editor-plugin-width": "^13.0.0",
|
|
32
32
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
33
33
|
"@atlaskit/editor-shared-styles": "^4.0.0",
|
|
34
|
-
"@atlaskit/icon": "^
|
|
34
|
+
"@atlaskit/icon": "^37.0.0",
|
|
35
35
|
"@atlaskit/platform-feature-flags": "^2.0.0",
|
|
36
36
|
"@atlaskit/pragmatic-drag-and-drop": "^2.0.0",
|
|
37
37
|
"@atlaskit/theme": "^26.1.0",
|
|
38
|
-
"@atlaskit/tmp-editor-statsig": "^124.
|
|
39
|
-
"@atlaskit/tokens": "^15.
|
|
38
|
+
"@atlaskit/tmp-editor-statsig": "^124.5.0",
|
|
39
|
+
"@atlaskit/tokens": "^15.7.0",
|
|
40
40
|
"@atlaskit/tooltip": "^23.1.0",
|
|
41
41
|
"@babel/runtime": "^7.0.0",
|
|
42
42
|
"@emotion/react": "^11.7.1",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"uuid": "^3.1.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@atlaskit/editor-common": "^116.
|
|
48
|
+
"@atlaskit/editor-common": "^116.27.0",
|
|
49
49
|
"react": "^18.2.0",
|
|
50
50
|
"react-dom": "^18.2.0",
|
|
51
51
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
@@ -96,6 +96,9 @@
|
|
|
96
96
|
"platform-feature-flags": {
|
|
97
97
|
"platform_editor_lovability_resize_gracefully": {
|
|
98
98
|
"type": "boolean"
|
|
99
|
+
},
|
|
100
|
+
"platform_editor_lovability_resize_patch_1": {
|
|
101
|
+
"type": "boolean"
|
|
99
102
|
}
|
|
100
103
|
}
|
|
101
104
|
}
|