@atlaskit/editor-plugin-block-controls 3.16.1 → 3.16.2
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 +9 -0
- package/dist/cjs/editor-commands/move-to-layout.js +60 -4
- package/dist/cjs/ui/quick-insert-button.js +3 -2
- package/dist/es2019/editor-commands/move-to-layout.js +55 -4
- package/dist/es2019/ui/quick-insert-button.js +3 -2
- package/dist/esm/editor-commands/move-to-layout.js +60 -4
- package/dist/esm/ui/quick-insert-button.js +3 -2
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 3.16.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#168359](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/168359)
|
|
8
|
+
[`25fcd59865f76`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/25fcd59865f76) -
|
|
9
|
+
ED-28200 retain layout width after dragging an element to create a column
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 3.16.1
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -9,6 +9,7 @@ var _monitoring = require("@atlaskit/editor-common/monitoring");
|
|
|
9
9
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
10
10
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
11
11
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
12
13
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
13
14
|
var _analytics2 = require("../pm-plugins/utils/analytics");
|
|
14
15
|
var _checkFragment = require("../pm-plugins/utils/check-fragment");
|
|
@@ -187,6 +188,13 @@ var removeBreakoutMarks = function removeBreakoutMarks(tr, $from, to) {
|
|
|
187
188
|
breakout = _ref4.breakout;
|
|
188
189
|
if ((0, _experiments.editorExperiment)('platform_editor_element_drag_and_drop_multiselect', true)) {
|
|
189
190
|
tr.doc.nodesBetween($from.pos, to, function (node, pos, parent) {
|
|
191
|
+
// should never remove breakout from previous layoutSection
|
|
192
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_breakout_resizing', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_breakout_resizing_hello_release')) {
|
|
193
|
+
if (node.type.name === 'layoutSection') {
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
190
198
|
// breakout doesn't exist on nested nodes
|
|
191
199
|
if ((parent === null || parent === void 0 ? void 0 : parent.type.name) === 'doc' && node.marks.some(function (m) {
|
|
192
200
|
return m.type === breakout;
|
|
@@ -242,6 +250,39 @@ var getBreakoutMode = function getBreakoutMode(content, breakout) {
|
|
|
242
250
|
}
|
|
243
251
|
}
|
|
244
252
|
};
|
|
253
|
+
var getBreakoutModeAndWidth = function getBreakoutModeAndWidth(content, breakout) {
|
|
254
|
+
var findBreakoutMark = function findBreakoutMark(node) {
|
|
255
|
+
return node.marks.find(function (m) {
|
|
256
|
+
return m.type === breakout;
|
|
257
|
+
});
|
|
258
|
+
};
|
|
259
|
+
var extractBreakoutAttributes = function extractBreakoutAttributes(mark) {
|
|
260
|
+
return mark ? {
|
|
261
|
+
breakoutMode: mark.attrs.mode,
|
|
262
|
+
breakoutWidth: mark.attrs.width
|
|
263
|
+
} : null;
|
|
264
|
+
};
|
|
265
|
+
if ((0, _experiments.editorExperiment)('platform_editor_element_drag_and_drop_multiselect', true)) {
|
|
266
|
+
if (content instanceof _model.Node) {
|
|
267
|
+
return extractBreakoutAttributes(findBreakoutMark(content));
|
|
268
|
+
} else if (content instanceof _model.Fragment) {
|
|
269
|
+
// Find the first breakout mode in the fragment
|
|
270
|
+
for (var i = 0; i < content.childCount; i++) {
|
|
271
|
+
var child = content.child(i);
|
|
272
|
+
var breakoutMark = findBreakoutMark(child);
|
|
273
|
+
if (breakoutMark) {
|
|
274
|
+
return extractBreakoutAttributes(breakoutMark);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
} else {
|
|
279
|
+
// Without multi-select support, we can assume source content is of type PMNode
|
|
280
|
+
if (content instanceof _model.Node) {
|
|
281
|
+
return extractBreakoutAttributes(findBreakoutMark(content));
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
return null;
|
|
285
|
+
};
|
|
245
286
|
|
|
246
287
|
// TODO: ED-26959 - As part of platform_editor_element_drag_and_drop_multiselect clean up,
|
|
247
288
|
// source content variable that has type of `PMNode | Fragment` should be updated to `Fragment` only
|
|
@@ -269,7 +310,15 @@ var moveToLayout = exports.moveToLayout = function moveToLayout(api) {
|
|
|
269
310
|
|
|
270
311
|
// get breakout mode from destination node,
|
|
271
312
|
// if not found, get from source node,
|
|
272
|
-
var breakoutMode
|
|
313
|
+
var breakoutMode;
|
|
314
|
+
var breakoutWidth;
|
|
315
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_breakout_resizing', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_breakout_resizing_hello_release')) {
|
|
316
|
+
var _ref8 = getBreakoutModeAndWidth(toNode, breakout) || getBreakoutModeAndWidth(sourceContent, breakout) || {};
|
|
317
|
+
breakoutMode = _ref8.breakoutMode;
|
|
318
|
+
breakoutWidth = _ref8.breakoutWidth;
|
|
319
|
+
} else {
|
|
320
|
+
breakoutMode = getBreakoutMode(toNode, breakout) || getBreakoutMode(sourceContent, breakout);
|
|
321
|
+
}
|
|
273
322
|
|
|
274
323
|
// we don't want to remove marks when moving/re-ordering layoutSection
|
|
275
324
|
var shouldRemoveMarks = !($sourceFrom.node().type === layoutSection && (0, _experiments.editorExperiment)('platform_editor_element_drag_and_drop_multiselect', true) && (0, _platformFeatureFlags.fg)('platform_editor_elements_dnd_multi_select_patch_3'));
|
|
@@ -327,9 +376,16 @@ var moveToLayout = exports.moveToLayout = function moveToLayout(api) {
|
|
|
327
376
|
tr = (0, _removeFromSource.removeFromSource)(tr, $sourceFrom, sourceTo);
|
|
328
377
|
var mappedTo = tr.mapping.map(to);
|
|
329
378
|
tr.delete(mappedTo, mappedTo + toNodeWithoutBreakout.nodeSize).insert(mappedTo, newLayout);
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
379
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_breakout_resizing', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_breakout_resizing_hello_release')) {
|
|
380
|
+
breakoutMode && tr.setNodeMarkup(mappedTo, newLayout.type, newLayout.attrs, [breakout.create({
|
|
381
|
+
mode: breakoutMode,
|
|
382
|
+
width: breakoutWidth
|
|
383
|
+
})]);
|
|
384
|
+
} else {
|
|
385
|
+
breakoutMode && tr.setNodeMarkup(mappedTo, newLayout.type, newLayout.attrs, [breakout.create({
|
|
386
|
+
mode: breakoutMode
|
|
387
|
+
})]);
|
|
388
|
+
}
|
|
333
389
|
if ((0, _platformFeatureFlags.fg)('platform_editor_column_count_analytics')) {
|
|
334
390
|
// layout created via drag and drop will always be 2 columns
|
|
335
391
|
(0, _analytics2.fireInsertLayoutAnalytics)(tr, api, sourceNodeTypes, hasSelectedMultipleNodes, 2);
|
|
@@ -18,7 +18,7 @@ var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-
|
|
|
18
18
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
19
19
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
20
20
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
21
|
-
var _add = _interopRequireDefault(require("@atlaskit/icon/
|
|
21
|
+
var _add = _interopRequireDefault(require("@atlaskit/icon/core/add"));
|
|
22
22
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
23
23
|
var _primitives = require("@atlaskit/primitives");
|
|
24
24
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
@@ -296,7 +296,8 @@ var TypeAheadControl = exports.TypeAheadControl = function TypeAheadControl(_ref
|
|
|
296
296
|
isDisabled: !(0, _platformFeatureFlags.fg)('platform_editor_controls_widget_visibility') && isTypeAheadOpen
|
|
297
297
|
}, (0, _react2.jsx)(_add.default, {
|
|
298
298
|
label: "add",
|
|
299
|
-
color: isTypeAheadOpen && !(0, _platformFeatureFlags.fg)('platform_editor_controls_widget_visibility') ? "var(--ds-icon-disabled, #091E424F)" : "var(--ds-icon-subtle, #626F86)"
|
|
299
|
+
color: isTypeAheadOpen && !(0, _platformFeatureFlags.fg)('platform_editor_controls_widget_visibility') ? "var(--ds-icon-disabled, #091E424F)" : "var(--ds-icon-subtle, #626F86)",
|
|
300
|
+
size: "small"
|
|
300
301
|
})));
|
|
301
302
|
};
|
|
302
303
|
return (0, _react2.jsx)(_primitives.Box
|
|
@@ -3,6 +3,7 @@ import { logException } from '@atlaskit/editor-common/monitoring';
|
|
|
3
3
|
import { Fragment, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
7
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
8
|
import { attachMoveNodeAnalytics, fireInsertLayoutAnalytics, getMultiSelectAnalyticsAttributes } from '../pm-plugins/utils/analytics';
|
|
8
9
|
import { containsNodeOfType, isFragmentOfType } from '../pm-plugins/utils/check-fragment';
|
|
@@ -186,6 +187,13 @@ const removeBreakoutMarks = (tr, $from, to) => {
|
|
|
186
187
|
} = tr.doc.type.schema.marks || {};
|
|
187
188
|
if (editorExperiment('platform_editor_element_drag_and_drop_multiselect', true)) {
|
|
188
189
|
tr.doc.nodesBetween($from.pos, to, (node, pos, parent) => {
|
|
190
|
+
// should never remove breakout from previous layoutSection
|
|
191
|
+
if (expValEquals('platform_editor_breakout_resizing', 'isEnabled', true) && fg('platform_editor_breakout_resizing_hello_release')) {
|
|
192
|
+
if (node.type.name === 'layoutSection') {
|
|
193
|
+
return false;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
189
197
|
// breakout doesn't exist on nested nodes
|
|
190
198
|
if ((parent === null || parent === void 0 ? void 0 : parent.type.name) === 'doc' && node.marks.some(m => m.type === breakout)) {
|
|
191
199
|
tr.removeNodeMark(pos, breakout);
|
|
@@ -231,6 +239,33 @@ const getBreakoutMode = (content, breakout) => {
|
|
|
231
239
|
}
|
|
232
240
|
}
|
|
233
241
|
};
|
|
242
|
+
const getBreakoutModeAndWidth = (content, breakout) => {
|
|
243
|
+
const findBreakoutMark = node => node.marks.find(m => m.type === breakout);
|
|
244
|
+
const extractBreakoutAttributes = mark => mark ? {
|
|
245
|
+
breakoutMode: mark.attrs.mode,
|
|
246
|
+
breakoutWidth: mark.attrs.width
|
|
247
|
+
} : null;
|
|
248
|
+
if (editorExperiment('platform_editor_element_drag_and_drop_multiselect', true)) {
|
|
249
|
+
if (content instanceof PMNode) {
|
|
250
|
+
return extractBreakoutAttributes(findBreakoutMark(content));
|
|
251
|
+
} else if (content instanceof Fragment) {
|
|
252
|
+
// Find the first breakout mode in the fragment
|
|
253
|
+
for (let i = 0; i < content.childCount; i++) {
|
|
254
|
+
const child = content.child(i);
|
|
255
|
+
const breakoutMark = findBreakoutMark(child);
|
|
256
|
+
if (breakoutMark) {
|
|
257
|
+
return extractBreakoutAttributes(breakoutMark);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
} else {
|
|
262
|
+
// Without multi-select support, we can assume source content is of type PMNode
|
|
263
|
+
if (content instanceof PMNode) {
|
|
264
|
+
return extractBreakoutAttributes(findBreakoutMark(content));
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
return null;
|
|
268
|
+
};
|
|
234
269
|
|
|
235
270
|
// TODO: ED-26959 - As part of platform_editor_element_drag_and_drop_multiselect clean up,
|
|
236
271
|
// source content variable that has type of `PMNode | Fragment` should be updated to `Fragment` only
|
|
@@ -261,7 +296,16 @@ export const moveToLayout = api => (from, to, options) => ({
|
|
|
261
296
|
|
|
262
297
|
// get breakout mode from destination node,
|
|
263
298
|
// if not found, get from source node,
|
|
264
|
-
|
|
299
|
+
let breakoutMode;
|
|
300
|
+
let breakoutWidth;
|
|
301
|
+
if (expValEquals('platform_editor_breakout_resizing', 'isEnabled', true) && fg('platform_editor_breakout_resizing_hello_release')) {
|
|
302
|
+
({
|
|
303
|
+
breakoutMode,
|
|
304
|
+
breakoutWidth
|
|
305
|
+
} = getBreakoutModeAndWidth(toNode, breakout) || getBreakoutModeAndWidth(sourceContent, breakout) || {});
|
|
306
|
+
} else {
|
|
307
|
+
breakoutMode = getBreakoutMode(toNode, breakout) || getBreakoutMode(sourceContent, breakout);
|
|
308
|
+
}
|
|
265
309
|
|
|
266
310
|
// we don't want to remove marks when moving/re-ordering layoutSection
|
|
267
311
|
const shouldRemoveMarks = !($sourceFrom.node().type === layoutSection && editorExperiment('platform_editor_element_drag_and_drop_multiselect', true) && fg('platform_editor_elements_dnd_multi_select_patch_3'));
|
|
@@ -317,9 +361,16 @@ export const moveToLayout = api => (from, to, options) => ({
|
|
|
317
361
|
tr = removeFromSource(tr, $sourceFrom, sourceTo);
|
|
318
362
|
const mappedTo = tr.mapping.map(to);
|
|
319
363
|
tr.delete(mappedTo, mappedTo + toNodeWithoutBreakout.nodeSize).insert(mappedTo, newLayout);
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
364
|
+
if (expValEquals('platform_editor_breakout_resizing', 'isEnabled', true) && fg('platform_editor_breakout_resizing_hello_release')) {
|
|
365
|
+
breakoutMode && tr.setNodeMarkup(mappedTo, newLayout.type, newLayout.attrs, [breakout.create({
|
|
366
|
+
mode: breakoutMode,
|
|
367
|
+
width: breakoutWidth
|
|
368
|
+
})]);
|
|
369
|
+
} else {
|
|
370
|
+
breakoutMode && tr.setNodeMarkup(mappedTo, newLayout.type, newLayout.attrs, [breakout.create({
|
|
371
|
+
mode: breakoutMode
|
|
372
|
+
})]);
|
|
373
|
+
}
|
|
323
374
|
if (fg('platform_editor_column_count_analytics')) {
|
|
324
375
|
// layout created via drag and drop will always be 2 columns
|
|
325
376
|
fireInsertLayoutAnalytics(tr, api, sourceNodeTypes, hasSelectedMultipleNodes, 2);
|
|
@@ -15,7 +15,7 @@ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared
|
|
|
15
15
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
16
16
|
import { findParentNode, findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
17
17
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
18
|
-
import AddIcon from '@atlaskit/icon/
|
|
18
|
+
import AddIcon from '@atlaskit/icon/core/add';
|
|
19
19
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
20
20
|
import { Box, Pressable, xcss } from '@atlaskit/primitives';
|
|
21
21
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -291,7 +291,8 @@ export const TypeAheadControl = ({
|
|
|
291
291
|
isDisabled: !fg('platform_editor_controls_widget_visibility') && isTypeAheadOpen
|
|
292
292
|
}, jsx(AddIcon, {
|
|
293
293
|
label: "add",
|
|
294
|
-
color: isTypeAheadOpen && !fg('platform_editor_controls_widget_visibility') ? "var(--ds-icon-disabled, #091E424F)" : "var(--ds-icon-subtle, #626F86)"
|
|
294
|
+
color: isTypeAheadOpen && !fg('platform_editor_controls_widget_visibility') ? "var(--ds-icon-disabled, #091E424F)" : "var(--ds-icon-subtle, #626F86)",
|
|
295
|
+
size: "small"
|
|
295
296
|
})));
|
|
296
297
|
return jsx(Box
|
|
297
298
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
@@ -3,6 +3,7 @@ import { logException } from '@atlaskit/editor-common/monitoring';
|
|
|
3
3
|
import { Fragment, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
7
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
8
|
import { attachMoveNodeAnalytics, fireInsertLayoutAnalytics, getMultiSelectAnalyticsAttributes } from '../pm-plugins/utils/analytics';
|
|
8
9
|
import { containsNodeOfType, isFragmentOfType } from '../pm-plugins/utils/check-fragment';
|
|
@@ -181,6 +182,13 @@ var removeBreakoutMarks = function removeBreakoutMarks(tr, $from, to) {
|
|
|
181
182
|
breakout = _ref4.breakout;
|
|
182
183
|
if (editorExperiment('platform_editor_element_drag_and_drop_multiselect', true)) {
|
|
183
184
|
tr.doc.nodesBetween($from.pos, to, function (node, pos, parent) {
|
|
185
|
+
// should never remove breakout from previous layoutSection
|
|
186
|
+
if (expValEquals('platform_editor_breakout_resizing', 'isEnabled', true) && fg('platform_editor_breakout_resizing_hello_release')) {
|
|
187
|
+
if (node.type.name === 'layoutSection') {
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
184
192
|
// breakout doesn't exist on nested nodes
|
|
185
193
|
if ((parent === null || parent === void 0 ? void 0 : parent.type.name) === 'doc' && node.marks.some(function (m) {
|
|
186
194
|
return m.type === breakout;
|
|
@@ -236,6 +244,39 @@ var getBreakoutMode = function getBreakoutMode(content, breakout) {
|
|
|
236
244
|
}
|
|
237
245
|
}
|
|
238
246
|
};
|
|
247
|
+
var getBreakoutModeAndWidth = function getBreakoutModeAndWidth(content, breakout) {
|
|
248
|
+
var findBreakoutMark = function findBreakoutMark(node) {
|
|
249
|
+
return node.marks.find(function (m) {
|
|
250
|
+
return m.type === breakout;
|
|
251
|
+
});
|
|
252
|
+
};
|
|
253
|
+
var extractBreakoutAttributes = function extractBreakoutAttributes(mark) {
|
|
254
|
+
return mark ? {
|
|
255
|
+
breakoutMode: mark.attrs.mode,
|
|
256
|
+
breakoutWidth: mark.attrs.width
|
|
257
|
+
} : null;
|
|
258
|
+
};
|
|
259
|
+
if (editorExperiment('platform_editor_element_drag_and_drop_multiselect', true)) {
|
|
260
|
+
if (content instanceof PMNode) {
|
|
261
|
+
return extractBreakoutAttributes(findBreakoutMark(content));
|
|
262
|
+
} else if (content instanceof Fragment) {
|
|
263
|
+
// Find the first breakout mode in the fragment
|
|
264
|
+
for (var i = 0; i < content.childCount; i++) {
|
|
265
|
+
var child = content.child(i);
|
|
266
|
+
var breakoutMark = findBreakoutMark(child);
|
|
267
|
+
if (breakoutMark) {
|
|
268
|
+
return extractBreakoutAttributes(breakoutMark);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
} else {
|
|
273
|
+
// Without multi-select support, we can assume source content is of type PMNode
|
|
274
|
+
if (content instanceof PMNode) {
|
|
275
|
+
return extractBreakoutAttributes(findBreakoutMark(content));
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
return null;
|
|
279
|
+
};
|
|
239
280
|
|
|
240
281
|
// TODO: ED-26959 - As part of platform_editor_element_drag_and_drop_multiselect clean up,
|
|
241
282
|
// source content variable that has type of `PMNode | Fragment` should be updated to `Fragment` only
|
|
@@ -263,7 +304,15 @@ export var moveToLayout = function moveToLayout(api) {
|
|
|
263
304
|
|
|
264
305
|
// get breakout mode from destination node,
|
|
265
306
|
// if not found, get from source node,
|
|
266
|
-
var breakoutMode
|
|
307
|
+
var breakoutMode;
|
|
308
|
+
var breakoutWidth;
|
|
309
|
+
if (expValEquals('platform_editor_breakout_resizing', 'isEnabled', true) && fg('platform_editor_breakout_resizing_hello_release')) {
|
|
310
|
+
var _ref8 = getBreakoutModeAndWidth(toNode, breakout) || getBreakoutModeAndWidth(sourceContent, breakout) || {};
|
|
311
|
+
breakoutMode = _ref8.breakoutMode;
|
|
312
|
+
breakoutWidth = _ref8.breakoutWidth;
|
|
313
|
+
} else {
|
|
314
|
+
breakoutMode = getBreakoutMode(toNode, breakout) || getBreakoutMode(sourceContent, breakout);
|
|
315
|
+
}
|
|
267
316
|
|
|
268
317
|
// we don't want to remove marks when moving/re-ordering layoutSection
|
|
269
318
|
var shouldRemoveMarks = !($sourceFrom.node().type === layoutSection && editorExperiment('platform_editor_element_drag_and_drop_multiselect', true) && fg('platform_editor_elements_dnd_multi_select_patch_3'));
|
|
@@ -321,9 +370,16 @@ export var moveToLayout = function moveToLayout(api) {
|
|
|
321
370
|
tr = removeFromSource(tr, $sourceFrom, sourceTo);
|
|
322
371
|
var mappedTo = tr.mapping.map(to);
|
|
323
372
|
tr.delete(mappedTo, mappedTo + toNodeWithoutBreakout.nodeSize).insert(mappedTo, newLayout);
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
373
|
+
if (expValEquals('platform_editor_breakout_resizing', 'isEnabled', true) && fg('platform_editor_breakout_resizing_hello_release')) {
|
|
374
|
+
breakoutMode && tr.setNodeMarkup(mappedTo, newLayout.type, newLayout.attrs, [breakout.create({
|
|
375
|
+
mode: breakoutMode,
|
|
376
|
+
width: breakoutWidth
|
|
377
|
+
})]);
|
|
378
|
+
} else {
|
|
379
|
+
breakoutMode && tr.setNodeMarkup(mappedTo, newLayout.type, newLayout.attrs, [breakout.create({
|
|
380
|
+
mode: breakoutMode
|
|
381
|
+
})]);
|
|
382
|
+
}
|
|
327
383
|
if (fg('platform_editor_column_count_analytics')) {
|
|
328
384
|
// layout created via drag and drop will always be 2 columns
|
|
329
385
|
fireInsertLayoutAnalytics(tr, api, sourceNodeTypes, hasSelectedMultipleNodes, 2);
|
|
@@ -19,7 +19,7 @@ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared
|
|
|
19
19
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
20
20
|
import { findParentNode, findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
21
21
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
22
|
-
import AddIcon from '@atlaskit/icon/
|
|
22
|
+
import AddIcon from '@atlaskit/icon/core/add';
|
|
23
23
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
24
24
|
import { Box, Pressable, xcss } from '@atlaskit/primitives';
|
|
25
25
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -291,7 +291,8 @@ export var TypeAheadControl = function TypeAheadControl(_ref) {
|
|
|
291
291
|
isDisabled: !fg('platform_editor_controls_widget_visibility') && isTypeAheadOpen
|
|
292
292
|
}, jsx(AddIcon, {
|
|
293
293
|
label: "add",
|
|
294
|
-
color: isTypeAheadOpen && !fg('platform_editor_controls_widget_visibility') ? "var(--ds-icon-disabled, #091E424F)" : "var(--ds-icon-subtle, #626F86)"
|
|
294
|
+
color: isTypeAheadOpen && !fg('platform_editor_controls_widget_visibility') ? "var(--ds-icon-disabled, #091E424F)" : "var(--ds-icon-subtle, #626F86)",
|
|
295
|
+
size: "small"
|
|
295
296
|
})));
|
|
296
297
|
};
|
|
297
298
|
return jsx(Box
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "3.16.
|
|
3
|
+
"version": "3.16.2",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-feature-flags": "^1.4.0",
|
|
41
41
|
"@atlaskit/editor-plugin-interaction": "^2.0.0",
|
|
42
|
-
"@atlaskit/editor-plugin-metrics": "^3.
|
|
42
|
+
"@atlaskit/editor-plugin-metrics": "^3.5.0",
|
|
43
43
|
"@atlaskit/editor-plugin-quick-insert": "^2.5.0",
|
|
44
44
|
"@atlaskit/editor-plugin-selection": "^2.2.0",
|
|
45
45
|
"@atlaskit/editor-plugin-type-ahead": "^2.7.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
|
|
57
57
|
"@atlaskit/primitives": "^14.8.0",
|
|
58
58
|
"@atlaskit/theme": "^18.0.0",
|
|
59
|
-
"@atlaskit/tmp-editor-statsig": "^6.
|
|
59
|
+
"@atlaskit/tmp-editor-statsig": "^6.1.0",
|
|
60
60
|
"@atlaskit/tokens": "^5.1.0",
|
|
61
61
|
"@atlaskit/tooltip": "^20.3.0",
|
|
62
62
|
"@babel/runtime": "^7.0.0",
|
|
@@ -200,6 +200,9 @@
|
|
|
200
200
|
},
|
|
201
201
|
"platform_editor_controls_patch_11": {
|
|
202
202
|
"type": "boolean"
|
|
203
|
+
},
|
|
204
|
+
"platform_editor_breakout_resizing_hello_release": {
|
|
205
|
+
"type": "boolean"
|
|
203
206
|
}
|
|
204
207
|
}
|
|
205
208
|
}
|