@atlaskit/editor-plugin-block-controls 2.13.27 → 2.13.28
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/ui/global-styles.js +16 -1
- package/dist/cjs/ui/inline-drop-target.js +16 -4
- package/dist/es2019/ui/global-styles.js +17 -2
- package/dist/es2019/ui/inline-drop-target.js +16 -4
- package/dist/esm/ui/global-styles.js +17 -2
- package/dist/esm/ui/inline-drop-target.js +16 -4
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 2.13.28
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#170667](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/170667)
|
|
8
|
+
[`4932e429b1256`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4932e429b1256) -
|
|
9
|
+
[ED-25679] Fix inline drop target positioning for block card, embeded card and chart extension
|
|
10
|
+
with breakout layout
|
|
11
|
+
|
|
3
12
|
## 2.13.27
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -202,8 +202,23 @@ var withAnchorNameZindexNestedStyle = (0, _react.css)({
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
});
|
|
205
|
+
|
|
206
|
+
// This style is used to define width for block card (with datasource) that does not have layout
|
|
207
|
+
// In full-width editor, block card has width of full-width layout
|
|
208
|
+
// In fixed-width editor, block card has width of wide layout
|
|
209
|
+
var blockCardWithoutLayout = (0, _react.css)({
|
|
210
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
211
|
+
'.ak-editor-content-area.fabric-editor--full-width-mode .ProseMirror .ProseMirror-widget[data-blocks-drop-target-container="true"]': {
|
|
212
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
213
|
+
'--ak-editor-block-card-width': "min(calc(100cqw - ".concat(_editorSharedStyles.akEditorBreakoutPadding, "px), 1800px)")
|
|
214
|
+
},
|
|
215
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
216
|
+
'.ak-editor-content-area .ProseMirror .ProseMirror-widget[data-blocks-drop-target-container="true"]': {
|
|
217
|
+
'--ak-editor-block-card-width': 'max(var(--ak-editor--legacy-breakout-wide-layout-width), var(--ak-editor--line-length))'
|
|
218
|
+
}
|
|
219
|
+
});
|
|
205
220
|
var GlobalStylesWrapper = exports.GlobalStylesWrapper = function GlobalStylesWrapper() {
|
|
206
221
|
return (0, _react.jsx)(_react.Global, {
|
|
207
|
-
styles: [globalStyles(), (0, _experiments.editorExperiment)('nested-dnd', true) ? extendedHoverZoneNested() : extendedHoverZone(), getTextNodeStyle(), withDeleteLinesStyleFix, withMediaSingleStyleFix, legacyBreakoutWideLayoutStyle, (0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_fix_patch_1') ? withDividerInPanelStyleFix : undefined, (0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_fix_patch_2') ? withFormatInLayoutStyleFix : undefined, (0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_fix_patch_3') ? [withRelativePosStyle, topLevelNodeMarginStyles, (0, _experiments.editorExperiment)('nested-dnd', true) ? withAnchorNameZindexNestedStyle : withAnchorNameZindexStyle] : undefined]
|
|
222
|
+
styles: [globalStyles(), (0, _experiments.editorExperiment)('nested-dnd', true) ? extendedHoverZoneNested() : extendedHoverZone(), getTextNodeStyle(), withDeleteLinesStyleFix, withMediaSingleStyleFix, legacyBreakoutWideLayoutStyle, (0, _experiments.editorExperiment)('advanced_layouts', true) ? blockCardWithoutLayout : undefined, (0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_fix_patch_1') ? withDividerInPanelStyleFix : undefined, (0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_fix_patch_2') ? withFormatInLayoutStyleFix : undefined, (0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_fix_patch_3') ? [withRelativePosStyle, topLevelNodeMarginStyles, (0, _experiments.editorExperiment)('nested-dnd', true) ? withAnchorNameZindexNestedStyle : withAnchorNameZindexStyle] : undefined]
|
|
208
223
|
});
|
|
209
224
|
};
|
|
@@ -8,6 +8,7 @@ exports.InlineDropTarget = void 0;
|
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
|
+
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
11
12
|
var _box = require("@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box");
|
|
12
13
|
var _adapter = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
|
|
13
14
|
var _colors = require("@atlaskit/theme/colors");
|
|
@@ -51,9 +52,11 @@ var defaultNodeDimension = {
|
|
|
51
52
|
bottom: 'unset'
|
|
52
53
|
};
|
|
53
54
|
var getWidthOffset = function getWidthOffset(node, width, position) {
|
|
54
|
-
if (
|
|
55
|
+
if (['mediaSingle', 'table', 'embedCard'].includes(node.type.name) ||
|
|
56
|
+
// block card (without datasource) is positioned left-aligned, hence share the same logic as align-start
|
|
57
|
+
node.type.name === 'blockCard' && !node.attrs.datasource) {
|
|
55
58
|
var isLeftPosition = position === 'left';
|
|
56
|
-
if (node.attrs.layout === 'align-start') {
|
|
59
|
+
if (node.attrs.layout === 'align-start' || node.type.name === 'blockCard') {
|
|
57
60
|
return isLeftPosition ? "-0.5*(var(--ak-editor--line-length) - ".concat(width, ")") : "0.5*(var(--ak-editor--line-length) - ".concat(width, ")");
|
|
58
61
|
} else if ((node === null || node === void 0 ? void 0 : node.attrs.layout) === 'align-end') {
|
|
59
62
|
return isLeftPosition ? "0.5*(var(--ak-editor--line-length) - ".concat(width, ")") : "-0.5*(var(--ak-editor--line-length) - ".concat(width, ")");
|
|
@@ -89,11 +92,20 @@ var InlineDropTarget = exports.InlineDropTarget = function InlineDropTarget(_ref
|
|
|
89
92
|
}
|
|
90
93
|
var innerContainerWidth = null;
|
|
91
94
|
var targetAnchorName = anchorName;
|
|
92
|
-
if (['blockCard', 'embedCard'].includes(nextNode.type.name)) {
|
|
95
|
+
if (['blockCard', 'embedCard', 'extension'].includes(nextNode.type.name)) {
|
|
93
96
|
if (nextNode.attrs.layout === 'wide') {
|
|
94
97
|
innerContainerWidth = "max(var(--ak-editor--legacy-breakout-wide-layout-width), var(--ak-editor--line-length))";
|
|
95
98
|
} else if (nextNode.attrs.layout === 'full-width') {
|
|
96
|
-
innerContainerWidth =
|
|
99
|
+
innerContainerWidth = "min(calc(100cqw - ".concat(_editorSharedStyles.akEditorBreakoutPadding, "px), 1800px)");
|
|
100
|
+
}
|
|
101
|
+
if (nextNode.type.name === 'blockCard' && !nextNode.attrs.layout && nextNode.attrs.datasource) {
|
|
102
|
+
// block card with sourceNode and without layout has different width in full-width vs fixed-width editor
|
|
103
|
+
// Hence we need to set it based on editor mode
|
|
104
|
+
innerContainerWidth = 'var(--ak-editor-block-card-width)';
|
|
105
|
+
}
|
|
106
|
+
if (nextNode.type.name === 'embedCard' && ['center', 'align-start', 'align-end'].includes(nextNode.attrs.layout)) {
|
|
107
|
+
var percentageWidth = ((parseFloat(nextNode.attrs.width) || 100) / 100).toFixed(2);
|
|
108
|
+
innerContainerWidth = "calc(var(--ak-editor--line-length) * ".concat(percentageWidth, ")");
|
|
97
109
|
}
|
|
98
110
|
} else if (nextNode.type.name === 'table' && nextNode.firstChild) {
|
|
99
111
|
var tableWidthAnchor = (0, _decorationsCommon.getNodeAnchor)(nextNode.firstChild);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
6
|
import { css, Global, jsx } from '@emotion/react';
|
|
7
|
-
import { akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport } from '@atlaskit/editor-shared-styles';
|
|
7
|
+
import { akEditorBreakoutPadding, akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport } from '@atlaskit/editor-shared-styles';
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
9
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
10
10
|
import { DRAG_HANDLE_MAX_WIDTH_PLUS_GAP, DRAG_HANDLE_WIDTH } from './consts';
|
|
@@ -244,8 +244,23 @@ const withAnchorNameZindexNestedStyle = css({
|
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
});
|
|
247
|
+
|
|
248
|
+
// This style is used to define width for block card (with datasource) that does not have layout
|
|
249
|
+
// In full-width editor, block card has width of full-width layout
|
|
250
|
+
// In fixed-width editor, block card has width of wide layout
|
|
251
|
+
const blockCardWithoutLayout = css({
|
|
252
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
253
|
+
'.ak-editor-content-area.fabric-editor--full-width-mode .ProseMirror .ProseMirror-widget[data-blocks-drop-target-container="true"]': {
|
|
254
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
255
|
+
'--ak-editor-block-card-width': `min(calc(100cqw - ${akEditorBreakoutPadding}px), 1800px)`
|
|
256
|
+
},
|
|
257
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
258
|
+
'.ak-editor-content-area .ProseMirror .ProseMirror-widget[data-blocks-drop-target-container="true"]': {
|
|
259
|
+
'--ak-editor-block-card-width': 'max(var(--ak-editor--legacy-breakout-wide-layout-width), var(--ak-editor--line-length))'
|
|
260
|
+
}
|
|
261
|
+
});
|
|
247
262
|
export const GlobalStylesWrapper = () => {
|
|
248
263
|
return jsx(Global, {
|
|
249
|
-
styles: [globalStyles(), editorExperiment('nested-dnd', true) ? extendedHoverZoneNested() : extendedHoverZone(), getTextNodeStyle(), withDeleteLinesStyleFix, withMediaSingleStyleFix, legacyBreakoutWideLayoutStyle, fg('platform_editor_element_dnd_nested_fix_patch_1') ? withDividerInPanelStyleFix : undefined, fg('platform_editor_element_dnd_nested_fix_patch_2') ? withFormatInLayoutStyleFix : undefined, fg('platform_editor_element_dnd_nested_fix_patch_3') ? [withRelativePosStyle, topLevelNodeMarginStyles, editorExperiment('nested-dnd', true) ? withAnchorNameZindexNestedStyle : withAnchorNameZindexStyle] : undefined]
|
|
264
|
+
styles: [globalStyles(), editorExperiment('nested-dnd', true) ? extendedHoverZoneNested() : extendedHoverZone(), getTextNodeStyle(), withDeleteLinesStyleFix, withMediaSingleStyleFix, legacyBreakoutWideLayoutStyle, editorExperiment('advanced_layouts', true) ? blockCardWithoutLayout : undefined, fg('platform_editor_element_dnd_nested_fix_patch_1') ? withDividerInPanelStyleFix : undefined, fg('platform_editor_element_dnd_nested_fix_patch_2') ? withFormatInLayoutStyleFix : undefined, fg('platform_editor_element_dnd_nested_fix_patch_3') ? [withRelativePosStyle, topLevelNodeMarginStyles, editorExperiment('nested-dnd', true) ? withAnchorNameZindexNestedStyle : withAnchorNameZindexStyle] : undefined]
|
|
250
265
|
});
|
|
251
266
|
};
|
|
@@ -8,6 +8,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
|
8
8
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
10
10
|
import { css, jsx } from '@emotion/react';
|
|
11
|
+
import { akEditorBreakoutPadding } from '@atlaskit/editor-shared-styles';
|
|
11
12
|
import { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';
|
|
12
13
|
import { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
13
14
|
import { B200 } from '@atlaskit/theme/colors';
|
|
@@ -42,9 +43,11 @@ const defaultNodeDimension = {
|
|
|
42
43
|
bottom: 'unset'
|
|
43
44
|
};
|
|
44
45
|
const getWidthOffset = (node, width, position) => {
|
|
45
|
-
if (
|
|
46
|
+
if (['mediaSingle', 'table', 'embedCard'].includes(node.type.name) ||
|
|
47
|
+
// block card (without datasource) is positioned left-aligned, hence share the same logic as align-start
|
|
48
|
+
node.type.name === 'blockCard' && !node.attrs.datasource) {
|
|
46
49
|
const isLeftPosition = position === 'left';
|
|
47
|
-
if (node.attrs.layout === 'align-start') {
|
|
50
|
+
if (node.attrs.layout === 'align-start' || node.type.name === 'blockCard') {
|
|
48
51
|
return isLeftPosition ? `-0.5*(var(--ak-editor--line-length) - ${width})` : `0.5*(var(--ak-editor--line-length) - ${width})`;
|
|
49
52
|
} else if ((node === null || node === void 0 ? void 0 : node.attrs.layout) === 'align-end') {
|
|
50
53
|
return isLeftPosition ? `0.5*(var(--ak-editor--line-length) - ${width})` : `-0.5*(var(--ak-editor--line-length) - ${width})`;
|
|
@@ -76,11 +79,20 @@ export const InlineDropTarget = ({
|
|
|
76
79
|
}
|
|
77
80
|
let innerContainerWidth = null;
|
|
78
81
|
let targetAnchorName = anchorName;
|
|
79
|
-
if (['blockCard', 'embedCard'].includes(nextNode.type.name)) {
|
|
82
|
+
if (['blockCard', 'embedCard', 'extension'].includes(nextNode.type.name)) {
|
|
80
83
|
if (nextNode.attrs.layout === 'wide') {
|
|
81
84
|
innerContainerWidth = `max(var(--ak-editor--legacy-breakout-wide-layout-width), var(--ak-editor--line-length))`;
|
|
82
85
|
} else if (nextNode.attrs.layout === 'full-width') {
|
|
83
|
-
innerContainerWidth =
|
|
86
|
+
innerContainerWidth = `min(calc(100cqw - ${akEditorBreakoutPadding}px), 1800px)`;
|
|
87
|
+
}
|
|
88
|
+
if (nextNode.type.name === 'blockCard' && !nextNode.attrs.layout && nextNode.attrs.datasource) {
|
|
89
|
+
// block card with sourceNode and without layout has different width in full-width vs fixed-width editor
|
|
90
|
+
// Hence we need to set it based on editor mode
|
|
91
|
+
innerContainerWidth = 'var(--ak-editor-block-card-width)';
|
|
92
|
+
}
|
|
93
|
+
if (nextNode.type.name === 'embedCard' && ['center', 'align-start', 'align-end'].includes(nextNode.attrs.layout)) {
|
|
94
|
+
const percentageWidth = ((parseFloat(nextNode.attrs.width) || 100) / 100).toFixed(2);
|
|
95
|
+
innerContainerWidth = `calc(var(--ak-editor--line-length) * ${percentageWidth})`;
|
|
84
96
|
}
|
|
85
97
|
} else if (nextNode.type.name === 'table' && nextNode.firstChild) {
|
|
86
98
|
const tableWidthAnchor = getNodeAnchor(nextNode.firstChild);
|
|
@@ -5,7 +5,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
5
5
|
*/
|
|
6
6
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
7
|
import { css, Global, jsx } from '@emotion/react';
|
|
8
|
-
import { akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport } from '@atlaskit/editor-shared-styles';
|
|
8
|
+
import { akEditorBreakoutPadding, akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport } from '@atlaskit/editor-shared-styles';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
10
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
11
11
|
import { DRAG_HANDLE_MAX_WIDTH_PLUS_GAP, DRAG_HANDLE_WIDTH } from './consts';
|
|
@@ -195,8 +195,23 @@ var withAnchorNameZindexNestedStyle = css({
|
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
});
|
|
198
|
+
|
|
199
|
+
// This style is used to define width for block card (with datasource) that does not have layout
|
|
200
|
+
// In full-width editor, block card has width of full-width layout
|
|
201
|
+
// In fixed-width editor, block card has width of wide layout
|
|
202
|
+
var blockCardWithoutLayout = css({
|
|
203
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
204
|
+
'.ak-editor-content-area.fabric-editor--full-width-mode .ProseMirror .ProseMirror-widget[data-blocks-drop-target-container="true"]': {
|
|
205
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
206
|
+
'--ak-editor-block-card-width': "min(calc(100cqw - ".concat(akEditorBreakoutPadding, "px), 1800px)")
|
|
207
|
+
},
|
|
208
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
209
|
+
'.ak-editor-content-area .ProseMirror .ProseMirror-widget[data-blocks-drop-target-container="true"]': {
|
|
210
|
+
'--ak-editor-block-card-width': 'max(var(--ak-editor--legacy-breakout-wide-layout-width), var(--ak-editor--line-length))'
|
|
211
|
+
}
|
|
212
|
+
});
|
|
198
213
|
export var GlobalStylesWrapper = function GlobalStylesWrapper() {
|
|
199
214
|
return jsx(Global, {
|
|
200
|
-
styles: [globalStyles(), editorExperiment('nested-dnd', true) ? extendedHoverZoneNested() : extendedHoverZone(), getTextNodeStyle(), withDeleteLinesStyleFix, withMediaSingleStyleFix, legacyBreakoutWideLayoutStyle, fg('platform_editor_element_dnd_nested_fix_patch_1') ? withDividerInPanelStyleFix : undefined, fg('platform_editor_element_dnd_nested_fix_patch_2') ? withFormatInLayoutStyleFix : undefined, fg('platform_editor_element_dnd_nested_fix_patch_3') ? [withRelativePosStyle, topLevelNodeMarginStyles, editorExperiment('nested-dnd', true) ? withAnchorNameZindexNestedStyle : withAnchorNameZindexStyle] : undefined]
|
|
215
|
+
styles: [globalStyles(), editorExperiment('nested-dnd', true) ? extendedHoverZoneNested() : extendedHoverZone(), getTextNodeStyle(), withDeleteLinesStyleFix, withMediaSingleStyleFix, legacyBreakoutWideLayoutStyle, editorExperiment('advanced_layouts', true) ? blockCardWithoutLayout : undefined, fg('platform_editor_element_dnd_nested_fix_patch_1') ? withDividerInPanelStyleFix : undefined, fg('platform_editor_element_dnd_nested_fix_patch_2') ? withFormatInLayoutStyleFix : undefined, fg('platform_editor_element_dnd_nested_fix_patch_3') ? [withRelativePosStyle, topLevelNodeMarginStyles, editorExperiment('nested-dnd', true) ? withAnchorNameZindexNestedStyle : withAnchorNameZindexStyle] : undefined]
|
|
201
216
|
});
|
|
202
217
|
};
|
|
@@ -9,6 +9,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
|
9
9
|
|
|
10
10
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
11
11
|
import { css, jsx } from '@emotion/react';
|
|
12
|
+
import { akEditorBreakoutPadding } from '@atlaskit/editor-shared-styles';
|
|
12
13
|
import { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';
|
|
13
14
|
import { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
14
15
|
import { B200 } from '@atlaskit/theme/colors';
|
|
@@ -43,9 +44,11 @@ var defaultNodeDimension = {
|
|
|
43
44
|
bottom: 'unset'
|
|
44
45
|
};
|
|
45
46
|
var getWidthOffset = function getWidthOffset(node, width, position) {
|
|
46
|
-
if (
|
|
47
|
+
if (['mediaSingle', 'table', 'embedCard'].includes(node.type.name) ||
|
|
48
|
+
// block card (without datasource) is positioned left-aligned, hence share the same logic as align-start
|
|
49
|
+
node.type.name === 'blockCard' && !node.attrs.datasource) {
|
|
47
50
|
var isLeftPosition = position === 'left';
|
|
48
|
-
if (node.attrs.layout === 'align-start') {
|
|
51
|
+
if (node.attrs.layout === 'align-start' || node.type.name === 'blockCard') {
|
|
49
52
|
return isLeftPosition ? "-0.5*(var(--ak-editor--line-length) - ".concat(width, ")") : "0.5*(var(--ak-editor--line-length) - ".concat(width, ")");
|
|
50
53
|
} else if ((node === null || node === void 0 ? void 0 : node.attrs.layout) === 'align-end') {
|
|
51
54
|
return isLeftPosition ? "0.5*(var(--ak-editor--line-length) - ".concat(width, ")") : "-0.5*(var(--ak-editor--line-length) - ".concat(width, ")");
|
|
@@ -81,11 +84,20 @@ export var InlineDropTarget = function InlineDropTarget(_ref) {
|
|
|
81
84
|
}
|
|
82
85
|
var innerContainerWidth = null;
|
|
83
86
|
var targetAnchorName = anchorName;
|
|
84
|
-
if (['blockCard', 'embedCard'].includes(nextNode.type.name)) {
|
|
87
|
+
if (['blockCard', 'embedCard', 'extension'].includes(nextNode.type.name)) {
|
|
85
88
|
if (nextNode.attrs.layout === 'wide') {
|
|
86
89
|
innerContainerWidth = "max(var(--ak-editor--legacy-breakout-wide-layout-width), var(--ak-editor--line-length))";
|
|
87
90
|
} else if (nextNode.attrs.layout === 'full-width') {
|
|
88
|
-
innerContainerWidth =
|
|
91
|
+
innerContainerWidth = "min(calc(100cqw - ".concat(akEditorBreakoutPadding, "px), 1800px)");
|
|
92
|
+
}
|
|
93
|
+
if (nextNode.type.name === 'blockCard' && !nextNode.attrs.layout && nextNode.attrs.datasource) {
|
|
94
|
+
// block card with sourceNode and without layout has different width in full-width vs fixed-width editor
|
|
95
|
+
// Hence we need to set it based on editor mode
|
|
96
|
+
innerContainerWidth = 'var(--ak-editor-block-card-width)';
|
|
97
|
+
}
|
|
98
|
+
if (nextNode.type.name === 'embedCard' && ['center', 'align-start', 'align-end'].includes(nextNode.attrs.layout)) {
|
|
99
|
+
var percentageWidth = ((parseFloat(nextNode.attrs.width) || 100) / 100).toFixed(2);
|
|
100
|
+
innerContainerWidth = "calc(var(--ak-editor--line-length) * ".concat(percentageWidth, ")");
|
|
89
101
|
}
|
|
90
102
|
} else if (nextNode.type.name === 'table' && nextNode.firstChild) {
|
|
91
103
|
var tableWidthAnchor = getNodeAnchor(nextNode.firstChild);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.28",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@atlaskit/adf-schema": "^46.1.0",
|
|
34
|
-
"@atlaskit/editor-common": "^95.
|
|
34
|
+
"@atlaskit/editor-common": "^95.9.0",
|
|
35
35
|
"@atlaskit/editor-plugin-accessibility-utils": "^1.2.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.10.0",
|
|
37
37
|
"@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
|
|
@@ -41,15 +41,15 @@
|
|
|
41
41
|
"@atlaskit/editor-prosemirror": "6.0.0",
|
|
42
42
|
"@atlaskit/editor-shared-styles": "^3.2.0",
|
|
43
43
|
"@atlaskit/editor-tables": "^2.8.0",
|
|
44
|
-
"@atlaskit/icon": "^22.
|
|
44
|
+
"@atlaskit/icon": "^22.27.0",
|
|
45
45
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
46
46
|
"@atlaskit/pragmatic-drag-and-drop": "^1.4.0",
|
|
47
47
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^1.4.0",
|
|
48
48
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^1.1.0",
|
|
49
|
-
"@atlaskit/primitives": "^13.
|
|
49
|
+
"@atlaskit/primitives": "^13.3.0",
|
|
50
50
|
"@atlaskit/theme": "^14.0.0",
|
|
51
51
|
"@atlaskit/tmp-editor-statsig": "^2.21.0",
|
|
52
|
-
"@atlaskit/tokens": "^2.
|
|
52
|
+
"@atlaskit/tokens": "^2.4.0",
|
|
53
53
|
"@atlaskit/tooltip": "^18.9.0",
|
|
54
54
|
"@babel/runtime": "^7.0.0",
|
|
55
55
|
"@emotion/react": "^11.7.1",
|