@atlaskit/editor-plugin-table 40.0.2 → 40.0.3
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,16 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 40.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`c011dee405917`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c011dee405917) -
|
|
8
|
+
Fix the table cell options button being hidden behind native sticky header rows after scrolling,
|
|
9
|
+
behind the `platform_editor_table_cell_menu_btn_zindex` experiment. The anchored button now uses
|
|
10
|
+
the sticky header button z-index so it stays above the header with
|
|
11
|
+
`platform_editor_sticky_headers_zindex` enabled or disabled.
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
3
14
|
## 40.0.2
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = _default;
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
11
|
var _react2 = require("@emotion/react");
|
|
11
12
|
var _reactIntl = require("react-intl");
|
|
@@ -19,24 +20,23 @@ var _useSharedPluginStateWithSelector = require("@atlaskit/editor-common/useShar
|
|
|
19
20
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
20
21
|
var _constants = require("@atlaskit/editor-shared-styles/constants");
|
|
21
22
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/chevron-down"));
|
|
23
|
+
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
22
24
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
23
25
|
var _commands = require("../../pm-plugins/commands");
|
|
24
26
|
var _pluginFactory = require("../../pm-plugins/plugin-factory");
|
|
25
27
|
var _stickyHeader = require("../../pm-plugins/utils/sticky-header");
|
|
26
28
|
var _types = require("../../types");
|
|
29
|
+
var _stickyHeaderZIndex = require("../sticky-header-z-index");
|
|
27
30
|
var _FixedButton = _interopRequireDefault(require("./FixedButton"));
|
|
28
31
|
var _styles = require("./styles");
|
|
29
32
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
30
|
-
|
|
33
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
34
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /**
|
|
31
35
|
* @jsxRuntime classic
|
|
32
36
|
* @jsx jsx
|
|
33
|
-
*/
|
|
34
|
-
|
|
35
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
36
|
-
|
|
37
|
+
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
37
38
|
// Ignored via go/ees005
|
|
38
39
|
// eslint-disable-next-line import/no-named-as-default
|
|
39
|
-
|
|
40
40
|
var BUTTON_OFFSET = 3;
|
|
41
41
|
var CONTEXTUAL_MENU_BUTTON_Z_INDEX = 2;
|
|
42
42
|
var anchorStyles = (0, _react2.css)({
|
|
@@ -171,13 +171,16 @@ var FloatingContextualButtonInner = /*#__PURE__*/_react.default.memo(function (p
|
|
|
171
171
|
if (rowAnchorName && colAnchorName) {
|
|
172
172
|
return (0, _react2.jsx)("div", {
|
|
173
173
|
css: anchorStyles,
|
|
174
|
-
style: {
|
|
174
|
+
style: _objectSpread({
|
|
175
175
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
176
176
|
top: "calc(".concat(BUTTON_OFFSET, "px + anchor(").concat(rowAnchorName, " top))"),
|
|
177
177
|
right: "calc(".concat(BUTTON_OFFSET, "px + anchor(").concat(colAnchorName, " right))"),
|
|
178
178
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
179
179
|
positionAnchor: colAnchorName
|
|
180
|
-
}
|
|
180
|
+
}, (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_table_cell_menu_btn_zindex') && {
|
|
181
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
182
|
+
zIndex: (0, _stickyHeaderZIndex.getTableZIndexes)().headerButton
|
|
183
|
+
}) // need to do this because CSSProperties doesn't have positionAnchor property even though it's a valid CSS property
|
|
181
184
|
,
|
|
182
185
|
"data-testid": "table-cell-options-anchor-wrapper"
|
|
183
186
|
}, button);
|
|
@@ -16,11 +16,13 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSha
|
|
|
16
16
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
17
17
|
import { akEditorSmallZIndex } from '@atlaskit/editor-shared-styles/constants';
|
|
18
18
|
import ExpandIcon from '@atlaskit/icon/core/chevron-down';
|
|
19
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
19
20
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
20
21
|
import { toggleActiveTableMenu, toggleContextualMenu } from '../../pm-plugins/commands';
|
|
21
22
|
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
22
23
|
import { isNativeStickySupported } from '../../pm-plugins/utils/sticky-header';
|
|
23
24
|
import { TableCssClassName as ClassName } from '../../types';
|
|
25
|
+
import { getTableZIndexes } from '../sticky-header-z-index';
|
|
24
26
|
// Ignored via go/ees005
|
|
25
27
|
// eslint-disable-next-line import/no-named-as-default
|
|
26
28
|
import FixedButton from './FixedButton';
|
|
@@ -177,7 +179,13 @@ const FloatingContextualButtonInner = /*#__PURE__*/React.memo(props => {
|
|
|
177
179
|
top: `calc(${BUTTON_OFFSET}px + anchor(${rowAnchorName} top))`,
|
|
178
180
|
right: `calc(${BUTTON_OFFSET}px + anchor(${colAnchorName} right))`,
|
|
179
181
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
180
|
-
positionAnchor: colAnchorName
|
|
182
|
+
positionAnchor: colAnchorName,
|
|
183
|
+
// The native sticky header row paints above the default z-index, hiding the button.
|
|
184
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- z-index depends on runtime experiments
|
|
185
|
+
...(isExperimentEnabled('platform_editor_table_cell_menu_btn_zindex') && {
|
|
186
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
187
|
+
zIndex: getTableZIndexes().headerButton
|
|
188
|
+
})
|
|
181
189
|
} // need to do this because CSSProperties doesn't have positionAnchor property even though it's a valid CSS property
|
|
182
190
|
,
|
|
183
191
|
"data-testid": "table-cell-options-anchor-wrapper"
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1
4
|
/**
|
|
2
5
|
* @jsxRuntime classic
|
|
3
6
|
* @jsx jsx
|
|
@@ -16,11 +19,13 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSha
|
|
|
16
19
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
17
20
|
import { akEditorSmallZIndex } from '@atlaskit/editor-shared-styles/constants';
|
|
18
21
|
import ExpandIcon from '@atlaskit/icon/core/chevron-down';
|
|
22
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
19
23
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
20
24
|
import { toggleActiveTableMenu, toggleContextualMenu } from '../../pm-plugins/commands';
|
|
21
25
|
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
22
26
|
import { isNativeStickySupported } from '../../pm-plugins/utils/sticky-header';
|
|
23
27
|
import { TableCssClassName as ClassName } from '../../types';
|
|
28
|
+
import { getTableZIndexes } from '../sticky-header-z-index';
|
|
24
29
|
// Ignored via go/ees005
|
|
25
30
|
// eslint-disable-next-line import/no-named-as-default
|
|
26
31
|
import FixedButton from './FixedButton';
|
|
@@ -159,13 +164,16 @@ var FloatingContextualButtonInner = /*#__PURE__*/React.memo(function (props) {
|
|
|
159
164
|
if (rowAnchorName && colAnchorName) {
|
|
160
165
|
return jsx("div", {
|
|
161
166
|
css: anchorStyles,
|
|
162
|
-
style: {
|
|
167
|
+
style: _objectSpread({
|
|
163
168
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
164
169
|
top: "calc(".concat(BUTTON_OFFSET, "px + anchor(").concat(rowAnchorName, " top))"),
|
|
165
170
|
right: "calc(".concat(BUTTON_OFFSET, "px + anchor(").concat(colAnchorName, " right))"),
|
|
166
171
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
167
172
|
positionAnchor: colAnchorName
|
|
168
|
-
}
|
|
173
|
+
}, isExperimentEnabled('platform_editor_table_cell_menu_btn_zindex') && {
|
|
174
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
175
|
+
zIndex: getTableZIndexes().headerButton
|
|
176
|
+
}) // need to do this because CSSProperties doesn't have positionAnchor property even though it's a valid CSS property
|
|
169
177
|
,
|
|
170
178
|
"data-testid": "table-cell-options-anchor-wrapper"
|
|
171
179
|
}, button);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "40.0.
|
|
3
|
+
"version": "40.0.3",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@atlaskit/editor-plugin-batch-attribute-updates": "^28.0.0",
|
|
30
30
|
"@atlaskit/editor-plugin-content-insertion": "^28.0.0",
|
|
31
31
|
"@atlaskit/editor-plugin-editor-viewmode": "^30.0.0",
|
|
32
|
-
"@atlaskit/editor-plugin-extension": "31.0.
|
|
32
|
+
"@atlaskit/editor-plugin-extension": "31.0.2",
|
|
33
33
|
"@atlaskit/editor-plugin-guideline": "^28.0.0",
|
|
34
34
|
"@atlaskit/editor-plugin-interaction": "^42.0.0",
|
|
35
35
|
"@atlaskit/editor-plugin-limited-mode": "^25.0.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.2.0",
|
|
54
54
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^3.0.0",
|
|
55
55
|
"@atlaskit/primitives": "^22.6.0",
|
|
56
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
56
|
+
"@atlaskit/tmp-editor-statsig": "^242.0.0",
|
|
57
57
|
"@atlaskit/toggle": "^17.3.0",
|
|
58
58
|
"@atlaskit/tokens": "^20.6.0",
|
|
59
59
|
"@atlaskit/tooltip": "^24.4.0",
|