@atlaskit/editor-plugin-block-controls 18.2.4 → 18.2.6
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
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 18.2.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`80f8db8984c15`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/80f8db8984c15) -
|
|
8
|
+
Fix collapsible headings causing invalid css anchors
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 18.2.5
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 18.2.4
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -90,6 +90,19 @@ var toMeasuredSurfaceWrapperPlacement = exports.toMeasuredSurfaceWrapperPlacemen
|
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Where a surface goes when its anchor stops resolving, as the fallback argument to the block-axis
|
|
96
|
+
* `anchor()` calls below.
|
|
97
|
+
*
|
|
98
|
+
* An anchor is invalid once its element stops generating a box e.g. (`display: none`) / removed node
|
|
99
|
+
* Currently, anchor fallback is not unstable with some of the position-visibility options, so here
|
|
100
|
+
* we manually set a fallback of -9999 so that it will render offscreen out of the viewport
|
|
101
|
+
* without causing extra overflows
|
|
102
|
+
*/
|
|
103
|
+
var INVALID_ANCHOR_OFFSCREEN_PX = 9999;
|
|
104
|
+
var INVALID_ANCHOR_FALLBACK_TOP = "-".concat(INVALID_ANCHOR_OFFSCREEN_PX, "px");
|
|
105
|
+
var INVALID_ANCHOR_FALLBACK_BOTTOM = "".concat(INVALID_ANCHOR_OFFSCREEN_PX, "px");
|
|
93
106
|
var getAnchoredSurfacePlacement = exports.getAnchoredSurfacePlacement = function getAnchoredSurfacePlacement(_ref3) {
|
|
94
107
|
var anchorName = _ref3.anchorName,
|
|
95
108
|
nodeType = _ref3.nodeType,
|
|
@@ -104,7 +117,7 @@ var getAnchoredSurfacePlacement = exports.getAnchoredSurfacePlacement = function
|
|
|
104
117
|
style: {
|
|
105
118
|
left: "calc((anchor(".concat(anchorName, " left) + anchor(").concat(anchorName, " right)) / 2)"),
|
|
106
119
|
positionAnchor: anchorName,
|
|
107
|
-
top: "anchor(".concat(anchorName, " top)"),
|
|
120
|
+
top: "anchor(".concat(anchorName, " top, ").concat(INVALID_ANCHOR_FALLBACK_TOP, ")"),
|
|
108
121
|
transform: 'translate(-50%, -50%)'
|
|
109
122
|
}
|
|
110
123
|
};
|
|
@@ -114,11 +127,11 @@ var getAnchoredSurfacePlacement = exports.getAnchoredSurfacePlacement = function
|
|
|
114
127
|
return {
|
|
115
128
|
isSticky: isSticky,
|
|
116
129
|
style: _objectSpread(_objectSpread({}, isSticky ? {
|
|
117
|
-
bottom: "anchor(".concat(anchorName, " bottom)")
|
|
130
|
+
bottom: "anchor(".concat(anchorName, " bottom, ").concat(INVALID_ANCHOR_FALLBACK_BOTTOM, ")")
|
|
118
131
|
} : {}), {}, {
|
|
119
132
|
left: side === 'right' ? "calc(anchor(".concat(anchorName, " right) + ").concat(gap, "px)") : "anchor(".concat(anchorName, " left)"),
|
|
120
133
|
positionAnchor: anchorName,
|
|
121
|
-
top: "calc(anchor(".concat(anchorName, " top) + ").concat((0, _consts.topPositionAdjustment)(nodeTypeWithLevel), "px)"),
|
|
134
|
+
top: "calc(anchor(".concat(anchorName, " top, ").concat(INVALID_ANCHOR_FALLBACK_TOP, ") + ").concat((0, _consts.topPositionAdjustment)(nodeTypeWithLevel), "px)"),
|
|
122
135
|
// The left side grows away from the node without knowing its own width, so it pulls itself
|
|
123
136
|
// back past its own box and the gap. The right side grows into the margin, so the gap is
|
|
124
137
|
// already folded into `left` above.
|
|
@@ -81,6 +81,19 @@ export const toMeasuredSurfaceWrapperPlacement = placement => ({
|
|
|
81
81
|
transform: placement.transform
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Where a surface goes when its anchor stops resolving, as the fallback argument to the block-axis
|
|
87
|
+
* `anchor()` calls below.
|
|
88
|
+
*
|
|
89
|
+
* An anchor is invalid once its element stops generating a box e.g. (`display: none`) / removed node
|
|
90
|
+
* Currently, anchor fallback is not unstable with some of the position-visibility options, so here
|
|
91
|
+
* we manually set a fallback of -9999 so that it will render offscreen out of the viewport
|
|
92
|
+
* without causing extra overflows
|
|
93
|
+
*/
|
|
94
|
+
const INVALID_ANCHOR_OFFSCREEN_PX = 9999;
|
|
95
|
+
const INVALID_ANCHOR_FALLBACK_TOP = `-${INVALID_ANCHOR_OFFSCREEN_PX}px`;
|
|
96
|
+
const INVALID_ANCHOR_FALLBACK_BOTTOM = `${INVALID_ANCHOR_OFFSCREEN_PX}px`;
|
|
84
97
|
export const getAnchoredSurfacePlacement = ({
|
|
85
98
|
anchorName,
|
|
86
99
|
nodeType,
|
|
@@ -96,7 +109,7 @@ export const getAnchoredSurfacePlacement = ({
|
|
|
96
109
|
style: {
|
|
97
110
|
left: `calc((anchor(${anchorName} left) + anchor(${anchorName} right)) / 2)`,
|
|
98
111
|
positionAnchor: anchorName,
|
|
99
|
-
top: `anchor(${anchorName} top)`,
|
|
112
|
+
top: `anchor(${anchorName} top, ${INVALID_ANCHOR_FALLBACK_TOP})`,
|
|
100
113
|
transform: 'translate(-50%, -50%)'
|
|
101
114
|
}
|
|
102
115
|
};
|
|
@@ -110,11 +123,11 @@ export const getAnchoredSurfacePlacement = ({
|
|
|
110
123
|
// with the adjusted `top` keeps the box ending exactly where the node does, however far
|
|
111
124
|
// the top adjustment pushed the start down and however much the node later grows.
|
|
112
125
|
...(isSticky ? {
|
|
113
|
-
bottom: `anchor(${anchorName} bottom)`
|
|
126
|
+
bottom: `anchor(${anchorName} bottom, ${INVALID_ANCHOR_FALLBACK_BOTTOM})`
|
|
114
127
|
} : {}),
|
|
115
128
|
left: side === 'right' ? `calc(anchor(${anchorName} right) + ${gap}px)` : `anchor(${anchorName} left)`,
|
|
116
129
|
positionAnchor: anchorName,
|
|
117
|
-
top: `calc(anchor(${anchorName} top) + ${topPositionAdjustment(nodeTypeWithLevel)}px)`,
|
|
130
|
+
top: `calc(anchor(${anchorName} top, ${INVALID_ANCHOR_FALLBACK_TOP}) + ${topPositionAdjustment(nodeTypeWithLevel)}px)`,
|
|
118
131
|
// The left side grows away from the node without knowing its own width, so it pulls itself
|
|
119
132
|
// back past its own box and the gap. The right side grows into the margin, so the gap is
|
|
120
133
|
// already folded into `left` above.
|
|
@@ -83,6 +83,19 @@ export var toMeasuredSurfaceWrapperPlacement = function toMeasuredSurfaceWrapper
|
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
85
|
};
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Where a surface goes when its anchor stops resolving, as the fallback argument to the block-axis
|
|
89
|
+
* `anchor()` calls below.
|
|
90
|
+
*
|
|
91
|
+
* An anchor is invalid once its element stops generating a box e.g. (`display: none`) / removed node
|
|
92
|
+
* Currently, anchor fallback is not unstable with some of the position-visibility options, so here
|
|
93
|
+
* we manually set a fallback of -9999 so that it will render offscreen out of the viewport
|
|
94
|
+
* without causing extra overflows
|
|
95
|
+
*/
|
|
96
|
+
var INVALID_ANCHOR_OFFSCREEN_PX = 9999;
|
|
97
|
+
var INVALID_ANCHOR_FALLBACK_TOP = "-".concat(INVALID_ANCHOR_OFFSCREEN_PX, "px");
|
|
98
|
+
var INVALID_ANCHOR_FALLBACK_BOTTOM = "".concat(INVALID_ANCHOR_OFFSCREEN_PX, "px");
|
|
86
99
|
export var getAnchoredSurfacePlacement = function getAnchoredSurfacePlacement(_ref3) {
|
|
87
100
|
var anchorName = _ref3.anchorName,
|
|
88
101
|
nodeType = _ref3.nodeType,
|
|
@@ -97,7 +110,7 @@ export var getAnchoredSurfacePlacement = function getAnchoredSurfacePlacement(_r
|
|
|
97
110
|
style: {
|
|
98
111
|
left: "calc((anchor(".concat(anchorName, " left) + anchor(").concat(anchorName, " right)) / 2)"),
|
|
99
112
|
positionAnchor: anchorName,
|
|
100
|
-
top: "anchor(".concat(anchorName, " top)"),
|
|
113
|
+
top: "anchor(".concat(anchorName, " top, ").concat(INVALID_ANCHOR_FALLBACK_TOP, ")"),
|
|
101
114
|
transform: 'translate(-50%, -50%)'
|
|
102
115
|
}
|
|
103
116
|
};
|
|
@@ -107,11 +120,11 @@ export var getAnchoredSurfacePlacement = function getAnchoredSurfacePlacement(_r
|
|
|
107
120
|
return {
|
|
108
121
|
isSticky: isSticky,
|
|
109
122
|
style: _objectSpread(_objectSpread({}, isSticky ? {
|
|
110
|
-
bottom: "anchor(".concat(anchorName, " bottom)")
|
|
123
|
+
bottom: "anchor(".concat(anchorName, " bottom, ").concat(INVALID_ANCHOR_FALLBACK_BOTTOM, ")")
|
|
111
124
|
} : {}), {}, {
|
|
112
125
|
left: side === 'right' ? "calc(anchor(".concat(anchorName, " right) + ").concat(gap, "px)") : "anchor(".concat(anchorName, " left)"),
|
|
113
126
|
positionAnchor: anchorName,
|
|
114
|
-
top: "calc(anchor(".concat(anchorName, " top) + ").concat(topPositionAdjustment(nodeTypeWithLevel), "px)"),
|
|
127
|
+
top: "calc(anchor(".concat(anchorName, " top, ").concat(INVALID_ANCHOR_FALLBACK_TOP, ") + ").concat(topPositionAdjustment(nodeTypeWithLevel), "px)"),
|
|
115
128
|
// The left side grows away from the node without knowing its own width, so it pulls itself
|
|
116
129
|
// back past its own box and the gap. The right side grows into the margin, so the gap is
|
|
117
130
|
// already folded into `left` above.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "18.2.
|
|
3
|
+
"version": "18.2.6",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@atlaskit/editor-plugin-width": "^18.0.0",
|
|
44
44
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
45
45
|
"@atlaskit/editor-shared-styles": "^4.1.0",
|
|
46
|
-
"@atlaskit/editor-tables": "^3.
|
|
46
|
+
"@atlaskit/editor-tables": "^3.2.0",
|
|
47
47
|
"@atlaskit/editor-ui-control-model": "^2.9.0",
|
|
48
48
|
"@atlaskit/icon": "^37.6.0",
|
|
49
49
|
"@atlaskit/icon-lab": "^7.8.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@atlaskit/primitives": "^22.5.0",
|
|
57
57
|
"@atlaskit/section-message": "^10.2.0",
|
|
58
58
|
"@atlaskit/theme": "^28.2.0",
|
|
59
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
59
|
+
"@atlaskit/tmp-editor-statsig": "^184.0.0",
|
|
60
60
|
"@atlaskit/tokens": "^16.11.0",
|
|
61
61
|
"@atlaskit/tooltip": "^24.3.0",
|
|
62
62
|
"@babel/runtime": "^7.0.0",
|
|
@@ -109,6 +109,7 @@
|
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
111
|
"@atlassian/structured-docs-types": "workspace:^",
|
|
112
|
+
"@atlassian/workbench": "workspace:*",
|
|
112
113
|
"react": "^19.2.0",
|
|
113
114
|
"react-dom": "^19.2.0",
|
|
114
115
|
"react-intl": "^7.0.0"
|