@atlaskit/editor-plugin-block-menu 6.1.3 → 6.1.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 +6 -0
- package/dist/cjs/editor-commands/transform-node-utils/steps/wrapMixedContentStep.js +7 -17
- package/dist/cjs/editor-commands/transform-node-utils/wrapStep.js +9 -19
- package/dist/es2019/editor-commands/transform-node-utils/steps/wrapMixedContentStep.js +5 -15
- package/dist/es2019/editor-commands/transform-node-utils/wrapStep.js +7 -17
- package/dist/esm/editor-commands/transform-node-utils/steps/wrapMixedContentStep.js +7 -17
- package/dist/esm/editor-commands/transform-node-utils/wrapStep.js +9 -19
- package/package.json +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -142,25 +142,15 @@ var wrapMixedContentStep = exports.wrapMixedContentStep = function wrapMixedCont
|
|
|
142
142
|
var _schema$nodes = schema.nodes,
|
|
143
143
|
layoutSection = _schema$nodes.layoutSection,
|
|
144
144
|
layoutColumn = _schema$nodes.layoutColumn;
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
// This ensures that custom width settings are maintained during block type transformations.
|
|
149
|
-
// To clean up: remove the if-else block and keep only the flag-on behavior (lines 151-159).
|
|
145
|
+
var sourceSupportsBreakout = _utils.breakoutResizableNodes.includes(fromNode.type.name);
|
|
146
|
+
var targetSupportsBreakout = _utils.breakoutResizableNodes.includes(targetNodeTypeName);
|
|
147
|
+
var shouldPreserveBreakout = sourceSupportsBreakout && targetSupportsBreakout;
|
|
150
148
|
var breakoutMark;
|
|
151
|
-
if (
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
var shouldPreserveBreakout = sourceSupportsBreakout && targetSupportsBreakout;
|
|
156
|
-
if (shouldPreserveBreakout) {
|
|
157
|
-
breakoutMark = fromNode.marks.find(function (mark) {
|
|
158
|
-
return mark.type.name === 'breakout';
|
|
159
|
-
});
|
|
160
|
-
}
|
|
149
|
+
if (shouldPreserveBreakout) {
|
|
150
|
+
breakoutMark = fromNode.marks.find(function (mark) {
|
|
151
|
+
return mark.type.name === 'breakout';
|
|
152
|
+
});
|
|
161
153
|
}
|
|
162
|
-
// else: OLD BEHAVIOR - no breakout mark preservation (to be removed when flag is cleaned up)
|
|
163
|
-
|
|
164
154
|
var result = [];
|
|
165
155
|
var currentContainerContent = [];
|
|
166
156
|
var hasCreatedContainer = false;
|
|
@@ -44,28 +44,18 @@ var wrapStep = exports.wrapStep = function wrapStep(nodes, context) {
|
|
|
44
44
|
var nodeAttrs = isExpandType && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_expand_localid_fix') ? {
|
|
45
45
|
localId: crypto.randomUUID()
|
|
46
46
|
} : {};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
// This ensures that custom width settings are maintained during block type transformations.
|
|
51
|
-
// To clean up: remove the if-else block and keep only the flag-on behavior (lines 47-58).
|
|
47
|
+
var sourceSupportsBreakout = _utils.breakoutResizableNodes.includes(fromNode.type.name);
|
|
48
|
+
var targetSupportsBreakout = _utils.breakoutResizableNodes.includes(targetNodeType.name);
|
|
49
|
+
var shouldPreserveBreakout = sourceSupportsBreakout && targetSupportsBreakout;
|
|
52
50
|
var marks;
|
|
53
|
-
if (
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
var breakoutMark = fromNode.marks.find(function (mark) {
|
|
60
|
-
return mark.type.name === 'breakout';
|
|
61
|
-
});
|
|
62
|
-
if (breakoutMark) {
|
|
63
|
-
marks = [breakoutMark];
|
|
64
|
-
}
|
|
51
|
+
if (shouldPreserveBreakout) {
|
|
52
|
+
var breakoutMark = fromNode.marks.find(function (mark) {
|
|
53
|
+
return mark.type.name === 'breakout';
|
|
54
|
+
});
|
|
55
|
+
if (breakoutMark) {
|
|
56
|
+
marks = [breakoutMark];
|
|
65
57
|
}
|
|
66
58
|
}
|
|
67
|
-
// else: OLD BEHAVIOR - no breakout mark preservation (to be removed when flag is cleaned up)
|
|
68
|
-
|
|
69
59
|
var outputNode = targetNodeType.createAndFill(nodeAttrs, (0, _marks.removeDisallowedMarks)(processedNodes, schema.nodes[targetNodeTypeName]), marks);
|
|
70
60
|
return outputNode ? [outputNode] : nodes;
|
|
71
61
|
};
|
|
@@ -138,23 +138,13 @@ export const wrapMixedContentStep = (nodes, context) => {
|
|
|
138
138
|
layoutSection,
|
|
139
139
|
layoutColumn
|
|
140
140
|
} = schema.nodes;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
// This ensures that custom width settings are maintained during block type transformations.
|
|
145
|
-
// To clean up: remove the if-else block and keep only the flag-on behavior (lines 151-159).
|
|
141
|
+
const sourceSupportsBreakout = breakoutResizableNodes.includes(fromNode.type.name);
|
|
142
|
+
const targetSupportsBreakout = breakoutResizableNodes.includes(targetNodeTypeName);
|
|
143
|
+
const shouldPreserveBreakout = sourceSupportsBreakout && targetSupportsBreakout;
|
|
146
144
|
let breakoutMark;
|
|
147
|
-
if (
|
|
148
|
-
|
|
149
|
-
const sourceSupportsBreakout = breakoutResizableNodes.includes(fromNode.type.name);
|
|
150
|
-
const targetSupportsBreakout = breakoutResizableNodes.includes(targetNodeTypeName);
|
|
151
|
-
const shouldPreserveBreakout = sourceSupportsBreakout && targetSupportsBreakout;
|
|
152
|
-
if (shouldPreserveBreakout) {
|
|
153
|
-
breakoutMark = fromNode.marks.find(mark => mark.type.name === 'breakout');
|
|
154
|
-
}
|
|
145
|
+
if (shouldPreserveBreakout) {
|
|
146
|
+
breakoutMark = fromNode.marks.find(mark => mark.type.name === 'breakout');
|
|
155
147
|
}
|
|
156
|
-
// else: OLD BEHAVIOR - no breakout mark preservation (to be removed when flag is cleaned up)
|
|
157
|
-
|
|
158
148
|
const result = [];
|
|
159
149
|
let currentContainerContent = [];
|
|
160
150
|
let hasCreatedContainer = false;
|
|
@@ -41,26 +41,16 @@ export const wrapStep = (nodes, context) => {
|
|
|
41
41
|
const nodeAttrs = isExpandType && fg('platform_editor_block_menu_expand_localid_fix') ? {
|
|
42
42
|
localId: crypto.randomUUID()
|
|
43
43
|
} : {};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
// This ensures that custom width settings are maintained during block type transformations.
|
|
48
|
-
// To clean up: remove the if-else block and keep only the flag-on behavior (lines 47-58).
|
|
44
|
+
const sourceSupportsBreakout = breakoutResizableNodes.includes(fromNode.type.name);
|
|
45
|
+
const targetSupportsBreakout = breakoutResizableNodes.includes(targetNodeType.name);
|
|
46
|
+
const shouldPreserveBreakout = sourceSupportsBreakout && targetSupportsBreakout;
|
|
49
47
|
let marks;
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const shouldPreserveBreakout = sourceSupportsBreakout && targetSupportsBreakout;
|
|
55
|
-
if (shouldPreserveBreakout) {
|
|
56
|
-
const breakoutMark = fromNode.marks.find(mark => mark.type.name === 'breakout');
|
|
57
|
-
if (breakoutMark) {
|
|
58
|
-
marks = [breakoutMark];
|
|
59
|
-
}
|
|
48
|
+
if (shouldPreserveBreakout) {
|
|
49
|
+
const breakoutMark = fromNode.marks.find(mark => mark.type.name === 'breakout');
|
|
50
|
+
if (breakoutMark) {
|
|
51
|
+
marks = [breakoutMark];
|
|
60
52
|
}
|
|
61
53
|
}
|
|
62
|
-
// else: OLD BEHAVIOR - no breakout mark preservation (to be removed when flag is cleaned up)
|
|
63
|
-
|
|
64
54
|
const outputNode = targetNodeType.createAndFill(nodeAttrs, removeDisallowedMarks(processedNodes, schema.nodes[targetNodeTypeName]), marks);
|
|
65
55
|
return outputNode ? [outputNode] : nodes;
|
|
66
56
|
};
|
|
@@ -136,25 +136,15 @@ export var wrapMixedContentStep = function wrapMixedContentStep(nodes, context)
|
|
|
136
136
|
var _schema$nodes = schema.nodes,
|
|
137
137
|
layoutSection = _schema$nodes.layoutSection,
|
|
138
138
|
layoutColumn = _schema$nodes.layoutColumn;
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
// This ensures that custom width settings are maintained during block type transformations.
|
|
143
|
-
// To clean up: remove the if-else block and keep only the flag-on behavior (lines 151-159).
|
|
139
|
+
var sourceSupportsBreakout = breakoutResizableNodes.includes(fromNode.type.name);
|
|
140
|
+
var targetSupportsBreakout = breakoutResizableNodes.includes(targetNodeTypeName);
|
|
141
|
+
var shouldPreserveBreakout = sourceSupportsBreakout && targetSupportsBreakout;
|
|
144
142
|
var breakoutMark;
|
|
145
|
-
if (
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
var shouldPreserveBreakout = sourceSupportsBreakout && targetSupportsBreakout;
|
|
150
|
-
if (shouldPreserveBreakout) {
|
|
151
|
-
breakoutMark = fromNode.marks.find(function (mark) {
|
|
152
|
-
return mark.type.name === 'breakout';
|
|
153
|
-
});
|
|
154
|
-
}
|
|
143
|
+
if (shouldPreserveBreakout) {
|
|
144
|
+
breakoutMark = fromNode.marks.find(function (mark) {
|
|
145
|
+
return mark.type.name === 'breakout';
|
|
146
|
+
});
|
|
155
147
|
}
|
|
156
|
-
// else: OLD BEHAVIOR - no breakout mark preservation (to be removed when flag is cleaned up)
|
|
157
|
-
|
|
158
148
|
var result = [];
|
|
159
149
|
var currentContainerContent = [];
|
|
160
150
|
var hasCreatedContainer = false;
|
|
@@ -39,28 +39,18 @@ export var wrapStep = function wrapStep(nodes, context) {
|
|
|
39
39
|
var nodeAttrs = isExpandType && fg('platform_editor_block_menu_expand_localid_fix') ? {
|
|
40
40
|
localId: crypto.randomUUID()
|
|
41
41
|
} : {};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
// This ensures that custom width settings are maintained during block type transformations.
|
|
46
|
-
// To clean up: remove the if-else block and keep only the flag-on behavior (lines 47-58).
|
|
42
|
+
var sourceSupportsBreakout = breakoutResizableNodes.includes(fromNode.type.name);
|
|
43
|
+
var targetSupportsBreakout = breakoutResizableNodes.includes(targetNodeType.name);
|
|
44
|
+
var shouldPreserveBreakout = sourceSupportsBreakout && targetSupportsBreakout;
|
|
47
45
|
var marks;
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
var breakoutMark = fromNode.marks.find(function (mark) {
|
|
55
|
-
return mark.type.name === 'breakout';
|
|
56
|
-
});
|
|
57
|
-
if (breakoutMark) {
|
|
58
|
-
marks = [breakoutMark];
|
|
59
|
-
}
|
|
46
|
+
if (shouldPreserveBreakout) {
|
|
47
|
+
var breakoutMark = fromNode.marks.find(function (mark) {
|
|
48
|
+
return mark.type.name === 'breakout';
|
|
49
|
+
});
|
|
50
|
+
if (breakoutMark) {
|
|
51
|
+
marks = [breakoutMark];
|
|
60
52
|
}
|
|
61
53
|
}
|
|
62
|
-
// else: OLD BEHAVIOR - no breakout mark preservation (to be removed when flag is cleaned up)
|
|
63
|
-
|
|
64
54
|
var outputNode = targetNodeType.createAndFill(nodeAttrs, removeDisallowedMarks(processedNodes, schema.nodes[targetNodeTypeName]), marks);
|
|
65
55
|
return outputNode ? [outputNode] : nodes;
|
|
66
56
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-menu",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.4",
|
|
4
4
|
"description": "BlockMenu plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
47
47
|
"@atlaskit/primitives": "^18.0.0",
|
|
48
48
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
49
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
49
|
+
"@atlaskit/tmp-editor-statsig": "^31.0.0",
|
|
50
50
|
"@atlaskit/tokens": "^11.0.0",
|
|
51
51
|
"@babel/runtime": "^7.0.0",
|
|
52
52
|
"bind-event-listener": "^3.0.0"
|
|
@@ -104,9 +104,6 @@
|
|
|
104
104
|
},
|
|
105
105
|
"platform_editor_block_menu_v2_patch_3": {
|
|
106
106
|
"type": "boolean"
|
|
107
|
-
},
|
|
108
|
-
"platform_editor_preserve_breakout_on_transform": {
|
|
109
|
-
"type": "boolean"
|
|
110
107
|
}
|
|
111
108
|
}
|
|
112
109
|
}
|