@atlaskit/editor-plugin-block-controls 31.1.15 → 31.1.17
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/ui/block-controls-left-surface.js +2 -2
- package/dist/cjs/ui/block-controls-right-surface.js +2 -2
- package/dist/cjs/ui/quick-insert-button.js +30 -18
- package/dist/es2019/ui/block-controls-left-surface.js +2 -2
- package/dist/es2019/ui/block-controls-right-surface.js +2 -2
- package/dist/es2019/ui/quick-insert-button.js +15 -2
- package/dist/esm/ui/block-controls-left-surface.js +2 -2
- package/dist/esm/ui/block-controls-right-surface.js +2 -2
- package/dist/esm/ui/quick-insert-button.js +30 -18
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 31.1.17
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`76946179af203`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/76946179af203) -
|
|
8
|
+
[ux] Expand collapsed headings and insert a new paragraph with slash Quick Insert when pressing
|
|
9
|
+
the adjacent plus button, behind `platform_editor_collapsible_headings`. Quick Insert now declares
|
|
10
|
+
the optional block-collapse plugin dependency and preserves single-transaction insertion when the
|
|
11
|
+
existing block-control INP treatment is enabled.
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 31.1.16
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [`f9bb037747011`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f9bb037747011) -
|
|
19
|
+
Clean up the platform_editor_block_controls_sticky_header_fix experiment. The sticky table header
|
|
20
|
+
padding fix for block controls surfaces is now always applied.
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 31.1.15
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -70,7 +70,7 @@ var BlockControlsLeftSurfaceContent = function BlockControlsLeftSurfaceContent(_
|
|
|
70
70
|
style: placement.style,
|
|
71
71
|
className: (0, _runtime.ax)(["_kqswstnw _17c61i8t _1pbyb4wl", isTopLevel && leftSurfaceGutterStyles.container, shouldPassThroughNestedPointerEvents && nestedSurfacePointerEventsStyles.container])
|
|
72
72
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
73
|
-
className: (0, _runtime.ax)(["_zulpv77o _4cvr1h6o _1e0c1txw", isTopLevel && leftSurfaceGutterStyles.row, shouldPassThroughNestedPointerEvents && nestedSurfacePointerEventsStyles.row, isSticky && "_kqsw1if8 _154iu2gc", isSticky && (blockControlsContext === null || blockControlsContext === void 0 ? void 0 : blockControlsContext.targetNode.type.name) === 'table' &&
|
|
73
|
+
className: (0, _runtime.ax)(["_zulpv77o _4cvr1h6o _1e0c1txw", isTopLevel && leftSurfaceGutterStyles.row, shouldPassThroughNestedPointerEvents && nestedSurfacePointerEventsStyles.row, isSticky && "_kqsw1if8 _154iu2gc", isSticky && (blockControlsContext === null || blockControlsContext === void 0 ? void 0 : blockControlsContext.targetNode.type.name) === 'table' && "_154i1ejb"])
|
|
74
74
|
}, /*#__PURE__*/_react.default.createElement(_blockControlsSurfaceComponents.BlockControlsVisibilityProvider, {
|
|
75
75
|
shouldHideHoverControls: shouldHideHoverControls,
|
|
76
76
|
useCssStyles: useCssStyles
|
|
@@ -97,7 +97,7 @@ var BlockControlsLeftSurfaceWrapper = function BlockControlsLeftSurfaceWrapper(_
|
|
|
97
97
|
style: placement.style,
|
|
98
98
|
className: (0, _runtime.ax)(["_kqswstnw _17c61i8t _1pbyb4wl", isTopLevel && leftSurfaceGutterStyles.container, "_3um015vq"])
|
|
99
99
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
100
|
-
className: (0, _runtime.ax)(["_zulpv77o _4cvr1h6o _1e0c1txw", isTopLevel && leftSurfaceGutterStyles.row, isSticky && "_kqsw1if8 _154iu2gc", isSticky && (blockControlsContext === null || blockControlsContext === void 0 ? void 0 : blockControlsContext.targetNode.type.name) === 'table' &&
|
|
100
|
+
className: (0, _runtime.ax)(["_zulpv77o _4cvr1h6o _1e0c1txw", isTopLevel && leftSurfaceGutterStyles.row, isSticky && "_kqsw1if8 _154iu2gc", isSticky && (blockControlsContext === null || blockControlsContext === void 0 ? void 0 : blockControlsContext.targetNode.type.name) === 'table' && "_154i1ejb"])
|
|
101
101
|
}, children));
|
|
102
102
|
};
|
|
103
103
|
|
|
@@ -53,7 +53,7 @@ var BlockControlsRightSurfaceContent = function BlockControlsRightSurfaceContent
|
|
|
53
53
|
style: placement.style,
|
|
54
54
|
className: (0, _runtime.ax)(["_kqswstnw _17c61i8t _1pbyb4wl"])
|
|
55
55
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
56
|
-
className: (0, _runtime.ax)(["_zulpv77o _4cvr1h6o _1e0c1txw", isSticky && "_kqsw1if8 _154iu2gc", isSticky && (blockControlsContext === null || blockControlsContext === void 0 ? void 0 : blockControlsContext.targetNode.type.name) === 'table' &&
|
|
56
|
+
className: (0, _runtime.ax)(["_zulpv77o _4cvr1h6o _1e0c1txw", isSticky && "_kqsw1if8 _154iu2gc", isSticky && (blockControlsContext === null || blockControlsContext === void 0 ? void 0 : blockControlsContext.targetNode.type.name) === 'table' && "_154i1ejb"])
|
|
57
57
|
}, /*#__PURE__*/_react.default.createElement(_blockControlsSurfaceComponents.BlockControlsVisibilityProvider, {
|
|
58
58
|
shouldHideHoverControls: shouldHideHoverControls,
|
|
59
59
|
useCssStyles: useCssStyles
|
|
@@ -79,7 +79,7 @@ var BlockControlsRightSurfaceWrapper = function BlockControlsRightSurfaceWrapper
|
|
|
79
79
|
style: placement.style,
|
|
80
80
|
className: (0, _runtime.ax)(["_kqswstnw _17c61i8t _1pbyb4wl", "_3um015vq"])
|
|
81
81
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
82
|
-
className: (0, _runtime.ax)(["_zulpv77o _4cvr1h6o _1e0c1txw", isSticky && "_kqsw1if8 _154iu2gc", isSticky && (blockControlsContext === null || blockControlsContext === void 0 ? void 0 : blockControlsContext.targetNode.type.name) === 'table' &&
|
|
82
|
+
className: (0, _runtime.ax)(["_zulpv77o _4cvr1h6o _1e0c1txw", isSticky && "_kqsw1if8 _154iu2gc", isSticky && (blockControlsContext === null || blockControlsContext === void 0 ? void 0 : blockControlsContext.targetNode.type.name) === 'table' && "_154i1ejb"])
|
|
83
83
|
}, children));
|
|
84
84
|
};
|
|
85
85
|
|
|
@@ -20,6 +20,7 @@ var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
|
20
20
|
var _constants = require("@atlaskit/editor-shared-styles/constants");
|
|
21
21
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
22
22
|
var _add = _interopRequireDefault(require("@atlaskit/icon/core/add"));
|
|
23
|
+
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
23
24
|
var _box = require("@atlaskit/primitives/box");
|
|
24
25
|
var _pressable = require("@atlaskit/primitives/pressable");
|
|
25
26
|
var _xcss = require("@atlaskit/primitives/xcss/xcss");
|
|
@@ -267,11 +268,22 @@ var TypeAheadControl = exports.TypeAheadControl = function TypeAheadControl(_ref
|
|
|
267
268
|
};
|
|
268
269
|
}, [calculatePosition, view.dom, rootAnchorName, rootNodeType]);
|
|
269
270
|
var handleQuickInsert = (0, _react.useCallback)(function () {
|
|
270
|
-
var _api$quickInsert;
|
|
271
|
+
var _api$blockCollapse, _api$quickInsert;
|
|
271
272
|
// if the selection is not within the node this decoration is rendered at
|
|
272
273
|
// then insert a newline and trigger quick insert
|
|
273
274
|
var start = getPos();
|
|
274
|
-
if (start !== undefined) {
|
|
275
|
+
if (start !== undefined && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_collapsible_headings') && (_api$blockCollapse = api.blockCollapse) !== null && _api$blockCollapse !== void 0 && (_api$blockCollapse = _api$blockCollapse.sharedState.currentState()) !== null && _api$blockCollapse !== void 0 && _api$blockCollapse.collapsedHeadingPositions.has(start)) {
|
|
276
|
+
api.core.actions.execute(function (_ref3) {
|
|
277
|
+
var _api$blockCollapse2;
|
|
278
|
+
var tr = _ref3.tr;
|
|
279
|
+
(_api$blockCollapse2 = api.blockCollapse) === null || _api$blockCollapse2 === void 0 || _api$blockCollapse2.commands.expandHeading(start)({
|
|
280
|
+
tr: tr
|
|
281
|
+
});
|
|
282
|
+
return (0, _editorCommands.createNewLine)(start)({
|
|
283
|
+
tr: tr
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
} else if (start !== undefined) {
|
|
275
287
|
// if the selection is not within the node this decoration is rendered at
|
|
276
288
|
// or the node is non-editable, then insert a newline and trigger quick insert
|
|
277
289
|
var isSelectionInsideNode = (0, _documentChecks.isSelectionInNode)(start, view);
|
|
@@ -296,8 +308,8 @@ var TypeAheadControl = exports.TypeAheadControl = function TypeAheadControl(_ref
|
|
|
296
308
|
var newPos =
|
|
297
309
|
//if the current selection is selected from right to left, then set the selection to the start of the paragraph
|
|
298
310
|
currentSelection.anchor === currentSelection.to ? currentParagraphNode.pos : currentParagraphNode.pos + currentParagraphNode.node.nodeSize - 1;
|
|
299
|
-
api.core.actions.execute(function (
|
|
300
|
-
var tr =
|
|
311
|
+
api.core.actions.execute(function (_ref4) {
|
|
312
|
+
var tr = _ref4.tr;
|
|
301
313
|
tr.setSelection(_state.TextSelection.create(view.state.selection.$from.doc, newPos));
|
|
302
314
|
return tr;
|
|
303
315
|
});
|
|
@@ -311,8 +323,8 @@ var TypeAheadControl = exports.TypeAheadControl = function TypeAheadControl(_ref
|
|
|
311
323
|
// otherwise need to force the selection to be at the start of the node, because
|
|
312
324
|
// prosemirror is keeping it as NodeSelection for nested nodes. Do this to keep it
|
|
313
325
|
// consistent NodeSelection for root level nodes.
|
|
314
|
-
api.core.actions.execute(function (
|
|
315
|
-
var tr =
|
|
326
|
+
api.core.actions.execute(function (_ref5) {
|
|
327
|
+
var tr = _ref5.tr;
|
|
316
328
|
(0, _editorCommands.createNewLine)(view.state.selection.from)({
|
|
317
329
|
tr: tr
|
|
318
330
|
});
|
|
@@ -324,8 +336,8 @@ var TypeAheadControl = exports.TypeAheadControl = function TypeAheadControl(_ref
|
|
|
324
336
|
if (currentSelection instanceof _cellSelection.CellSelection) {
|
|
325
337
|
// find the last inline position in the selection
|
|
326
338
|
var lastInlinePosition = _state.TextSelection.near(view.state.selection.$to, -1);
|
|
327
|
-
lastInlinePosition && api.core.actions.execute(function (
|
|
328
|
-
var tr =
|
|
339
|
+
lastInlinePosition && api.core.actions.execute(function (_ref6) {
|
|
340
|
+
var tr = _ref6.tr;
|
|
329
341
|
if (!(lastInlinePosition instanceof _state.TextSelection)) {
|
|
330
342
|
// this will create a new line after the node
|
|
331
343
|
(0, _editorCommands.createNewLine)(lastInlinePosition.from)({
|
|
@@ -384,16 +396,16 @@ var TypeAheadControl = exports.TypeAheadControl = function TypeAheadControl(_ref
|
|
|
384
396
|
css: [tooltipContainerStyles, tooltipContainerImprovedStylesStickyHeader, tooltipContainerStylesImprovedStickyHeaderWithMarksFix]
|
|
385
397
|
}, tooltipPressable()));
|
|
386
398
|
};
|
|
387
|
-
var QuickInsertWithVisibility = exports.QuickInsertWithVisibility = function QuickInsertWithVisibility(
|
|
388
|
-
var view =
|
|
389
|
-
api =
|
|
390
|
-
formatMessage =
|
|
391
|
-
getPos =
|
|
392
|
-
nodeType =
|
|
393
|
-
anchorName =
|
|
394
|
-
rootAnchorName =
|
|
395
|
-
rootNodeType =
|
|
396
|
-
anchorRectCache =
|
|
399
|
+
var QuickInsertWithVisibility = exports.QuickInsertWithVisibility = function QuickInsertWithVisibility(_ref7) {
|
|
400
|
+
var view = _ref7.view,
|
|
401
|
+
api = _ref7.api,
|
|
402
|
+
formatMessage = _ref7.formatMessage,
|
|
403
|
+
getPos = _ref7.getPos,
|
|
404
|
+
nodeType = _ref7.nodeType,
|
|
405
|
+
anchorName = _ref7.anchorName,
|
|
406
|
+
rootAnchorName = _ref7.rootAnchorName,
|
|
407
|
+
rootNodeType = _ref7.rootNodeType,
|
|
408
|
+
anchorRectCache = _ref7.anchorRectCache;
|
|
397
409
|
var rightSideControlsEnabled = (0, _useSharedPluginStateWithSelector.useSharedPluginStateWithSelector)(api, ['blockControls'], function (states) {
|
|
398
410
|
var _states$blockControls, _states$blockControls2;
|
|
399
411
|
return {
|
|
@@ -65,7 +65,7 @@ const BlockControlsLeftSurfaceContent = ({
|
|
|
65
65
|
style: placement.style,
|
|
66
66
|
className: ax(["_kqswstnw _17c61i8t _1pbyb4wl", isTopLevel && leftSurfaceGutterStyles.container, shouldPassThroughNestedPointerEvents && nestedSurfacePointerEventsStyles.container])
|
|
67
67
|
}, /*#__PURE__*/React.createElement("div", {
|
|
68
|
-
className: ax(["_zulpv77o _4cvr1h6o _1e0c1txw", isTopLevel && leftSurfaceGutterStyles.row, shouldPassThroughNestedPointerEvents && nestedSurfacePointerEventsStyles.row, isSticky && "_kqsw1if8 _154iu2gc", isSticky && (blockControlsContext === null || blockControlsContext === void 0 ? void 0 : blockControlsContext.targetNode.type.name) === 'table' &&
|
|
68
|
+
className: ax(["_zulpv77o _4cvr1h6o _1e0c1txw", isTopLevel && leftSurfaceGutterStyles.row, shouldPassThroughNestedPointerEvents && nestedSurfacePointerEventsStyles.row, isSticky && "_kqsw1if8 _154iu2gc", isSticky && (blockControlsContext === null || blockControlsContext === void 0 ? void 0 : blockControlsContext.targetNode.type.name) === 'table' && "_154i1ejb"])
|
|
69
69
|
}, /*#__PURE__*/React.createElement(BlockControlsVisibilityProvider, {
|
|
70
70
|
shouldHideHoverControls: shouldHideHoverControls,
|
|
71
71
|
useCssStyles: useCssStyles
|
|
@@ -93,7 +93,7 @@ const BlockControlsLeftSurfaceWrapper = ({
|
|
|
93
93
|
style: placement.style,
|
|
94
94
|
className: ax(["_kqswstnw _17c61i8t _1pbyb4wl", isTopLevel && leftSurfaceGutterStyles.container, "_3um015vq"])
|
|
95
95
|
}, /*#__PURE__*/React.createElement("div", {
|
|
96
|
-
className: ax(["_zulpv77o _4cvr1h6o _1e0c1txw", isTopLevel && leftSurfaceGutterStyles.row, isSticky && "_kqsw1if8 _154iu2gc", isSticky && (blockControlsContext === null || blockControlsContext === void 0 ? void 0 : blockControlsContext.targetNode.type.name) === 'table' &&
|
|
96
|
+
className: ax(["_zulpv77o _4cvr1h6o _1e0c1txw", isTopLevel && leftSurfaceGutterStyles.row, isSticky && "_kqsw1if8 _154iu2gc", isSticky && (blockControlsContext === null || blockControlsContext === void 0 ? void 0 : blockControlsContext.targetNode.type.name) === 'table' && "_154i1ejb"])
|
|
97
97
|
}, children));
|
|
98
98
|
};
|
|
99
99
|
|
|
@@ -48,7 +48,7 @@ const BlockControlsRightSurfaceContent = ({
|
|
|
48
48
|
style: placement.style,
|
|
49
49
|
className: ax(["_kqswstnw _17c61i8t _1pbyb4wl"])
|
|
50
50
|
}, /*#__PURE__*/React.createElement("div", {
|
|
51
|
-
className: ax(["_zulpv77o _4cvr1h6o _1e0c1txw", isSticky && "_kqsw1if8 _154iu2gc", isSticky && (blockControlsContext === null || blockControlsContext === void 0 ? void 0 : blockControlsContext.targetNode.type.name) === 'table' &&
|
|
51
|
+
className: ax(["_zulpv77o _4cvr1h6o _1e0c1txw", isSticky && "_kqsw1if8 _154iu2gc", isSticky && (blockControlsContext === null || blockControlsContext === void 0 ? void 0 : blockControlsContext.targetNode.type.name) === 'table' && "_154i1ejb"])
|
|
52
52
|
}, /*#__PURE__*/React.createElement(BlockControlsVisibilityProvider, {
|
|
53
53
|
shouldHideHoverControls: shouldHideHoverControls,
|
|
54
54
|
useCssStyles: useCssStyles
|
|
@@ -75,7 +75,7 @@ const BlockControlsRightSurfaceWrapper = ({
|
|
|
75
75
|
style: placement.style,
|
|
76
76
|
className: ax(["_kqswstnw _17c61i8t _1pbyb4wl", "_3um015vq"])
|
|
77
77
|
}, /*#__PURE__*/React.createElement("div", {
|
|
78
|
-
className: ax(["_zulpv77o _4cvr1h6o _1e0c1txw", isSticky && "_kqsw1if8 _154iu2gc", isSticky && (blockControlsContext === null || blockControlsContext === void 0 ? void 0 : blockControlsContext.targetNode.type.name) === 'table' &&
|
|
78
|
+
className: ax(["_zulpv77o _4cvr1h6o _1e0c1txw", isSticky && "_kqsw1if8 _154iu2gc", isSticky && (blockControlsContext === null || blockControlsContext === void 0 ? void 0 : blockControlsContext.targetNode.type.name) === 'table' && "_154i1ejb"])
|
|
79
79
|
}, children));
|
|
80
80
|
};
|
|
81
81
|
|
|
@@ -16,6 +16,7 @@ import { findParentNode, findParentNodeOfType } from '@atlaskit/editor-prosemirr
|
|
|
16
16
|
import { relativeSizeToBaseFontSize } from '@atlaskit/editor-shared-styles/constants';
|
|
17
17
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
18
18
|
import AddIcon from '@atlaskit/icon/core/add';
|
|
19
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
19
20
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
20
21
|
import { Box } from '@atlaskit/primitives/box';
|
|
21
22
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
@@ -259,11 +260,23 @@ export const TypeAheadControl = ({
|
|
|
259
260
|
};
|
|
260
261
|
}, [calculatePosition, view.dom, rootAnchorName, rootNodeType]);
|
|
261
262
|
const handleQuickInsert = useCallback(() => {
|
|
262
|
-
var _api$quickInsert;
|
|
263
|
+
var _api$blockCollapse, _api$blockCollapse$sh, _api$quickInsert;
|
|
263
264
|
// if the selection is not within the node this decoration is rendered at
|
|
264
265
|
// then insert a newline and trigger quick insert
|
|
265
266
|
const start = getPos();
|
|
266
|
-
if (start !== undefined) {
|
|
267
|
+
if (start !== undefined && isExperimentEnabled('platform_editor_collapsible_headings') && (_api$blockCollapse = api.blockCollapse) !== null && _api$blockCollapse !== void 0 && (_api$blockCollapse$sh = _api$blockCollapse.sharedState.currentState()) !== null && _api$blockCollapse$sh !== void 0 && _api$blockCollapse$sh.collapsedHeadingPositions.has(start)) {
|
|
268
|
+
api.core.actions.execute(({
|
|
269
|
+
tr
|
|
270
|
+
}) => {
|
|
271
|
+
var _api$blockCollapse2;
|
|
272
|
+
(_api$blockCollapse2 = api.blockCollapse) === null || _api$blockCollapse2 === void 0 ? void 0 : _api$blockCollapse2.commands.expandHeading(start)({
|
|
273
|
+
tr
|
|
274
|
+
});
|
|
275
|
+
return createNewLine(start)({
|
|
276
|
+
tr
|
|
277
|
+
});
|
|
278
|
+
});
|
|
279
|
+
} else if (start !== undefined) {
|
|
267
280
|
// if the selection is not within the node this decoration is rendered at
|
|
268
281
|
// or the node is non-editable, then insert a newline and trigger quick insert
|
|
269
282
|
const isSelectionInsideNode = isSelectionInNode(start, view);
|
|
@@ -63,7 +63,7 @@ var BlockControlsLeftSurfaceContent = function BlockControlsLeftSurfaceContent(_
|
|
|
63
63
|
style: placement.style,
|
|
64
64
|
className: ax(["_kqswstnw _17c61i8t _1pbyb4wl", isTopLevel && leftSurfaceGutterStyles.container, shouldPassThroughNestedPointerEvents && nestedSurfacePointerEventsStyles.container])
|
|
65
65
|
}, /*#__PURE__*/React.createElement("div", {
|
|
66
|
-
className: ax(["_zulpv77o _4cvr1h6o _1e0c1txw", isTopLevel && leftSurfaceGutterStyles.row, shouldPassThroughNestedPointerEvents && nestedSurfacePointerEventsStyles.row, isSticky && "_kqsw1if8 _154iu2gc", isSticky && (blockControlsContext === null || blockControlsContext === void 0 ? void 0 : blockControlsContext.targetNode.type.name) === 'table' &&
|
|
66
|
+
className: ax(["_zulpv77o _4cvr1h6o _1e0c1txw", isTopLevel && leftSurfaceGutterStyles.row, shouldPassThroughNestedPointerEvents && nestedSurfacePointerEventsStyles.row, isSticky && "_kqsw1if8 _154iu2gc", isSticky && (blockControlsContext === null || blockControlsContext === void 0 ? void 0 : blockControlsContext.targetNode.type.name) === 'table' && "_154i1ejb"])
|
|
67
67
|
}, /*#__PURE__*/React.createElement(BlockControlsVisibilityProvider, {
|
|
68
68
|
shouldHideHoverControls: shouldHideHoverControls,
|
|
69
69
|
useCssStyles: useCssStyles
|
|
@@ -90,7 +90,7 @@ var BlockControlsLeftSurfaceWrapper = function BlockControlsLeftSurfaceWrapper(_
|
|
|
90
90
|
style: placement.style,
|
|
91
91
|
className: ax(["_kqswstnw _17c61i8t _1pbyb4wl", isTopLevel && leftSurfaceGutterStyles.container, "_3um015vq"])
|
|
92
92
|
}, /*#__PURE__*/React.createElement("div", {
|
|
93
|
-
className: ax(["_zulpv77o _4cvr1h6o _1e0c1txw", isTopLevel && leftSurfaceGutterStyles.row, isSticky && "_kqsw1if8 _154iu2gc", isSticky && (blockControlsContext === null || blockControlsContext === void 0 ? void 0 : blockControlsContext.targetNode.type.name) === 'table' &&
|
|
93
|
+
className: ax(["_zulpv77o _4cvr1h6o _1e0c1txw", isTopLevel && leftSurfaceGutterStyles.row, isSticky && "_kqsw1if8 _154iu2gc", isSticky && (blockControlsContext === null || blockControlsContext === void 0 ? void 0 : blockControlsContext.targetNode.type.name) === 'table' && "_154i1ejb"])
|
|
94
94
|
}, children));
|
|
95
95
|
};
|
|
96
96
|
|
|
@@ -46,7 +46,7 @@ var BlockControlsRightSurfaceContent = function BlockControlsRightSurfaceContent
|
|
|
46
46
|
style: placement.style,
|
|
47
47
|
className: ax(["_kqswstnw _17c61i8t _1pbyb4wl"])
|
|
48
48
|
}, /*#__PURE__*/React.createElement("div", {
|
|
49
|
-
className: ax(["_zulpv77o _4cvr1h6o _1e0c1txw", isSticky && "_kqsw1if8 _154iu2gc", isSticky && (blockControlsContext === null || blockControlsContext === void 0 ? void 0 : blockControlsContext.targetNode.type.name) === 'table' &&
|
|
49
|
+
className: ax(["_zulpv77o _4cvr1h6o _1e0c1txw", isSticky && "_kqsw1if8 _154iu2gc", isSticky && (blockControlsContext === null || blockControlsContext === void 0 ? void 0 : blockControlsContext.targetNode.type.name) === 'table' && "_154i1ejb"])
|
|
50
50
|
}, /*#__PURE__*/React.createElement(BlockControlsVisibilityProvider, {
|
|
51
51
|
shouldHideHoverControls: shouldHideHoverControls,
|
|
52
52
|
useCssStyles: useCssStyles
|
|
@@ -72,7 +72,7 @@ var BlockControlsRightSurfaceWrapper = function BlockControlsRightSurfaceWrapper
|
|
|
72
72
|
style: placement.style,
|
|
73
73
|
className: ax(["_kqswstnw _17c61i8t _1pbyb4wl", "_3um015vq"])
|
|
74
74
|
}, /*#__PURE__*/React.createElement("div", {
|
|
75
|
-
className: ax(["_zulpv77o _4cvr1h6o _1e0c1txw", isSticky && "_kqsw1if8 _154iu2gc", isSticky && (blockControlsContext === null || blockControlsContext === void 0 ? void 0 : blockControlsContext.targetNode.type.name) === 'table' &&
|
|
75
|
+
className: ax(["_zulpv77o _4cvr1h6o _1e0c1txw", isSticky && "_kqsw1if8 _154iu2gc", isSticky && (blockControlsContext === null || blockControlsContext === void 0 ? void 0 : blockControlsContext.targetNode.type.name) === 'table' && "_154i1ejb"])
|
|
76
76
|
}, children));
|
|
77
77
|
};
|
|
78
78
|
|
|
@@ -20,6 +20,7 @@ import { findParentNode, findParentNodeOfType } from '@atlaskit/editor-prosemirr
|
|
|
20
20
|
import { relativeSizeToBaseFontSize } from '@atlaskit/editor-shared-styles/constants';
|
|
21
21
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
22
22
|
import AddIcon from '@atlaskit/icon/core/add';
|
|
23
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
23
24
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
24
25
|
import { Box } from '@atlaskit/primitives/box';
|
|
25
26
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
@@ -261,11 +262,22 @@ export var TypeAheadControl = function TypeAheadControl(_ref2) {
|
|
|
261
262
|
};
|
|
262
263
|
}, [calculatePosition, view.dom, rootAnchorName, rootNodeType]);
|
|
263
264
|
var handleQuickInsert = useCallback(function () {
|
|
264
|
-
var _api$quickInsert;
|
|
265
|
+
var _api$blockCollapse, _api$quickInsert;
|
|
265
266
|
// if the selection is not within the node this decoration is rendered at
|
|
266
267
|
// then insert a newline and trigger quick insert
|
|
267
268
|
var start = getPos();
|
|
268
|
-
if (start !== undefined) {
|
|
269
|
+
if (start !== undefined && isExperimentEnabled('platform_editor_collapsible_headings') && (_api$blockCollapse = api.blockCollapse) !== null && _api$blockCollapse !== void 0 && (_api$blockCollapse = _api$blockCollapse.sharedState.currentState()) !== null && _api$blockCollapse !== void 0 && _api$blockCollapse.collapsedHeadingPositions.has(start)) {
|
|
270
|
+
api.core.actions.execute(function (_ref3) {
|
|
271
|
+
var _api$blockCollapse2;
|
|
272
|
+
var tr = _ref3.tr;
|
|
273
|
+
(_api$blockCollapse2 = api.blockCollapse) === null || _api$blockCollapse2 === void 0 || _api$blockCollapse2.commands.expandHeading(start)({
|
|
274
|
+
tr: tr
|
|
275
|
+
});
|
|
276
|
+
return createNewLine(start)({
|
|
277
|
+
tr: tr
|
|
278
|
+
});
|
|
279
|
+
});
|
|
280
|
+
} else if (start !== undefined) {
|
|
269
281
|
// if the selection is not within the node this decoration is rendered at
|
|
270
282
|
// or the node is non-editable, then insert a newline and trigger quick insert
|
|
271
283
|
var isSelectionInsideNode = isSelectionInNode(start, view);
|
|
@@ -290,8 +302,8 @@ export var TypeAheadControl = function TypeAheadControl(_ref2) {
|
|
|
290
302
|
var newPos =
|
|
291
303
|
//if the current selection is selected from right to left, then set the selection to the start of the paragraph
|
|
292
304
|
currentSelection.anchor === currentSelection.to ? currentParagraphNode.pos : currentParagraphNode.pos + currentParagraphNode.node.nodeSize - 1;
|
|
293
|
-
api.core.actions.execute(function (
|
|
294
|
-
var tr =
|
|
305
|
+
api.core.actions.execute(function (_ref4) {
|
|
306
|
+
var tr = _ref4.tr;
|
|
295
307
|
tr.setSelection(TextSelection.create(view.state.selection.$from.doc, newPos));
|
|
296
308
|
return tr;
|
|
297
309
|
});
|
|
@@ -305,8 +317,8 @@ export var TypeAheadControl = function TypeAheadControl(_ref2) {
|
|
|
305
317
|
// otherwise need to force the selection to be at the start of the node, because
|
|
306
318
|
// prosemirror is keeping it as NodeSelection for nested nodes. Do this to keep it
|
|
307
319
|
// consistent NodeSelection for root level nodes.
|
|
308
|
-
api.core.actions.execute(function (
|
|
309
|
-
var tr =
|
|
320
|
+
api.core.actions.execute(function (_ref5) {
|
|
321
|
+
var tr = _ref5.tr;
|
|
310
322
|
createNewLine(view.state.selection.from)({
|
|
311
323
|
tr: tr
|
|
312
324
|
});
|
|
@@ -318,8 +330,8 @@ export var TypeAheadControl = function TypeAheadControl(_ref2) {
|
|
|
318
330
|
if (currentSelection instanceof CellSelection) {
|
|
319
331
|
// find the last inline position in the selection
|
|
320
332
|
var lastInlinePosition = TextSelection.near(view.state.selection.$to, -1);
|
|
321
|
-
lastInlinePosition && api.core.actions.execute(function (
|
|
322
|
-
var tr =
|
|
333
|
+
lastInlinePosition && api.core.actions.execute(function (_ref6) {
|
|
334
|
+
var tr = _ref6.tr;
|
|
323
335
|
if (!(lastInlinePosition instanceof TextSelection)) {
|
|
324
336
|
// this will create a new line after the node
|
|
325
337
|
createNewLine(lastInlinePosition.from)({
|
|
@@ -378,16 +390,16 @@ export var TypeAheadControl = function TypeAheadControl(_ref2) {
|
|
|
378
390
|
css: [tooltipContainerStyles, tooltipContainerImprovedStylesStickyHeader, tooltipContainerStylesImprovedStickyHeaderWithMarksFix]
|
|
379
391
|
}, tooltipPressable()));
|
|
380
392
|
};
|
|
381
|
-
export var QuickInsertWithVisibility = function QuickInsertWithVisibility(
|
|
382
|
-
var view =
|
|
383
|
-
api =
|
|
384
|
-
formatMessage =
|
|
385
|
-
getPos =
|
|
386
|
-
nodeType =
|
|
387
|
-
anchorName =
|
|
388
|
-
rootAnchorName =
|
|
389
|
-
rootNodeType =
|
|
390
|
-
anchorRectCache =
|
|
393
|
+
export var QuickInsertWithVisibility = function QuickInsertWithVisibility(_ref7) {
|
|
394
|
+
var view = _ref7.view,
|
|
395
|
+
api = _ref7.api,
|
|
396
|
+
formatMessage = _ref7.formatMessage,
|
|
397
|
+
getPos = _ref7.getPos,
|
|
398
|
+
nodeType = _ref7.nodeType,
|
|
399
|
+
anchorName = _ref7.anchorName,
|
|
400
|
+
rootAnchorName = _ref7.rootAnchorName,
|
|
401
|
+
rootNodeType = _ref7.rootNodeType,
|
|
402
|
+
anchorRectCache = _ref7.anchorRectCache;
|
|
391
403
|
var rightSideControlsEnabled = useSharedPluginStateWithSelector(api, ['blockControls'], function (states) {
|
|
392
404
|
var _states$blockControls, _states$blockControls2;
|
|
393
405
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "31.1.
|
|
3
|
+
"version": "31.1.17",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"@atlaskit/editor-plugin-interaction": "^44.0.0",
|
|
39
39
|
"@atlaskit/editor-plugin-limited-mode": "^27.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-metrics": "^31.0.0",
|
|
41
|
-
"@atlaskit/editor-plugin-quick-insert": "^30.
|
|
41
|
+
"@atlaskit/editor-plugin-quick-insert": "^30.1.0",
|
|
42
42
|
"@atlaskit/editor-plugin-selection": "^30.0.0",
|
|
43
43
|
"@atlaskit/editor-plugin-show-diff": "^30.0.0",
|
|
44
|
-
"@atlaskit/editor-plugin-toolbar": "^27.
|
|
44
|
+
"@atlaskit/editor-plugin-toolbar": "^27.1.0",
|
|
45
45
|
"@atlaskit/editor-plugin-type-ahead": "^31.0.0",
|
|
46
46
|
"@atlaskit/editor-plugin-ui-control-registry": "^24.0.0",
|
|
47
47
|
"@atlaskit/editor-plugin-user-intent": "^28.0.0",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@atlaskit/editor-shared-styles": "^5.1.0",
|
|
51
51
|
"@atlaskit/editor-tables": "^3.2.0",
|
|
52
52
|
"@atlaskit/editor-ui-control-model": "^3.0.0",
|
|
53
|
-
"@atlaskit/icon": "^38.
|
|
53
|
+
"@atlaskit/icon": "^38.1.0",
|
|
54
54
|
"@atlaskit/link": "^5.1.0",
|
|
55
55
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
56
56
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
@@ -58,10 +58,10 @@
|
|
|
58
58
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.2.0",
|
|
59
59
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^4.2.0",
|
|
60
60
|
"@atlaskit/primitives": "^22.7.0",
|
|
61
|
-
"@atlaskit/section-message": "^10.
|
|
61
|
+
"@atlaskit/section-message": "^10.3.0",
|
|
62
62
|
"@atlaskit/theme": "^28.2.0",
|
|
63
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
64
|
-
"@atlaskit/tokens": "^20.
|
|
63
|
+
"@atlaskit/tmp-editor-statsig": "^262.0.0",
|
|
64
|
+
"@atlaskit/tokens": "^20.12.0",
|
|
65
65
|
"@atlaskit/tooltip": "^24.4.0",
|
|
66
66
|
"@babel/runtime": "^7.0.0",
|
|
67
67
|
"@compiled/react": "^1.0.2",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"uuid": "^11.1.1"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
|
-
"@atlaskit/editor-common": "^134.
|
|
75
|
+
"@atlaskit/editor-common": "^134.19.0",
|
|
76
76
|
"react": "^18.2.0 || ^19.2.0",
|
|
77
77
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
78
78
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
|
-
"@atlaskit/editor-common": "^134.
|
|
99
|
+
"@atlaskit/editor-common": "^134.19.0",
|
|
100
100
|
"@atlassian/structured-docs-types": "workspace:^",
|
|
101
101
|
"@atlassian/workbench": "workspace:*",
|
|
102
102
|
"react": "^19.2.0",
|