@atlaskit/editor-plugin-block-controls 17.2.4 → 17.3.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 +20 -0
- package/dist/cjs/blockControlsPlugin.js +28 -8
- package/dist/cjs/editor-commands/move-node-with-block-menu.js +2 -2
- package/dist/cjs/editor-commands/move-node.js +6 -6
- package/dist/cjs/editor-commands/utils/move-node-utils.js +4 -4
- package/dist/cjs/pm-plugins/decorations-anchor.js +4 -4
- package/dist/cjs/pm-plugins/decorations-drag-handle.js +3 -3
- package/dist/cjs/pm-plugins/decorations-drop-target-active.js +2 -2
- package/dist/cjs/pm-plugins/decorations-drop-target.js +2 -2
- package/dist/cjs/pm-plugins/decorations-quick-insert-button.js +2 -2
- package/dist/cjs/pm-plugins/handle-mouse-down.js +3 -3
- package/dist/cjs/pm-plugins/handle-mouse-over.js +7 -7
- package/dist/cjs/pm-plugins/interaction-tracking/pm-plugin.js +3 -3
- package/dist/cjs/pm-plugins/main.js +23 -21
- package/dist/cjs/pm-plugins/react-root-registry.js +7 -7
- package/dist/cjs/pm-plugins/utils/active-anchor-tracker.js +2 -2
- package/dist/cjs/pm-plugins/utils/consts.js +2 -2
- package/dist/cjs/pm-plugins/utils/drag-handle-positions.js +6 -6
- package/dist/cjs/pm-plugins/utils/expand-and-update-selection.js +2 -2
- package/dist/cjs/pm-plugins/utils/getSelection.js +5 -5
- package/dist/cjs/pm-plugins/utils/inline-drop-target.js +2 -2
- package/dist/cjs/pm-plugins/utils/remove-from-source.js +2 -2
- package/dist/cjs/pm-plugins/utils/surface-node-positions.js +45 -19
- package/dist/cjs/pm-plugins/utils/validation.js +2 -2
- package/dist/cjs/ui/block-controls-left-surfaces.js +5 -4
- package/dist/cjs/ui/block-controls-right-surface.compiled.css +4 -0
- package/dist/cjs/ui/block-controls-right-surface.js +45 -0
- package/dist/cjs/ui/block-controls-right-surfaces.js +222 -0
- package/dist/{esm/ui/block-controls-left-surface-targets.js → cjs/ui/block-controls-surface-targets.js} +14 -2
- package/dist/cjs/ui/consts.js +4 -4
- package/dist/cjs/ui/drag-handle.js +20 -19
- package/dist/cjs/ui/drop-target.js +2 -2
- package/dist/cjs/ui/global-styles.js +5 -5
- package/dist/cjs/ui/utils/get-surface-placement.js +20 -6
- package/dist/cjs/ui/visibility-container.js +2 -2
- package/dist/es2019/blockControlsPlugin.js +28 -4
- package/dist/es2019/editor-commands/move-node-with-block-menu.js +1 -1
- package/dist/es2019/editor-commands/move-node.js +1 -1
- package/dist/es2019/editor-commands/utils/move-node-utils.js +1 -1
- package/dist/es2019/pm-plugins/decorations-anchor.js +1 -1
- package/dist/es2019/pm-plugins/decorations-drag-handle.js +1 -1
- package/dist/es2019/pm-plugins/decorations-drop-target-active.js +1 -1
- package/dist/es2019/pm-plugins/decorations-drop-target.js +1 -1
- package/dist/es2019/pm-plugins/decorations-quick-insert-button.js +1 -1
- package/dist/es2019/pm-plugins/handle-mouse-down.js +1 -1
- package/dist/es2019/pm-plugins/handle-mouse-over.js +1 -1
- package/dist/es2019/pm-plugins/interaction-tracking/pm-plugin.js +1 -1
- package/dist/es2019/pm-plugins/main.js +10 -10
- package/dist/es2019/pm-plugins/react-root-registry.js +7 -7
- package/dist/es2019/pm-plugins/utils/active-anchor-tracker.js +1 -1
- package/dist/es2019/pm-plugins/utils/consts.js +1 -1
- package/dist/es2019/pm-plugins/utils/drag-handle-positions.js +1 -1
- package/dist/es2019/pm-plugins/utils/expand-and-update-selection.js +1 -1
- package/dist/es2019/pm-plugins/utils/getSelection.js +1 -1
- package/dist/es2019/pm-plugins/utils/inline-drop-target.js +1 -1
- package/dist/es2019/pm-plugins/utils/remove-from-source.js +1 -1
- package/dist/es2019/pm-plugins/utils/surface-node-positions.js +34 -15
- package/dist/es2019/pm-plugins/utils/validation.js +1 -1
- package/dist/es2019/ui/block-controls-left-surfaces.js +5 -4
- package/dist/es2019/ui/block-controls-right-surface.compiled.css +4 -0
- package/dist/es2019/ui/block-controls-right-surface.js +39 -0
- package/dist/es2019/ui/block-controls-right-surfaces.js +187 -0
- package/dist/es2019/ui/{block-controls-left-surface-targets.js → block-controls-surface-targets.js} +8 -2
- package/dist/es2019/ui/consts.js +1 -1
- package/dist/es2019/ui/drag-handle.js +4 -3
- package/dist/es2019/ui/drop-target.js +1 -1
- package/dist/es2019/ui/global-styles.js +1 -1
- package/dist/es2019/ui/utils/get-surface-placement.js +20 -6
- package/dist/es2019/ui/visibility-container.js +1 -1
- package/dist/esm/blockControlsPlugin.js +24 -4
- package/dist/esm/editor-commands/move-node-with-block-menu.js +1 -1
- package/dist/esm/editor-commands/move-node.js +1 -1
- package/dist/esm/editor-commands/utils/move-node-utils.js +1 -1
- package/dist/esm/pm-plugins/decorations-anchor.js +1 -1
- package/dist/esm/pm-plugins/decorations-drag-handle.js +1 -1
- package/dist/esm/pm-plugins/decorations-drop-target-active.js +1 -1
- package/dist/esm/pm-plugins/decorations-drop-target.js +1 -1
- package/dist/esm/pm-plugins/decorations-quick-insert-button.js +1 -1
- package/dist/esm/pm-plugins/handle-mouse-down.js +1 -1
- package/dist/esm/pm-plugins/handle-mouse-over.js +1 -1
- package/dist/esm/pm-plugins/interaction-tracking/pm-plugin.js +1 -1
- package/dist/esm/pm-plugins/main.js +11 -9
- package/dist/esm/pm-plugins/react-root-registry.js +7 -7
- package/dist/esm/pm-plugins/utils/active-anchor-tracker.js +1 -1
- package/dist/esm/pm-plugins/utils/consts.js +1 -1
- package/dist/esm/pm-plugins/utils/drag-handle-positions.js +1 -1
- package/dist/esm/pm-plugins/utils/expand-and-update-selection.js +1 -1
- package/dist/esm/pm-plugins/utils/getSelection.js +1 -1
- package/dist/esm/pm-plugins/utils/inline-drop-target.js +1 -1
- package/dist/esm/pm-plugins/utils/remove-from-source.js +1 -1
- package/dist/esm/pm-plugins/utils/surface-node-positions.js +45 -19
- package/dist/esm/pm-plugins/utils/validation.js +1 -1
- package/dist/esm/ui/block-controls-left-surfaces.js +5 -4
- package/dist/esm/ui/block-controls-right-surface.compiled.css +4 -0
- package/dist/esm/ui/block-controls-right-surface.js +38 -0
- package/dist/esm/ui/block-controls-right-surfaces.js +213 -0
- package/dist/{cjs/ui/block-controls-left-surface-targets.js → esm/ui/block-controls-surface-targets.js} +8 -8
- package/dist/esm/ui/consts.js +1 -1
- package/dist/esm/ui/drag-handle.js +4 -3
- package/dist/esm/ui/drop-target.js +1 -1
- package/dist/esm/ui/global-styles.js +1 -1
- package/dist/esm/ui/utils/get-surface-placement.js +20 -6
- package/dist/esm/ui/visibility-container.js +1 -1
- package/dist/types/pm-plugins/main.d.ts +2 -2
- package/dist/types/pm-plugins/react-root-registry.d.ts +4 -4
- package/dist/types/pm-plugins/utils/surface-node-positions.d.ts +3 -3
- package/dist/types/ui/block-controls-left-surface.d.ts +2 -2
- package/dist/types/ui/block-controls-right-surface.d.ts +23 -0
- package/dist/types/ui/block-controls-right-surfaces.d.ts +20 -0
- package/dist/types/ui/block-controls-surface-targets.d.ts +13 -0
- package/dist/types/ui/utils/get-surface-placement.d.ts +12 -4
- package/package.json +23 -26
- package/dist/types/ui/block-controls-left-surface-targets.d.ts +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 17.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`14f10ff093c15`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/14f10ff093c15) -
|
|
8
|
+
EDITOR-8770: Add the right control surface - currently only used in example page and behind
|
|
9
|
+
platform_editor_block_control_right_surface
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 17.2.5
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`6304662fbdf4a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6304662fbdf4a) -
|
|
20
|
+
Use the supported `createRoot` API when `platform_editor_react19_migration` is enabled.
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 17.2.4
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -16,7 +16,7 @@ var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
|
16
16
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
17
17
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
18
18
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
19
|
-
var
|
|
19
|
+
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
20
20
|
var _handleKeyDownWithPreservedSelection = require("./editor-commands/handle-key-down-with-preserved-selection");
|
|
21
21
|
var _mapPreservedSelection2 = require("./editor-commands/map-preserved-selection");
|
|
22
22
|
var _moveNode = require("./editor-commands/move-node");
|
|
@@ -32,6 +32,7 @@ var _pmPlugin2 = require("./pm-plugins/selection-preservation/pm-plugin");
|
|
|
32
32
|
var _expandAndUpdateSelection2 = require("./pm-plugins/utils/expand-and-update-selection");
|
|
33
33
|
var _getSelection = require("./pm-plugins/utils/getSelection");
|
|
34
34
|
var _blockControlsLeftSurfaces = require("./ui/block-controls-left-surfaces");
|
|
35
|
+
var _blockControlsRightSurfaces = require("./ui/block-controls-right-surfaces");
|
|
35
36
|
var _blockControlsSurfaceDragHandleRegistration = require("./ui/block-controls-surface-drag-handle-registration");
|
|
36
37
|
var _globalStyles = require("./ui/global-styles");
|
|
37
38
|
var _surfaceEditorViewContext = require("./ui/surface-editor-view-context");
|
|
@@ -47,6 +48,7 @@ var blockControlsPlugin = exports.blockControlsPlugin = function blockControlsPl
|
|
|
47
48
|
var registryBlockControlsEnabled = (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_block_control_migration');
|
|
48
49
|
var surfaceNodePositionsEnabled = registryBlockControlsEnabled && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_collapsible_headings');
|
|
49
50
|
var legacyBlockControlsEnabled = !registryBlockControlsEnabled;
|
|
51
|
+
var rightSurfaceEnabled = registryBlockControlsEnabled && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_block_control_right_surface');
|
|
50
52
|
if (registryBlockControlsEnabled) {
|
|
51
53
|
var _api$uiControlRegistr;
|
|
52
54
|
api === null || api === void 0 || (_api$uiControlRegistr = api.uiControlRegistry) === null || _api$uiControlRegistr === void 0 || _api$uiControlRegistr.actions.register([_surfaceKeys.BLOCK_CONTROLS_LEFT_SURFACE, _objectSpread(_objectSpread({}, _surfaceKeys.BLOCK_CONTROLS_LEFT_SECTION), {}, {
|
|
@@ -60,6 +62,21 @@ var blockControlsPlugin = exports.blockControlsPlugin = function blockControlsPl
|
|
|
60
62
|
})].concat((0, _toConsumableArray2.default)((0, _blockControlsSurfaceDragHandleRegistration.getBlockControlsSurfaceDragHandleComponents)({
|
|
61
63
|
api: api
|
|
62
64
|
}))));
|
|
65
|
+
if (rightSurfaceEnabled) {
|
|
66
|
+
var _api$uiControlRegistr2;
|
|
67
|
+
// The right surface host stays generic: it only registers the toolbar/section/group
|
|
68
|
+
// hierarchy. Individual features contribute their own buttons into
|
|
69
|
+
// BLOCK_CONTROLS_RIGHT_GROUP from their own plugins, same as the left surface.
|
|
70
|
+
api === null || api === void 0 || (_api$uiControlRegistr2 = api.uiControlRegistry) === null || _api$uiControlRegistr2 === void 0 || _api$uiControlRegistr2.actions.register([_surfaceKeys.BLOCK_CONTROLS_RIGHT_SURFACE, _objectSpread(_objectSpread({}, _surfaceKeys.BLOCK_CONTROLS_RIGHT_SECTION), {}, {
|
|
71
|
+
parents: [_objectSpread(_objectSpread({}, _surfaceKeys.BLOCK_CONTROLS_RIGHT_SURFACE), {}, {
|
|
72
|
+
rank: 100
|
|
73
|
+
})]
|
|
74
|
+
}), _objectSpread(_objectSpread({}, _surfaceKeys.BLOCK_CONTROLS_RIGHT_GROUP), {}, {
|
|
75
|
+
parents: [_objectSpread(_objectSpread({}, _surfaceKeys.BLOCK_CONTROLS_RIGHT_SECTION), {}, {
|
|
76
|
+
rank: 100
|
|
77
|
+
})]
|
|
78
|
+
})]);
|
|
79
|
+
}
|
|
63
80
|
}
|
|
64
81
|
return {
|
|
65
82
|
name: 'blockControls',
|
|
@@ -129,10 +146,10 @@ var blockControlsPlugin = exports.blockControlsPlugin = function blockControlsPl
|
|
|
129
146
|
plugin: function plugin(_ref2) {
|
|
130
147
|
var getIntl = _ref2.getIntl,
|
|
131
148
|
nodeViewPortalProviderAPI = _ref2.nodeViewPortalProviderAPI;
|
|
132
|
-
return (0, _main.createPlugin)(api, getIntl, nodeViewPortalProviderAPI, nodeDecorationRegistry, rightSideControlsEnabled, quickInsertButtonEnabled && legacyBlockControlsEnabled, legacyBlockControlsEnabled, surfaceNodePositionsEnabled);
|
|
149
|
+
return (0, _main.createPlugin)(api, getIntl, nodeViewPortalProviderAPI, nodeDecorationRegistry, rightSideControlsEnabled, quickInsertButtonEnabled && legacyBlockControlsEnabled, legacyBlockControlsEnabled, surfaceNodePositionsEnabled, rightSurfaceEnabled);
|
|
133
150
|
}
|
|
134
151
|
}];
|
|
135
|
-
if ((0,
|
|
152
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
136
153
|
pmPlugins.push({
|
|
137
154
|
name: 'blockControlsInteractionTrackingPlugin',
|
|
138
155
|
plugin: function plugin() {
|
|
@@ -140,7 +157,7 @@ var blockControlsPlugin = exports.blockControlsPlugin = function blockControlsPl
|
|
|
140
157
|
}
|
|
141
158
|
});
|
|
142
159
|
}
|
|
143
|
-
if ((0,
|
|
160
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true)) {
|
|
144
161
|
pmPlugins.push({
|
|
145
162
|
name: 'blockControlsSelectionPreservationPlugin',
|
|
146
163
|
plugin: (0, _pmPlugin2.createSelectionPreservationPlugin)(api)
|
|
@@ -199,7 +216,7 @@ var blockControlsPlugin = exports.blockControlsPlugin = function blockControlsPl
|
|
|
199
216
|
return function (_ref6) {
|
|
200
217
|
var _api$userIntent, _api$blockControls2, _options$anchorName, _api$blockControls3;
|
|
201
218
|
var tr = _ref6.tr;
|
|
202
|
-
if (!(0,
|
|
219
|
+
if (!(0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true)) {
|
|
203
220
|
return tr;
|
|
204
221
|
}
|
|
205
222
|
var currMeta = tr.getMeta(_main.key);
|
|
@@ -435,14 +452,14 @@ var blockControlsPlugin = exports.blockControlsPlugin = function blockControlsPl
|
|
|
435
452
|
var _key$getState$surface, _key$getState11;
|
|
436
453
|
sharedState.surfaceNodePositions = (_key$getState$surface = (_key$getState11 = _main.key.getState(editorState)) === null || _key$getState11 === void 0 ? void 0 : _key$getState11.surfaceNodePositions) !== null && _key$getState$surface !== void 0 ? _key$getState$surface : [];
|
|
437
454
|
}
|
|
438
|
-
if ((0,
|
|
455
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
439
456
|
var _interactionTrackingP2, _interactionTrackingP3, _interactionTrackingP4;
|
|
440
457
|
sharedState.isMouseOut = (_interactionTrackingP2 = (_interactionTrackingP3 = _pmPlugin.interactionTrackingPluginKey.getState(editorState)) === null || _interactionTrackingP3 === void 0 ? void 0 : _interactionTrackingP3.isMouseOut) !== null && _interactionTrackingP2 !== void 0 ? _interactionTrackingP2 : false;
|
|
441
458
|
// rightSideControlsEnabled is the single source of truth (confluence_remix_button_right_side_block_fg from preset)
|
|
442
459
|
sharedState.rightSideControlsEnabled = rightSideControlsEnabled;
|
|
443
460
|
sharedState.hoverSide = rightSideControlsEnabled ? (_interactionTrackingP4 = _pmPlugin.interactionTrackingPluginKey.getState(editorState)) === null || _interactionTrackingP4 === void 0 ? void 0 : _interactionTrackingP4.hoverSide : undefined;
|
|
444
461
|
}
|
|
445
|
-
if ((0,
|
|
462
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true)) {
|
|
446
463
|
var _selectionPreservatio;
|
|
447
464
|
sharedState.preservedSelection = (_selectionPreservatio = _pluginKey.selectionPreservationPluginKey.getState(editorState)) === null || _selectionPreservatio === void 0 ? void 0 : _selectionPreservatio.preservedSelection;
|
|
448
465
|
}
|
|
@@ -457,7 +474,10 @@ var blockControlsPlugin = exports.blockControlsPlugin = function blockControlsPl
|
|
|
457
474
|
}, /*#__PURE__*/_react.default.createElement(_blockControlsLeftSurfaces.BlockControlsLeftSurfaces, {
|
|
458
475
|
api: api,
|
|
459
476
|
editorView: editorView
|
|
460
|
-
})
|
|
477
|
+
}), rightSurfaceEnabled ? /*#__PURE__*/_react.default.createElement(_blockControlsRightSurfaces.BlockControlsRightSurfaces, {
|
|
478
|
+
api: api,
|
|
479
|
+
editorView: editorView
|
|
480
|
+
}) : null) : null);
|
|
461
481
|
}
|
|
462
482
|
};
|
|
463
483
|
};
|
|
@@ -8,7 +8,7 @@ exports.moveNodeWithBlockMenu = void 0;
|
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
10
10
|
var _types = require("@atlaskit/editor-common/types");
|
|
11
|
-
var
|
|
11
|
+
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
12
12
|
var _main = require("../pm-plugins/main");
|
|
13
13
|
var _selection = require("../pm-plugins/utils/selection");
|
|
14
14
|
var _moveNode = require("./move-node");
|
|
@@ -30,7 +30,7 @@ var moveNodeWithBlockMenu = exports.moveNodeWithBlockMenu = function moveNodeWit
|
|
|
30
30
|
return function (_ref) {
|
|
31
31
|
var _api$blockControls$sh;
|
|
32
32
|
var tr = _ref.tr;
|
|
33
|
-
if (!(0,
|
|
33
|
+
if (!(0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true)) {
|
|
34
34
|
return tr;
|
|
35
35
|
}
|
|
36
36
|
var preservedSelection = api === null || api === void 0 || (_api$blockControls$sh = api.blockControls.sharedState.currentState()) === null || _api$blockControls$sh === void 0 ? void 0 : _api$blockControls$sh.preservedSelection;
|
|
@@ -22,7 +22,7 @@ var _utils3 = require("@atlaskit/editor-tables/utils");
|
|
|
22
22
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
23
23
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
24
24
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
25
|
-
var
|
|
25
|
+
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
26
26
|
var _main = require("../pm-plugins/main");
|
|
27
27
|
var _analytics2 = require("../pm-plugins/utils/analytics");
|
|
28
28
|
var _getNestedNodePosition = require("../pm-plugins/utils/getNestedNodePosition");
|
|
@@ -203,7 +203,7 @@ var moveNodeViaShortcut = exports.moveNodeViaShortcut = function moveNodeViaShor
|
|
|
203
203
|
var moveToPos = -1;
|
|
204
204
|
var isLayoutColumnSelected = selection instanceof _state.NodeSelection && selection.node.type.name === 'layoutColumn';
|
|
205
205
|
if (direction === _types.DIRECTION.LEFT) {
|
|
206
|
-
if (isTopLevelNode && (0,
|
|
206
|
+
if (isTopLevelNode && (0, _editorExperiment.editorExperiment)('advanced_layouts', true)) {
|
|
207
207
|
var _api$core, _api$core2;
|
|
208
208
|
var nodeBefore = $currentNodePos.nodeBefore;
|
|
209
209
|
if (nodeBefore) {
|
|
@@ -247,7 +247,7 @@ var moveNodeViaShortcut = exports.moveNodeViaShortcut = function moveNodeViaShor
|
|
|
247
247
|
moveToPos = $currentNodePos.start() - ((previousNode === null || previousNode === void 0 ? void 0 : previousNode.nodeSize) || 1);
|
|
248
248
|
}
|
|
249
249
|
} else if (direction === _types.DIRECTION.RIGHT) {
|
|
250
|
-
if (isTopLevelNode && (0,
|
|
250
|
+
if (isTopLevelNode && (0, _editorExperiment.editorExperiment)('advanced_layouts', true)) {
|
|
251
251
|
var _api$core4, _api$core5;
|
|
252
252
|
var endOfDoc = $currentNodePos.end();
|
|
253
253
|
moveToPos = $currentNodePos.posAtIndex($currentNodePos.index() + 1);
|
|
@@ -378,7 +378,7 @@ var moveNode = exports.moveNode = function moveNode(api) {
|
|
|
378
378
|
tr: tr
|
|
379
379
|
});
|
|
380
380
|
}
|
|
381
|
-
var preservedSelection = (0,
|
|
381
|
+
var preservedSelection = (0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true) ? api === null || api === void 0 || (_api$blockControls$sh = api.blockControls.sharedState.currentState()) === null || _api$blockControls$sh === void 0 ? void 0 : _api$blockControls$sh.preservedSelection : undefined;
|
|
382
382
|
if (preservedSelection) {
|
|
383
383
|
var $from = tr.doc.resolve(Math.min(start, preservedSelection.from));
|
|
384
384
|
var expandedRange = $from.blockRange(preservedSelection.$to);
|
|
@@ -482,7 +482,7 @@ var moveNode = exports.moveNode = function moveNode(api) {
|
|
|
482
482
|
}));
|
|
483
483
|
if (
|
|
484
484
|
// when move node via block menu, we need to keep the focus on block menu popup, so don't move focus to editor in this scenario
|
|
485
|
-
!(inputMethod === _analytics.INPUT_METHOD.BLOCK_MENU && (0,
|
|
485
|
+
!(inputMethod === _analytics.INPUT_METHOD.BLOCK_MENU && (0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true))) {
|
|
486
486
|
api === null || api === void 0 || api.core.actions.focus();
|
|
487
487
|
}
|
|
488
488
|
var $mappedTo = tr.doc.resolve(mappedTo);
|
|
@@ -494,7 +494,7 @@ var moveNode = exports.moveNode = function moveNode(api) {
|
|
|
494
494
|
_expand.expandedState.set(updatedExpandAncestor.node, wasExpandExpanded);
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
|
-
if ((0,
|
|
497
|
+
if ((0, _editorExperiment.editorExperiment)('advanced_layouts', true)) {
|
|
498
498
|
(0, _analytics2.attachMoveNodeAnalytics)(tr, inputMethod, $handlePos.depth, sourceNodeTypes, $mappedTo === null || $mappedTo === void 0 ? void 0 : $mappedTo.depth, $mappedTo === null || $mappedTo === void 0 ? void 0 : $mappedTo.parent.type.name, $handlePos.sameParent($mappedTo), api, hasSelectedMultipleNodes);
|
|
499
499
|
} else {
|
|
500
500
|
var _api$analytics;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getShouldMoveNode = exports.getPosWhenMoveNodeUp = exports.getPosWhenMoveNodeDown = exports.getNodeBoundsFromSelection = exports.canMoveNodeUpOrDown = void 0;
|
|
7
7
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
8
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
9
|
-
var
|
|
9
|
+
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
10
10
|
var _selection = require("../../pm-plugins/utils/selection");
|
|
11
11
|
/**
|
|
12
12
|
* Gets the current node position and bounds from the selection using the preserved selection logic.
|
|
@@ -33,7 +33,7 @@ var getNodeBoundsFromSelection = exports.getNodeBoundsFromSelection = function g
|
|
|
33
33
|
// Special case: if a media node (file) is selected, we need to get the parent mediaGroup
|
|
34
34
|
// This handles the case where clicking on a file creates a NodeSelection of the media node
|
|
35
35
|
// but we want to move the entire mediaGroup that wraps it
|
|
36
|
-
if (selection instanceof _state.NodeSelection && selection.node.type.name === 'media' && selection.node.attrs.type === 'file' && (0,
|
|
36
|
+
if (selection instanceof _state.NodeSelection && selection.node.type.name === 'media' && selection.node.attrs.type === 'file' && (0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true)) {
|
|
37
37
|
// The media node is wrapped in a mediaGroup, so we need to get the parent position
|
|
38
38
|
var mediaGroupPos = selection.$from.pos - 1;
|
|
39
39
|
var mediaGroupNode = selection.$from.doc.nodeAt(mediaGroupPos);
|
|
@@ -58,7 +58,7 @@ var getNodeBoundsFromSelection = exports.getNodeBoundsFromSelection = function g
|
|
|
58
58
|
var getPosWhenMoveNodeUp = exports.getPosWhenMoveNodeUp = function getPosWhenMoveNodeUp($currentNodePos, currentNodePos) {
|
|
59
59
|
var nodeIndex = $currentNodePos.index();
|
|
60
60
|
var nodeBefore = $currentNodePos.depth > 1 && nodeIndex === 0 ? $currentNodePos.node($currentNodePos.depth) : $currentNodePos.nodeBefore;
|
|
61
|
-
if ((nodeBefore === null || nodeBefore === void 0 ? void 0 : nodeBefore.type.name) === 'layoutColumn' && (0,
|
|
61
|
+
if ((nodeBefore === null || nodeBefore === void 0 ? void 0 : nodeBefore.type.name) === 'layoutColumn' && (0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true)) {
|
|
62
62
|
return -1;
|
|
63
63
|
}
|
|
64
64
|
return nodeBefore ? currentNodePos - nodeBefore.nodeSize : -1;
|
|
@@ -72,7 +72,7 @@ var getPosWhenMoveNodeDown = exports.getPosWhenMoveNodeDown = function getPosWhe
|
|
|
72
72
|
return -1;
|
|
73
73
|
}
|
|
74
74
|
var nodeAfter = tr.doc.nodeAt(nodeAfterPos);
|
|
75
|
-
if ((0,
|
|
75
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true)) {
|
|
76
76
|
var nodeAtCurrentPos = tr.doc.nodeAt($currentNodePos.pos);
|
|
77
77
|
// if move empty line down to another empty line, move to the position of the next empty line
|
|
78
78
|
if ((nodeAtCurrentPos === null || nodeAtCurrentPos === void 0 ? void 0 : nodeAtCurrentPos.content.size) === 0 && nodeAtCurrentPos.type.name !== 'extension' && (nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.content.size) === 0 && nodeAfter.type.name !== 'extension') {
|
|
@@ -8,7 +8,7 @@ exports.shouldDescendIntoNode = exports.nodeDecorations = exports.findNodeDecs =
|
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
10
10
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
11
|
-
var
|
|
11
|
+
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
12
12
|
var _decorationsCommon = require("./decorations-common");
|
|
13
13
|
var IGNORE_NODES = ['tableCell', 'tableHeader', 'tableRow', 'listItem', 'caption', 'layoutColumn'];
|
|
14
14
|
var IGNORE_NODES_NEXT = exports.IGNORE_NODES_NEXT = ['tableCell', 'tableHeader', 'tableRow', 'listItem', 'caption'];
|
|
@@ -22,7 +22,7 @@ var shouldDescendIntoNode = exports.shouldDescendIntoNode = function shouldDesce
|
|
|
22
22
|
return false;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
if ((0,
|
|
25
|
+
if ((0, _editorExperiment.editorExperiment)('advanced_layouts', true)) {
|
|
26
26
|
return !IGNORE_NODE_DESCENDANTS_ADVANCED_LAYOUT.includes(node.type.name);
|
|
27
27
|
}
|
|
28
28
|
return !IGNORE_NODE_DESCENDANTS.includes(node.type.name);
|
|
@@ -36,7 +36,7 @@ var shouldIgnoreNode = function shouldIgnoreNode(node, ignore_nodes, depth, pare
|
|
|
36
36
|
if (isNestedTable) {
|
|
37
37
|
return true;
|
|
38
38
|
}
|
|
39
|
-
var isFirstTableRow = (parent === null || parent === void 0 ? void 0 : parent.type.name) === 'table' && depth === 1 && node === parent.firstChild && 'tableRow' === node.type.name && (0,
|
|
39
|
+
var isFirstTableRow = (parent === null || parent === void 0 ? void 0 : parent.type.name) === 'table' && depth === 1 && node === parent.firstChild && 'tableRow' === node.type.name && (0, _editorExperiment.editorExperiment)('advanced_layouts', true);
|
|
40
40
|
if (isFirstTableRow) {
|
|
41
41
|
return false;
|
|
42
42
|
}
|
|
@@ -82,7 +82,7 @@ var nodeDecorations = exports.nodeDecorations = function nodeDecorations(newStat
|
|
|
82
82
|
}
|
|
83
83
|
var docFrom = from === undefined || from < 0 ? 0 : from;
|
|
84
84
|
var docTo = to === undefined || to > newState.doc.nodeSize - 2 ? newState.doc.nodeSize - 2 : to;
|
|
85
|
-
var ignore_nodes = (0,
|
|
85
|
+
var ignore_nodes = (0, _editorExperiment.editorExperiment)('advanced_layouts', true) ? IGNORE_NODES_NEXT : IGNORE_NODES;
|
|
86
86
|
newState.doc.nodesBetween(docFrom, docTo, function (node, pos, parent, _) {
|
|
87
87
|
var depth = 0;
|
|
88
88
|
var shouldDescend = shouldDescendIntoNode(node);
|
|
@@ -11,7 +11,7 @@ var _uuid = _interopRequireDefault(require("uuid"));
|
|
|
11
11
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
12
12
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
13
13
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
14
|
-
var
|
|
14
|
+
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
15
15
|
var _consts = require("../ui/consts");
|
|
16
16
|
var _dragHandle = require("../ui/drag-handle");
|
|
17
17
|
var _decorationsCommon = require("./decorations-common");
|
|
@@ -63,7 +63,7 @@ var dragHandleDecoration = exports.dragHandleDecoration = function dragHandleDec
|
|
|
63
63
|
(0, _decorationsCommon.unmountDecorations)(nodeViewPortalProviderAPI, 'data-blocks-drag-handle-container', 'data-blocks-drag-handle-key');
|
|
64
64
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
65
65
|
var key = (0, _uuid.default)();
|
|
66
|
-
var widgetSpec = (0,
|
|
66
|
+
var widgetSpec = (0, _editorExperiment.editorExperiment)('platform_editor_breakout_resizing', true) ? {
|
|
67
67
|
side: -1,
|
|
68
68
|
type: _decorationsCommon.TYPE_HANDLE_DEC,
|
|
69
69
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
@@ -139,7 +139,7 @@ var dragHandleDecoration = exports.dragHandleDecoration = function dragHandleDec
|
|
|
139
139
|
// key,
|
|
140
140
|
// );
|
|
141
141
|
|
|
142
|
-
if ((0,
|
|
142
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
143
143
|
(0, _reactRootRegistry.renderToMountPoint)( /*#__PURE__*/(0, _react.createElement)(_dragHandle.DragHandleWithVisibility, {
|
|
144
144
|
view: view,
|
|
145
145
|
api: api,
|
|
@@ -12,7 +12,7 @@ var _utils = require("@atlaskit/editor-common/utils");
|
|
|
12
12
|
var _nodeTypeUtils = require("@atlaskit/editor-common/utils/node-type-utils");
|
|
13
13
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
14
14
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
15
|
-
var
|
|
15
|
+
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
16
16
|
var _decorationsCommon = require("./decorations-common");
|
|
17
17
|
var _decorationsDropTarget = require("./decorations-drop-target");
|
|
18
18
|
var _decorationsFindSurroundingNodes = require("./decorations-find-surrounding-nodes");
|
|
@@ -212,7 +212,7 @@ var getActiveDropTargetDecorations = exports.getActiveDropTargetDecorations = fu
|
|
|
212
212
|
};
|
|
213
213
|
}
|
|
214
214
|
var anchorEmitNodeWithPos = rootNodeWithPos;
|
|
215
|
-
if ((0,
|
|
215
|
+
if ((0, _editorExperiment.editorExperiment)('advanced_layouts', true)) {
|
|
216
216
|
var schema = rootNodeWithPos.node.type.schema;
|
|
217
217
|
var layoutSection = schema.nodes.layoutSection;
|
|
218
218
|
var isLayoutSectionChildOfRoot = (0, _utils2.findChildrenByType)(rootNodeWithPos.node, layoutSection, false).length > 0;
|
|
@@ -15,7 +15,7 @@ var _utils = require("@atlaskit/editor-common/utils");
|
|
|
15
15
|
var _nodeTypeUtils = require("@atlaskit/editor-common/utils/node-type-utils");
|
|
16
16
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
17
17
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
18
|
-
var
|
|
18
|
+
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
19
19
|
var _consts = require("../ui/consts");
|
|
20
20
|
var _dropTarget = require("../ui/drop-target");
|
|
21
21
|
var _dropTargetLayout = require("../ui/drop-target-layout");
|
|
@@ -191,7 +191,7 @@ var dropTargetDecorations = exports.dropTargetDecorations = function dropTargetD
|
|
|
191
191
|
popNodeStack(depth);
|
|
192
192
|
prevNodeStack.push(node);
|
|
193
193
|
};
|
|
194
|
-
var isAdvancedLayoutsPreRelease2 = (0,
|
|
194
|
+
var isAdvancedLayoutsPreRelease2 = (0, _editorExperiment.editorExperiment)('advanced_layouts', true);
|
|
195
195
|
|
|
196
196
|
// For deciding to show drop targets or not when multiple nodes are selected
|
|
197
197
|
var selection = newState.selection;
|
|
@@ -11,7 +11,7 @@ var _uuid = _interopRequireDefault(require("uuid"));
|
|
|
11
11
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
12
12
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
13
13
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
14
|
-
var
|
|
14
|
+
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
15
15
|
var _consts = require("../ui/consts");
|
|
16
16
|
var _quickInsertButton = require("../ui/quick-insert-button");
|
|
17
17
|
var _marks = require("./utils/marks");
|
|
@@ -53,7 +53,7 @@ var quickInsertButtonDecoration = exports.quickInsertButtonDecoration = function
|
|
|
53
53
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
54
54
|
var key = (0, _uuid.default)();
|
|
55
55
|
var cleanupCallbacks = [];
|
|
56
|
-
var widgetSpec = (0,
|
|
56
|
+
var widgetSpec = (0, _editorExperiment.editorExperiment)('platform_editor_breakout_resizing', true) ? {
|
|
57
57
|
side: -2,
|
|
58
58
|
type: TYPE_QUICK_INSERT,
|
|
59
59
|
/**
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.handleMouseDown = void 0;
|
|
7
7
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
8
8
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
9
|
-
var
|
|
9
|
+
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
10
10
|
var handleMouseDown = exports.handleMouseDown = function handleMouseDown(api) {
|
|
11
11
|
return function (view, event) {
|
|
12
12
|
if (!(event.target instanceof HTMLElement)) {
|
|
@@ -34,7 +34,7 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(api) {
|
|
|
34
34
|
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 ? void 0 : api.blockControls.commands.showDragHandleAt(rootPos, '', (_rootNode$type$name3 = rootNode.type.name) !== null && _rootNode$type$name3 !== void 0 ? _rootNode$type$name3 : '', undefined, rootPos, '', (_rootNode$type$name4 = rootNode.type.name) !== null && _rootNode$type$name4 !== void 0 ? _rootNode$type$name4 : ''));
|
|
35
35
|
}
|
|
36
36
|
} else {
|
|
37
|
-
var isDragHandle = event.target.closest((0,
|
|
37
|
+
var isDragHandle = event.target.closest((0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true) ? _styles.DRAG_HANDLE_SELECTOR : '[data-editor-block-ctrl-drag-handle]') !== null;
|
|
38
38
|
api === null || api === void 0 || api.core.actions.execute(function (_ref) {
|
|
39
39
|
var tr = _ref.tr;
|
|
40
40
|
api === null || api === void 0 || api.blockControls.commands.setSelectedViaDragHandle(isDragHandle)({
|
|
@@ -44,7 +44,7 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(api) {
|
|
|
44
44
|
* When block menu is enabled, reset intent back to 'default' as editor-plugin-block-menu sets the user intent to 'blockMenuOpen', and setting here
|
|
45
45
|
* causes flickering as this runs before editor-plugin-block-menu.
|
|
46
46
|
*/
|
|
47
|
-
if ((0,
|
|
47
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true)) {
|
|
48
48
|
// if target is drag handle, block menu will be opened
|
|
49
49
|
if (!isDragHandle) {
|
|
50
50
|
var _api$userIntent;
|
|
@@ -12,7 +12,7 @@ var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
|
|
|
12
12
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
13
13
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
14
14
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
15
|
-
var
|
|
15
|
+
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
16
16
|
var _domAttrName = require("../ui/utils/dom-attr-name");
|
|
17
17
|
var _decorationsAnchor = require("./decorations-anchor");
|
|
18
18
|
var _pluginKey = require("./selection-preservation/plugin-key");
|
|
@@ -115,7 +115,7 @@ var handleMouseOver = exports.handleMouseOver = function handleMouseOver(view, e
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
// If the editor view is not in focus when the block menu is open, do not update the drag handle
|
|
118
|
-
if (!view.hasFocus() && isMenuOpen && (0,
|
|
118
|
+
if (!view.hasFocus() && isMenuOpen && (0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true, {
|
|
119
119
|
exposure: true
|
|
120
120
|
})) {
|
|
121
121
|
return false;
|
|
@@ -166,7 +166,7 @@ var handleMouseOver = exports.handleMouseOver = function handleMouseOver(view, e
|
|
|
166
166
|
if (isEmptyNestedParagraphOrHeading(rootElement)) {
|
|
167
167
|
return false;
|
|
168
168
|
}
|
|
169
|
-
if (rootElement.getAttribute((0, _domAttrName.getTypeNameAttrName)()) === 'media' && (0,
|
|
169
|
+
if (rootElement.getAttribute((0, _domAttrName.getTypeNameAttrName)()) === 'media' && (0, _editorExperiment.editorExperiment)('advanced_layouts', true) && !isNativeAnchorSupported) {
|
|
170
170
|
rootElement = rootElement.closest("[".concat((0, _domAttrName.getAnchorAttrName)(), "][").concat((0, _domAttrName.getTypeNameAttrName)(), "=\"mediaSingle\"]"));
|
|
171
171
|
if (!rootElement) {
|
|
172
172
|
return false;
|
|
@@ -174,7 +174,7 @@ var handleMouseOver = exports.handleMouseOver = function handleMouseOver(view, e
|
|
|
174
174
|
}
|
|
175
175
|
var parentElement = (_rootElement$parentEl = rootElement.parentElement) === null || _rootElement$parentEl === void 0 ? void 0 : _rootElement$parentEl.closest("[".concat((0, _domAttrName.getAnchorAttrName)(), "]"));
|
|
176
176
|
var parentElementType = isNativeAnchorSupported ? (0, _domAttrName.getTypeNameFromDom)(parentElement) : parentElement === null || parentElement === void 0 ? void 0 : parentElement.getAttribute('data-drag-handler-node-type');
|
|
177
|
-
if ((0,
|
|
177
|
+
if ((0, _editorExperiment.editorExperiment)('advanced_layouts', true)) {
|
|
178
178
|
// We want to exclude handles from showing for direct descendant of table nodes (i.e. nodes in cells)
|
|
179
179
|
if (parentElement && parentElementType === 'table') {
|
|
180
180
|
rootElement = parentElement;
|
|
@@ -240,7 +240,7 @@ var handleMouseOver = exports.handleMouseOver = function handleMouseOver(view, e
|
|
|
240
240
|
} else {
|
|
241
241
|
pos = view.posAtDOM(rootElement, 0);
|
|
242
242
|
}
|
|
243
|
-
if (parentRootElement && parentRootElement.getAttribute('data-layout-section') === 'true' && parentRootElement.querySelectorAll('[data-layout-column]').length === 1 && (0,
|
|
243
|
+
if (parentRootElement && parentRootElement.getAttribute('data-layout-section') === 'true' && parentRootElement.querySelectorAll('[data-layout-column]').length === 1 && (0, _editorExperiment.editorExperiment)('advanced_layouts', true) && !(0, _expValEquals.expValEquals)('platform_editor_layout_column_menu', 'isEnabled', true)) {
|
|
244
244
|
// Don't show drag handle for layout column in a single column layout,
|
|
245
245
|
// unless the layout column menu is enabled (menu needs the handle to be accessible).
|
|
246
246
|
return false;
|
|
@@ -269,7 +269,7 @@ var handleMouseOver = exports.handleMouseOver = function handleMouseOver(view, e
|
|
|
269
269
|
if (nodeType) {
|
|
270
270
|
// platform_editor_controls note: enables quick insert
|
|
271
271
|
if (toolbarFlagsEnabled) {
|
|
272
|
-
if ((0,
|
|
272
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true)) {
|
|
273
273
|
var _selectionPreservatio;
|
|
274
274
|
var preservedSelection = (_selectionPreservatio = _pluginKey.selectionPreservationPluginKey.getState(view.state)) === null || _selectionPreservatio === void 0 ? void 0 : _selectionPreservatio.preservedSelection;
|
|
275
275
|
var selection = preservedSelection || view.state.selection;
|
|
@@ -290,7 +290,7 @@ var handleMouseOver = exports.handleMouseOver = function handleMouseOver(view, e
|
|
|
290
290
|
var _api$core3, _api$blockControls5;
|
|
291
291
|
api === null || api === void 0 || (_api$core3 = api.core) === null || _api$core3 === void 0 || _api$core3.actions.execute(api === null || api === void 0 || (_api$blockControls5 = api.blockControls) === null || _api$blockControls5 === void 0 ? void 0 : _api$blockControls5.commands.showDragHandleAt(targetPos, anchorName, nodeType));
|
|
292
292
|
}
|
|
293
|
-
if ((0,
|
|
293
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true)) {
|
|
294
294
|
var _api$userIntent2;
|
|
295
295
|
if (isMenuOpen && originalAnchorName && (api === null || api === void 0 || (_api$userIntent2 = api.userIntent) === null || _api$userIntent2 === void 0 || (_api$userIntent2 = _api$userIntent2.sharedState.currentState()) === null || _api$userIntent2 === void 0 ? void 0 : _api$userIntent2.currentUserIntent) === 'blockMenuOpen') {
|
|
296
296
|
var _api$core4, _api$blockControls6;
|
|
@@ -12,7 +12,7 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
|
12
12
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
13
13
|
var _unsafeExpValNoExposure = require("@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure");
|
|
14
14
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
15
|
-
var
|
|
15
|
+
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
16
16
|
var _constants = require("./constants");
|
|
17
17
|
var _handleKeyDown = require("./handle-key-down");
|
|
18
18
|
var _handleMouseMove = require("./handle-mouse-move");
|
|
@@ -70,7 +70,7 @@ var createInteractionTrackingPlugin = exports.createInteractionTrackingPlugin =
|
|
|
70
70
|
var state = {
|
|
71
71
|
isEditing: false
|
|
72
72
|
};
|
|
73
|
-
if ((0,
|
|
73
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
74
74
|
state.isMouseOut = false;
|
|
75
75
|
}
|
|
76
76
|
return state;
|
|
@@ -113,7 +113,7 @@ var createInteractionTrackingPlugin = exports.createInteractionTrackingPlugin =
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
},
|
|
116
|
-
view: (0,
|
|
116
|
+
view: (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1') ? function (view) {
|
|
117
117
|
var editorContentArea = view.dom.closest('.ak-editor-content-area');
|
|
118
118
|
// rightSideControlsEnabled is the single source of truth (confluence_remix_button_right_side_block_fg from preset)
|
|
119
119
|
|