@atlaskit/editor-common 131.2.2 → 131.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 +14 -0
- package/dist/cjs/extensibility/Extension/Extension/index.js +15 -1
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/OverflowShadow/index.js +14 -2
- package/dist/es2019/extensibility/Extension/Extension/index.js +13 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/OverflowShadow/index.js +12 -2
- package/dist/esm/extensibility/Extension/Extension/index.js +15 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/OverflowShadow/index.js +14 -2
- package/dist/types/ui/OverflowShadow/index.d.ts +5 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 131.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`50bd552f7a17f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/50bd552f7a17f) -
|
|
8
|
+
[ux] Use CSS scroll-driven overflow shadows for extensions when the
|
|
9
|
+
`platform_editor_reduce_forced_layout_2` experiment is enabled, reducing forced layout while
|
|
10
|
+
preserving the JavaScript fallback in unsupported browsers. Add an optional `isDisabled` setting
|
|
11
|
+
to `overflowShadow` so consumers can disable its JavaScript behavior.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 131.2.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -13,6 +13,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _react2 = require("@emotion/react");
|
|
15
15
|
var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
16
|
+
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
16
17
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
17
18
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
18
19
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
@@ -43,6 +44,15 @@ var hoverStyles = (0, _react2.css)({
|
|
|
43
44
|
var containerStyle = (0, _react2.css)({
|
|
44
45
|
containerType: 'inline-size'
|
|
45
46
|
});
|
|
47
|
+
|
|
48
|
+
// Keep these checks in sync with the extensionScrollInlineShadowStyles @supports condition in
|
|
49
|
+
// editor-core/src/ui/EditorContentContainer/EditorContentContainer-compiled.tsx.
|
|
50
|
+
var isCssScrollTimelineSupported = (0, _memoizeOne.default)(function (browserCSS) {
|
|
51
|
+
if (!browserCSS || typeof browserCSS.supports !== 'function') {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
return browserCSS.supports('animation-timeline', '--test-timeline') && browserCSS.supports('scroll-timeline-name', '--test-timeline') && browserCSS.supports('timeline-scope', '--test-timeline') && browserCSS.supports('animation-range', '0% 101%');
|
|
55
|
+
});
|
|
46
56
|
function ExtensionWithPluginState(props) {
|
|
47
57
|
var _node$attrs;
|
|
48
58
|
var node = props.node,
|
|
@@ -113,6 +123,7 @@ function ExtensionWithPluginState(props) {
|
|
|
113
123
|
'without-frame': removeBorder
|
|
114
124
|
}, _styles2.widerLayoutClassName, shouldBreakout));
|
|
115
125
|
var overflowClassNames = (0, _classnames2.default)('extension-overflow-wrapper', {
|
|
126
|
+
'extension-scroll-inline-shadow': (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_reduce_forced_layout_2') && !hasBody && node.attrs.extensionType !== 'com.atlassian.ai-blocks',
|
|
116
127
|
'with-body': hasBody,
|
|
117
128
|
'with-margin-styles': showMacroInteractionDesignUpdates && !isNodeNested && !showBodiedExtensionRendererView,
|
|
118
129
|
// Adding extra padding for renderer view so users can have a touch target to click on the extension
|
|
@@ -269,6 +280,9 @@ var Extension = function Extension(props) {
|
|
|
269
280
|
}, props));
|
|
270
281
|
};
|
|
271
282
|
var _default_1 = (0, _ui.overflowShadow)(Extension, {
|
|
272
|
-
overflowSelector: '.extension-overflow-wrapper'
|
|
283
|
+
overflowSelector: '.extension-overflow-wrapper',
|
|
284
|
+
isDisabled: function isDisabled() {
|
|
285
|
+
return (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_reduce_forced_layout_2') && isCssScrollTimelineSupported(globalThis.CSS);
|
|
286
|
+
}
|
|
273
287
|
});
|
|
274
288
|
var _default = exports.default = _default_1;
|
|
@@ -27,7 +27,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
27
27
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
28
28
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
29
29
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
30
|
-
var packageVersion = "131.2.
|
|
30
|
+
var packageVersion = "131.2.2";
|
|
31
31
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
32
32
|
// Remove URL as it has UGC
|
|
33
33
|
// Ignored via go/ees007
|
|
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
24
24
|
* @jsx jsx
|
|
25
25
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "131.2.
|
|
27
|
+
var packageVersion = "131.2.2";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -44,7 +44,7 @@ function overflowShadow(Component, options) {
|
|
|
44
44
|
_this.updateShadows();
|
|
45
45
|
});
|
|
46
46
|
(0, _defineProperty2.default)(_this, "updateShadows", function () {
|
|
47
|
-
if (options.useShadowObserver) {
|
|
47
|
+
if (_this.isDisabled || options.useShadowObserver) {
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
50
|
_this.setState(function (prevState) {
|
|
@@ -98,6 +98,9 @@ function overflowShadow(Component, options) {
|
|
|
98
98
|
if (!_this.overflowContainer) {
|
|
99
99
|
_this.overflowContainer = container;
|
|
100
100
|
}
|
|
101
|
+
if (_this.isDisabled) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
101
104
|
if (options.useShadowObserver) {
|
|
102
105
|
_this.initShadowObserver();
|
|
103
106
|
return;
|
|
@@ -111,6 +114,15 @@ function overflowShadow(Component, options) {
|
|
|
111
114
|
}
|
|
112
115
|
(0, _inherits2.default)(OverflowShadow, _React$Component);
|
|
113
116
|
return (0, _createClass2.default)(OverflowShadow, [{
|
|
117
|
+
key: "isDisabled",
|
|
118
|
+
get: function get() {
|
|
119
|
+
if (this.disabled === undefined) {
|
|
120
|
+
var _options$isDisabled, _options$isDisabled2;
|
|
121
|
+
this.disabled = (_options$isDisabled = (_options$isDisabled2 = options.isDisabled) === null || _options$isDisabled2 === void 0 ? void 0 : _options$isDisabled2.call(options)) !== null && _options$isDisabled !== void 0 ? _options$isDisabled : false;
|
|
122
|
+
}
|
|
123
|
+
return this.disabled;
|
|
124
|
+
}
|
|
125
|
+
}, {
|
|
114
126
|
key: "componentWillUnmount",
|
|
115
127
|
value: function componentWillUnmount() {
|
|
116
128
|
if (options.useShadowObserver) {
|
|
@@ -161,7 +173,7 @@ function overflowShadow(Component, options) {
|
|
|
161
173
|
var _this$state = this.state,
|
|
162
174
|
showLeftShadow = _this$state.showLeftShadow,
|
|
163
175
|
showRightShadow = _this$state.showRightShadow;
|
|
164
|
-
var classNames = [!((_this$props = this.props) !== null && _this$props !== void 0 && _this$props.disableTableOverflowShadow) && showRightShadow && shadowClassNames.RIGHT_SHADOW, !((_this$props2 = this.props) !== null && _this$props2 !== void 0 && _this$props2.disableTableOverflowShadow) && showLeftShadow && shadowClassNames.LEFT_SHADOW, options.useShadowObserver && _shadowObserverClassNames.shadowObserverClassNames.SHADOW_CONTAINER].filter(Boolean).join(' ');
|
|
176
|
+
var classNames = this.isDisabled ? '' : [!((_this$props = this.props) !== null && _this$props !== void 0 && _this$props.disableTableOverflowShadow) && showRightShadow && shadowClassNames.RIGHT_SHADOW, !((_this$props2 = this.props) !== null && _this$props2 !== void 0 && _this$props2.disableTableOverflowShadow) && showLeftShadow && shadowClassNames.LEFT_SHADOW, options.useShadowObserver && _shadowObserverClassNames.shadowObserverClassNames.SHADOW_CONTAINER].filter(Boolean).join(' ');
|
|
165
177
|
|
|
166
178
|
/**
|
|
167
179
|
* The widths have already been calculated to determine
|
|
@@ -9,6 +9,7 @@ import React, { Fragment, useCallback, useState } from 'react';
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
10
|
import { css, jsx } from '@emotion/react';
|
|
11
11
|
import classnames from 'classnames';
|
|
12
|
+
import memoizeOne from 'memoize-one';
|
|
12
13
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
13
14
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
14
15
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
@@ -30,6 +31,15 @@ const hoverStyles = css({
|
|
|
30
31
|
const containerStyle = css({
|
|
31
32
|
containerType: 'inline-size'
|
|
32
33
|
});
|
|
34
|
+
|
|
35
|
+
// Keep these checks in sync with the extensionScrollInlineShadowStyles @supports condition in
|
|
36
|
+
// editor-core/src/ui/EditorContentContainer/EditorContentContainer-compiled.tsx.
|
|
37
|
+
const isCssScrollTimelineSupported = memoizeOne(browserCSS => {
|
|
38
|
+
if (!browserCSS || typeof browserCSS.supports !== 'function') {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
return browserCSS.supports('animation-timeline', '--test-timeline') && browserCSS.supports('scroll-timeline-name', '--test-timeline') && browserCSS.supports('timeline-scope', '--test-timeline') && browserCSS.supports('animation-range', '0% 101%');
|
|
42
|
+
});
|
|
33
43
|
function ExtensionWithPluginState(props) {
|
|
34
44
|
var _node$attrs, _node$attrs$parameter, _node$attrs$parameter2, _node$attrs$parameter3;
|
|
35
45
|
const {
|
|
@@ -103,6 +113,7 @@ function ExtensionWithPluginState(props) {
|
|
|
103
113
|
[widerLayoutClassName]: shouldBreakout
|
|
104
114
|
});
|
|
105
115
|
const overflowClassNames = classnames('extension-overflow-wrapper', {
|
|
116
|
+
'extension-scroll-inline-shadow': isExperimentEnabled('platform_editor_reduce_forced_layout_2') && !hasBody && node.attrs.extensionType !== 'com.atlassian.ai-blocks',
|
|
106
117
|
'with-body': hasBody,
|
|
107
118
|
'with-margin-styles': showMacroInteractionDesignUpdates && !isNodeNested && !showBodiedExtensionRendererView,
|
|
108
119
|
// Adding extra padding for renderer view so users can have a touch target to click on the extension
|
|
@@ -262,6 +273,7 @@ const Extension = props => {
|
|
|
262
273
|
}, props));
|
|
263
274
|
};
|
|
264
275
|
const _default_1 = overflowShadow(Extension, {
|
|
265
|
-
overflowSelector: '.extension-overflow-wrapper'
|
|
276
|
+
overflowSelector: '.extension-overflow-wrapper',
|
|
277
|
+
isDisabled: () => isExperimentEnabled('platform_editor_reduce_forced_layout_2') && isCssScrollTimelineSupported(globalThis.CSS)
|
|
266
278
|
});
|
|
267
279
|
export default _default_1;
|
|
@@ -13,7 +13,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
13
13
|
const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
14
14
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
15
15
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
16
|
-
const packageVersion = "131.2.
|
|
16
|
+
const packageVersion = "131.2.2";
|
|
17
17
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
18
18
|
// Remove URL as it has UGC
|
|
19
19
|
// Ignored via go/ees007
|
|
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
15
15
|
import Layer from '../Layer';
|
|
16
16
|
const packageName = "@atlaskit/editor-common";
|
|
17
|
-
const packageVersion = "131.2.
|
|
17
|
+
const packageVersion = "131.2.2";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -24,7 +24,7 @@ export default function overflowShadow(Component, options) {
|
|
|
24
24
|
this.updateShadows();
|
|
25
25
|
});
|
|
26
26
|
_defineProperty(this, "updateShadows", () => {
|
|
27
|
-
if (options.useShadowObserver) {
|
|
27
|
+
if (this.isDisabled || options.useShadowObserver) {
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
this.setState(prevState => {
|
|
@@ -78,6 +78,9 @@ export default function overflowShadow(Component, options) {
|
|
|
78
78
|
if (!this.overflowContainer) {
|
|
79
79
|
this.overflowContainer = container;
|
|
80
80
|
}
|
|
81
|
+
if (this.isDisabled) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
81
84
|
if (options.useShadowObserver) {
|
|
82
85
|
this.initShadowObserver();
|
|
83
86
|
return;
|
|
@@ -88,6 +91,13 @@ export default function overflowShadow(Component, options) {
|
|
|
88
91
|
this.overflowContainer.addEventListener('scroll', this.handleScroll);
|
|
89
92
|
});
|
|
90
93
|
}
|
|
94
|
+
get isDisabled() {
|
|
95
|
+
if (this.disabled === undefined) {
|
|
96
|
+
var _options$isDisabled, _options$isDisabled2;
|
|
97
|
+
this.disabled = (_options$isDisabled = (_options$isDisabled2 = options.isDisabled) === null || _options$isDisabled2 === void 0 ? void 0 : _options$isDisabled2.call(options)) !== null && _options$isDisabled !== void 0 ? _options$isDisabled : false;
|
|
98
|
+
}
|
|
99
|
+
return this.disabled;
|
|
100
|
+
}
|
|
91
101
|
componentWillUnmount() {
|
|
92
102
|
if (options.useShadowObserver) {
|
|
93
103
|
return this.shadowObserver && this.shadowObserver.dispose();
|
|
@@ -133,7 +143,7 @@ export default function overflowShadow(Component, options) {
|
|
|
133
143
|
showLeftShadow,
|
|
134
144
|
showRightShadow
|
|
135
145
|
} = this.state;
|
|
136
|
-
const classNames = [!((_this$props = this.props) !== null && _this$props !== void 0 && _this$props.disableTableOverflowShadow) && showRightShadow && shadowClassNames.RIGHT_SHADOW, !((_this$props2 = this.props) !== null && _this$props2 !== void 0 && _this$props2.disableTableOverflowShadow) && showLeftShadow && shadowClassNames.LEFT_SHADOW, options.useShadowObserver && shadowObserverClassNames.SHADOW_CONTAINER].filter(Boolean).join(' ');
|
|
146
|
+
const classNames = this.isDisabled ? '' : [!((_this$props = this.props) !== null && _this$props !== void 0 && _this$props.disableTableOverflowShadow) && showRightShadow && shadowClassNames.RIGHT_SHADOW, !((_this$props2 = this.props) !== null && _this$props2 !== void 0 && _this$props2.disableTableOverflowShadow) && showLeftShadow && shadowClassNames.LEFT_SHADOW, options.useShadowObserver && shadowObserverClassNames.SHADOW_CONTAINER].filter(Boolean).join(' ');
|
|
137
147
|
|
|
138
148
|
/**
|
|
139
149
|
* The widths have already been calculated to determine
|
|
@@ -15,6 +15,7 @@ import React, { Fragment, useCallback, useState } from 'react';
|
|
|
15
15
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
16
16
|
import { css, jsx } from '@emotion/react';
|
|
17
17
|
import classnames from 'classnames';
|
|
18
|
+
import memoizeOne from 'memoize-one';
|
|
18
19
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
19
20
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
20
21
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
@@ -36,6 +37,15 @@ var hoverStyles = css({
|
|
|
36
37
|
var containerStyle = css({
|
|
37
38
|
containerType: 'inline-size'
|
|
38
39
|
});
|
|
40
|
+
|
|
41
|
+
// Keep these checks in sync with the extensionScrollInlineShadowStyles @supports condition in
|
|
42
|
+
// editor-core/src/ui/EditorContentContainer/EditorContentContainer-compiled.tsx.
|
|
43
|
+
var isCssScrollTimelineSupported = memoizeOne(function (browserCSS) {
|
|
44
|
+
if (!browserCSS || typeof browserCSS.supports !== 'function') {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
return browserCSS.supports('animation-timeline', '--test-timeline') && browserCSS.supports('scroll-timeline-name', '--test-timeline') && browserCSS.supports('timeline-scope', '--test-timeline') && browserCSS.supports('animation-range', '0% 101%');
|
|
48
|
+
});
|
|
39
49
|
function ExtensionWithPluginState(props) {
|
|
40
50
|
var _node$attrs;
|
|
41
51
|
var node = props.node,
|
|
@@ -106,6 +116,7 @@ function ExtensionWithPluginState(props) {
|
|
|
106
116
|
'without-frame': removeBorder
|
|
107
117
|
}, widerLayoutClassName, shouldBreakout));
|
|
108
118
|
var overflowClassNames = classnames('extension-overflow-wrapper', {
|
|
119
|
+
'extension-scroll-inline-shadow': isExperimentEnabled('platform_editor_reduce_forced_layout_2') && !hasBody && node.attrs.extensionType !== 'com.atlassian.ai-blocks',
|
|
109
120
|
'with-body': hasBody,
|
|
110
121
|
'with-margin-styles': showMacroInteractionDesignUpdates && !isNodeNested && !showBodiedExtensionRendererView,
|
|
111
122
|
// Adding extra padding for renderer view so users can have a touch target to click on the extension
|
|
@@ -262,6 +273,9 @@ var Extension = function Extension(props) {
|
|
|
262
273
|
}, props));
|
|
263
274
|
};
|
|
264
275
|
var _default_1 = overflowShadow(Extension, {
|
|
265
|
-
overflowSelector: '.extension-overflow-wrapper'
|
|
276
|
+
overflowSelector: '.extension-overflow-wrapper',
|
|
277
|
+
isDisabled: function isDisabled() {
|
|
278
|
+
return isExperimentEnabled('platform_editor_reduce_forced_layout_2') && isCssScrollTimelineSupported(globalThis.CSS);
|
|
279
|
+
}
|
|
266
280
|
});
|
|
267
281
|
export default _default_1;
|
|
@@ -19,7 +19,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
19
19
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
20
20
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
21
21
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
22
|
-
var packageVersion = "131.2.
|
|
22
|
+
var packageVersion = "131.2.2";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "131.2.
|
|
24
|
+
var packageVersion = "131.2.2";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -36,7 +36,7 @@ export default function overflowShadow(Component, options) {
|
|
|
36
36
|
_this.updateShadows();
|
|
37
37
|
});
|
|
38
38
|
_defineProperty(_this, "updateShadows", function () {
|
|
39
|
-
if (options.useShadowObserver) {
|
|
39
|
+
if (_this.isDisabled || options.useShadowObserver) {
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
42
|
_this.setState(function (prevState) {
|
|
@@ -90,6 +90,9 @@ export default function overflowShadow(Component, options) {
|
|
|
90
90
|
if (!_this.overflowContainer) {
|
|
91
91
|
_this.overflowContainer = container;
|
|
92
92
|
}
|
|
93
|
+
if (_this.isDisabled) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
93
96
|
if (options.useShadowObserver) {
|
|
94
97
|
_this.initShadowObserver();
|
|
95
98
|
return;
|
|
@@ -103,6 +106,15 @@ export default function overflowShadow(Component, options) {
|
|
|
103
106
|
}
|
|
104
107
|
_inherits(OverflowShadow, _React$Component);
|
|
105
108
|
return _createClass(OverflowShadow, [{
|
|
109
|
+
key: "isDisabled",
|
|
110
|
+
get: function get() {
|
|
111
|
+
if (this.disabled === undefined) {
|
|
112
|
+
var _options$isDisabled, _options$isDisabled2;
|
|
113
|
+
this.disabled = (_options$isDisabled = (_options$isDisabled2 = options.isDisabled) === null || _options$isDisabled2 === void 0 ? void 0 : _options$isDisabled2.call(options)) !== null && _options$isDisabled !== void 0 ? _options$isDisabled : false;
|
|
114
|
+
}
|
|
115
|
+
return this.disabled;
|
|
116
|
+
}
|
|
117
|
+
}, {
|
|
106
118
|
key: "componentWillUnmount",
|
|
107
119
|
value: function componentWillUnmount() {
|
|
108
120
|
if (options.useShadowObserver) {
|
|
@@ -153,7 +165,7 @@ export default function overflowShadow(Component, options) {
|
|
|
153
165
|
var _this$state = this.state,
|
|
154
166
|
showLeftShadow = _this$state.showLeftShadow,
|
|
155
167
|
showRightShadow = _this$state.showRightShadow;
|
|
156
|
-
var classNames = [!((_this$props = this.props) !== null && _this$props !== void 0 && _this$props.disableTableOverflowShadow) && showRightShadow && shadowClassNames.RIGHT_SHADOW, !((_this$props2 = this.props) !== null && _this$props2 !== void 0 && _this$props2.disableTableOverflowShadow) && showLeftShadow && shadowClassNames.LEFT_SHADOW, options.useShadowObserver && shadowObserverClassNames.SHADOW_CONTAINER].filter(Boolean).join(' ');
|
|
168
|
+
var classNames = this.isDisabled ? '' : [!((_this$props = this.props) !== null && _this$props !== void 0 && _this$props.disableTableOverflowShadow) && showRightShadow && shadowClassNames.RIGHT_SHADOW, !((_this$props2 = this.props) !== null && _this$props2 !== void 0 && _this$props2.disableTableOverflowShadow) && showLeftShadow && shadowClassNames.LEFT_SHADOW, options.useShadowObserver && shadowObserverClassNames.SHADOW_CONTAINER].filter(Boolean).join(' ');
|
|
157
169
|
|
|
158
170
|
/**
|
|
159
171
|
* The widths have already been calculated to determine
|
|
@@ -14,6 +14,11 @@ export interface OverflowShadowState {
|
|
|
14
14
|
showRightShadow: boolean;
|
|
15
15
|
}
|
|
16
16
|
export interface OverflowShadowOptions {
|
|
17
|
+
/**
|
|
18
|
+
* Opts the wrapped component out of the JavaScript driven shadows entirely: no scroll listeners
|
|
19
|
+
* or intersection observers are registered
|
|
20
|
+
*/
|
|
21
|
+
isDisabled?: () => boolean;
|
|
17
22
|
overflowSelector: string;
|
|
18
23
|
useShadowObserver?: boolean;
|
|
19
24
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "131.
|
|
3
|
+
"version": "131.3.0",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"@atlaskit/feature-gate-js-client": "^7.0.0",
|
|
55
55
|
"@atlaskit/icon": "^38.0.0",
|
|
56
56
|
"@atlaskit/link": "^5.1.0",
|
|
57
|
-
"@atlaskit/link-datasource": "^7.
|
|
58
|
-
"@atlaskit/link-picker": "^6.
|
|
57
|
+
"@atlaskit/link-datasource": "^7.5.0",
|
|
58
|
+
"@atlaskit/link-picker": "^6.13.0",
|
|
59
59
|
"@atlaskit/logo": "^23.3.0",
|
|
60
60
|
"@atlaskit/media-card": "^82.1.0",
|
|
61
61
|
"@atlaskit/media-client": "^39.2.0",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
80
80
|
"@atlaskit/react-ufo": "^8.1.0",
|
|
81
81
|
"@atlaskit/section-message": "^10.2.0",
|
|
82
|
-
"@atlaskit/smart-card": "^46.
|
|
83
|
-
"@atlaskit/smart-user-picker": "^12.
|
|
82
|
+
"@atlaskit/smart-card": "^46.7.0",
|
|
83
|
+
"@atlaskit/smart-user-picker": "^12.5.0",
|
|
84
84
|
"@atlaskit/spinner": "^20.4.0",
|
|
85
85
|
"@atlaskit/task-decision": "^21.12.0",
|
|
86
86
|
"@atlaskit/teams-app-config": "^3.1.0",
|