@atlaskit/renderer 110.1.1 → 110.2.1
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 +17 -0
- package/dist/cjs/react/nodes/TableStickyScrollbar.js +145 -0
- package/dist/cjs/react/nodes/table/colgroup.js +1 -2
- package/dist/cjs/react/nodes/table.js +47 -3
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/cjs/ui/Renderer/style.js +5 -2
- package/dist/es2019/react/nodes/TableStickyScrollbar.js +108 -0
- package/dist/es2019/react/nodes/table/colgroup.js +1 -2
- package/dist/es2019/react/nodes/table.js +44 -2
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/es2019/ui/Renderer/style.js +36 -2
- package/dist/esm/react/nodes/TableStickyScrollbar.js +138 -0
- package/dist/esm/react/nodes/table/colgroup.js +1 -2
- package/dist/esm/react/nodes/table.js +46 -2
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/esm/ui/Renderer/style.js +6 -3
- package/dist/types/react/nodes/TableStickyScrollbar.d.ts +21 -0
- package/dist/types/react/nodes/table.d.ts +4 -0
- package/dist/types-ts4.5/react/nodes/TableStickyScrollbar.d.ts +21 -0
- package/dist/types-ts4.5/react/nodes/table.d.ts +4 -0
- package/package.json +8 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 110.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#139038](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/139038)
|
|
8
|
+
[`86a6dad9fb62e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/86a6dad9fb62e) -
|
|
9
|
+
[ux] Enables Table sticky scrollbar in Renderer under an experiment FF.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 110.2.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [#142155](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/142155)
|
|
17
|
+
[`9749eb9ba2987`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9749eb9ba2987) -
|
|
18
|
+
Remove platform.editor.table.use-increased-scaling-percent feature flag
|
|
19
|
+
|
|
3
20
|
## 110.1.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.TableStickyScrollbar = void 0;
|
|
8
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
var _ui = require("@atlaskit/editor-common/ui");
|
|
12
|
+
var _styles = require("@atlaskit/editor-common/styles");
|
|
13
|
+
var TableStickyScrollbar = exports.TableStickyScrollbar = /*#__PURE__*/function () {
|
|
14
|
+
function TableStickyScrollbar(wrapper) {
|
|
15
|
+
var _this = this;
|
|
16
|
+
(0, _classCallCheck2.default)(this, TableStickyScrollbar);
|
|
17
|
+
(0, _defineProperty2.default)(this, "sentinels", {});
|
|
18
|
+
(0, _defineProperty2.default)(this, "handleScroll", function (event) {
|
|
19
|
+
if (!_this.stickyScrollbarContainerElement || !_this.wrapper || event.target !== _this.stickyScrollbarContainerElement) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
_this.wrapper.scrollLeft = _this.stickyScrollbarContainerElement.scrollLeft;
|
|
23
|
+
});
|
|
24
|
+
this.wrapper = wrapper;
|
|
25
|
+
this.init();
|
|
26
|
+
}
|
|
27
|
+
(0, _createClass2.default)(TableStickyScrollbar, [{
|
|
28
|
+
key: "dispose",
|
|
29
|
+
value: function dispose() {
|
|
30
|
+
if (this.stickyScrollbarContainerElement) {
|
|
31
|
+
this.stickyScrollbarContainerElement.removeEventListener('scroll', this.handleScroll);
|
|
32
|
+
}
|
|
33
|
+
this.deleteIntersectionObserver();
|
|
34
|
+
}
|
|
35
|
+
}, {
|
|
36
|
+
key: "scrollLeft",
|
|
37
|
+
value: function scrollLeft(left) {
|
|
38
|
+
if (this.stickyScrollbarContainerElement) {
|
|
39
|
+
this.stickyScrollbarContainerElement.scrollLeft = left;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}, {
|
|
43
|
+
key: "init",
|
|
44
|
+
value: function init() {
|
|
45
|
+
var _this$wrapper$parentE;
|
|
46
|
+
if (!this.wrapper) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
this.stickyScrollbarContainerElement = (_this$wrapper$parentE = this.wrapper.parentElement) === null || _this$wrapper$parentE === void 0 ? void 0 : _this$wrapper$parentE.querySelector(".".concat(_styles.TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_CONTAINER));
|
|
50
|
+
if (this.stickyScrollbarContainerElement) {
|
|
51
|
+
this.stickyScrollbarContainerElement.addEventListener('scroll', this.handleScroll, {
|
|
52
|
+
passive: true
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
this.createIntersectionObserver();
|
|
56
|
+
}
|
|
57
|
+
}, {
|
|
58
|
+
key: "createIntersectionObserver",
|
|
59
|
+
value: function createIntersectionObserver() {
|
|
60
|
+
var _this2 = this,
|
|
61
|
+
_this$wrapper,
|
|
62
|
+
_this$wrapper2;
|
|
63
|
+
this.rendererScrollableElement = (0, _ui.findOverflowScrollParent)(window.document.querySelector('.pm-table-container')) || window.document;
|
|
64
|
+
if (!this.rendererScrollableElement || !this.wrapper) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
this.intersectionObserver = new IntersectionObserver(function (entries, _) {
|
|
68
|
+
if (!_this2.stickyScrollbarContainerElement) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
entries.forEach(function (entry) {
|
|
72
|
+
var _entry$rootBounds;
|
|
73
|
+
var target = entry.target;
|
|
74
|
+
// if the rootBounds has 0 height, e.g. confluence preview mode, we do nothing.
|
|
75
|
+
if (((_entry$rootBounds = entry.rootBounds) === null || _entry$rootBounds === void 0 ? void 0 : _entry$rootBounds.height) === 0) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (target.classList.contains(_styles.TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM)) {
|
|
79
|
+
_this2.sentinelBottomCallback(entry);
|
|
80
|
+
}
|
|
81
|
+
if (target.classList.contains(_styles.TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP)) {
|
|
82
|
+
_this2.sentinelTopCallback(entry);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}, {
|
|
86
|
+
root: this.rendererScrollableElement
|
|
87
|
+
});
|
|
88
|
+
this.sentinels.bottom = (_this$wrapper = this.wrapper) === null || _this$wrapper === void 0 || (_this$wrapper = _this$wrapper.parentElement) === null || _this$wrapper === void 0 || (_this$wrapper = _this$wrapper.getElementsByClassName(_styles.TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM)) === null || _this$wrapper === void 0 ? void 0 : _this$wrapper.item(0);
|
|
89
|
+
this.sentinels.top = (_this$wrapper2 = this.wrapper) === null || _this$wrapper2 === void 0 || (_this$wrapper2 = _this$wrapper2.parentElement) === null || _this$wrapper2 === void 0 || (_this$wrapper2 = _this$wrapper2.getElementsByClassName(_styles.TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP)) === null || _this$wrapper2 === void 0 ? void 0 : _this$wrapper2.item(0);
|
|
90
|
+
[this.sentinels.bottom, this.sentinels.top].forEach(function (el) {
|
|
91
|
+
return _this2.intersectionObserver.observe(el);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}, {
|
|
95
|
+
key: "deleteIntersectionObserver",
|
|
96
|
+
value: function deleteIntersectionObserver() {
|
|
97
|
+
if (this.intersectionObserver) {
|
|
98
|
+
if (this.sentinels.bottom) {
|
|
99
|
+
this.intersectionObserver.unobserve(this.sentinels.bottom);
|
|
100
|
+
}
|
|
101
|
+
this.intersectionObserver.disconnect();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}, {
|
|
105
|
+
key: "sentinelBottomCallback",
|
|
106
|
+
value: function sentinelBottomCallback(entry) {
|
|
107
|
+
var _entry$rootBounds2;
|
|
108
|
+
var sentinelIsAboveScrollArea = entry.boundingClientRect.top < (((_entry$rootBounds2 = entry.rootBounds) === null || _entry$rootBounds2 === void 0 ? void 0 : _entry$rootBounds2.top) || 0);
|
|
109
|
+
this.bottomSentinelState = sentinelIsAboveScrollArea ? 'above' : entry.isIntersecting ? 'visible' : 'below';
|
|
110
|
+
this.toggle();
|
|
111
|
+
}
|
|
112
|
+
}, {
|
|
113
|
+
key: "sentinelTopCallback",
|
|
114
|
+
value: function sentinelTopCallback(entry) {
|
|
115
|
+
var _entry$rootBounds3;
|
|
116
|
+
var sentinelIsBelowScrollArea = (((_entry$rootBounds3 = entry.rootBounds) === null || _entry$rootBounds3 === void 0 ? void 0 : _entry$rootBounds3.bottom) || 0) < entry.boundingClientRect.top;
|
|
117
|
+
this.topSentinelState = sentinelIsBelowScrollArea ? 'below' : entry.isIntersecting ? 'visible' : 'above';
|
|
118
|
+
this.toggle();
|
|
119
|
+
}
|
|
120
|
+
}, {
|
|
121
|
+
key: "toggle",
|
|
122
|
+
value: function toggle() {
|
|
123
|
+
if ((this.topSentinelState === 'visible' || this.topSentinelState === 'above') && this.bottomSentinelState === 'below') {
|
|
124
|
+
this.show();
|
|
125
|
+
} else {
|
|
126
|
+
this.hide();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}, {
|
|
130
|
+
key: "hide",
|
|
131
|
+
value: function hide() {
|
|
132
|
+
if (this.stickyScrollbarContainerElement && this.stickyScrollbarContainerElement.style.display !== 'none') {
|
|
133
|
+
this.stickyScrollbarContainerElement.style.display = 'none';
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}, {
|
|
137
|
+
key: "show",
|
|
138
|
+
value: function show() {
|
|
139
|
+
if (this.stickyScrollbarContainerElement && this.stickyScrollbarContainerElement.style.display !== 'block') {
|
|
140
|
+
this.stickyScrollbarContainerElement.style.display = 'block';
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}]);
|
|
144
|
+
return TableStickyScrollbar;
|
|
145
|
+
}();
|
|
@@ -10,7 +10,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
10
10
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
11
11
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
12
12
|
var _nodeWidth = require("@atlaskit/editor-common/node-width");
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _useFeatureFlags = require("../../../use-feature-flags");
|
|
15
14
|
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; }
|
|
16
15
|
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; }
|
|
@@ -139,7 +138,7 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
|
139
138
|
var scaleDownPercent = 0;
|
|
140
139
|
var isTableScalingWithFixedColumnWidthsOptionEnabled = isTableScalingEnabled && isTableFixedColumnWidthsOptionEnabled;
|
|
141
140
|
var isTableWidthFixed = isTableScalingWithFixedColumnWidthsOptionEnabled && ((_props$tableNode = props.tableNode) === null || _props$tableNode === void 0 ? void 0 : _props$tableNode.attrs.displayMode) === 'fixed';
|
|
142
|
-
var maxScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled
|
|
141
|
+
var maxScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled ? MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION : MAX_SCALING_PERCENT;
|
|
143
142
|
|
|
144
143
|
// fixes migration tables with zero-width columns
|
|
145
144
|
if (zeroWidthColumnsCount > 0) {
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.isTableResizingEnabled = exports.default = exports.TableProcessor = exports.TableContainer = void 0;
|
|
7
|
+
exports.isTableResizingEnabled = exports.isStickyScrollbarEnabled = exports.default = exports.TableProcessor = exports.TableContainer = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -27,6 +27,7 @@ var _SmartCardStorage = require("../../ui/SmartCardStorage");
|
|
|
27
27
|
var _sticky = require("./table/sticky");
|
|
28
28
|
var _table = require("./table/table");
|
|
29
29
|
var _appearance = require("../utils/appearance");
|
|
30
|
+
var _TableStickyScrollbar = require("./TableStickyScrollbar");
|
|
30
31
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
31
32
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
32
33
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -37,6 +38,11 @@ var isTableResizingEnabled = exports.isTableResizingEnabled = function isTableRe
|
|
|
37
38
|
exposure: true
|
|
38
39
|
});
|
|
39
40
|
};
|
|
41
|
+
var isStickyScrollbarEnabled = exports.isStickyScrollbarEnabled = function isStickyScrollbarEnabled(appearance) {
|
|
42
|
+
return (0, _appearance.isFullWidthOrFullPageAppearance)(appearance) && (0, _experiments.editorExperiment)('platform_renderer_table_sticky_scrollbar', true, {
|
|
43
|
+
exposure: true
|
|
44
|
+
});
|
|
45
|
+
};
|
|
40
46
|
var orderChildren = function orderChildren(children, tableNode, smartCardStorage, tableOrderStatus) {
|
|
41
47
|
if (!tableOrderStatus || tableOrderStatus.order === _types.SortOrder.NO_ORDER) {
|
|
42
48
|
return children;
|
|
@@ -136,6 +142,7 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
136
142
|
});
|
|
137
143
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "tableRef", /*#__PURE__*/_react.default.createRef());
|
|
138
144
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "stickyHeaderRef", /*#__PURE__*/_react.default.createRef());
|
|
145
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "stickyScrollbarRef", /*#__PURE__*/_react.default.createRef());
|
|
139
146
|
// used for sync scroll + copying wrapper width to sticky header
|
|
140
147
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "stickyWrapperRef", /*#__PURE__*/_react.default.createRef());
|
|
141
148
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "wrapperRef", /*#__PURE__*/_react.default.createRef());
|
|
@@ -177,6 +184,9 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
177
184
|
if (_this.resizeObserver) {
|
|
178
185
|
_this.resizeObserver.disconnect();
|
|
179
186
|
}
|
|
187
|
+
if (_this.stickyScrollbar) {
|
|
188
|
+
_this.stickyScrollbar.dispose();
|
|
189
|
+
}
|
|
180
190
|
});
|
|
181
191
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getScrollTop", function () {
|
|
182
192
|
var stickyHeaders = _this.props.stickyHeaders;
|
|
@@ -217,6 +227,9 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
217
227
|
return;
|
|
218
228
|
}
|
|
219
229
|
_this.stickyWrapperRef.current.scrollLeft = _this.wrapperRef.current.scrollLeft;
|
|
230
|
+
if (_this.stickyScrollbarRef.current) {
|
|
231
|
+
_this.stickyScrollbarRef.current.scrollLeft = _this.wrapperRef.current.scrollLeft;
|
|
232
|
+
}
|
|
220
233
|
});
|
|
221
234
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "grabFirstRowRef", function (children) {
|
|
222
235
|
return _react.default.Children.map(children || false, function (child, idx) {
|
|
@@ -244,6 +257,9 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
244
257
|
this.overflowParent = _sticky.OverflowParent.fromElement(this.tableRef.current);
|
|
245
258
|
this.overflowParent.addEventListener('scroll', this.onScroll);
|
|
246
259
|
}
|
|
260
|
+
if (this.wrapperRef.current && isStickyScrollbarEnabled(this.props.rendererAppearance)) {
|
|
261
|
+
this.stickyScrollbar = new _TableStickyScrollbar.TableStickyScrollbar(this.wrapperRef.current);
|
|
262
|
+
}
|
|
247
263
|
}
|
|
248
264
|
}, {
|
|
249
265
|
key: "componentDidUpdate",
|
|
@@ -289,6 +305,7 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
289
305
|
}, {
|
|
290
306
|
key: "render",
|
|
291
307
|
value: function render() {
|
|
308
|
+
var _this$tableRef$curren;
|
|
292
309
|
var _this$props = this.props,
|
|
293
310
|
isNumberColumnEnabled = _this$props.isNumberColumnEnabled,
|
|
294
311
|
layout = _this$props.layout,
|
|
@@ -377,7 +394,11 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
377
394
|
left: left,
|
|
378
395
|
marginLeft: shouldCalculateLeftForAlignment && left !== undefined ? -left : undefined
|
|
379
396
|
}
|
|
380
|
-
},
|
|
397
|
+
}, isStickyScrollbarEnabled(this.props.rendererAppearance) && /*#__PURE__*/_react.default.createElement("div", {
|
|
398
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
399
|
+
className: _styles.TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP,
|
|
400
|
+
"data-testid": "sticky-scrollbar-sentinel-top"
|
|
401
|
+
}), stickyHeaders && tableCanBeSticky(tableNode, children) && /*#__PURE__*/_react.default.createElement(_sticky.StickyTable, {
|
|
381
402
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
382
403
|
tableWidth: tableWidth,
|
|
383
404
|
layout: layout,
|
|
@@ -409,7 +430,30 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
409
430
|
isInsideOfBlockNode: isInsideOfBlockNode,
|
|
410
431
|
isinsideMultiBodiedExtension: isinsideMultiBodiedExtension,
|
|
411
432
|
allowTableResizing: allowTableResizing
|
|
412
|
-
}, this.grabFirstRowRef(children))))
|
|
433
|
+
}, this.grabFirstRowRef(children))), isStickyScrollbarEnabled(this.props.rendererAppearance) && /*#__PURE__*/_react.default.createElement("div", {
|
|
434
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
435
|
+
className: _styles.TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_CONTAINER,
|
|
436
|
+
ref: this.stickyScrollbarRef,
|
|
437
|
+
style: {
|
|
438
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
439
|
+
height: "var(--ds-space-250, 20px)",
|
|
440
|
+
// MAX_BROWSER_SCROLLBAR_HEIGHT
|
|
441
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
442
|
+
display: 'block',
|
|
443
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
444
|
+
width: '100%'
|
|
445
|
+
}
|
|
446
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
447
|
+
style: {
|
|
448
|
+
width: (_this$tableRef$curren = this.tableRef.current) === null || _this$tableRef$curren === void 0 ? void 0 : _this$tableRef$curren.clientWidth,
|
|
449
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
450
|
+
height: '100%'
|
|
451
|
+
}
|
|
452
|
+
})), isStickyScrollbarEnabled(this.props.rendererAppearance) && /*#__PURE__*/_react.default.createElement("div", {
|
|
453
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
454
|
+
className: _styles.TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM,
|
|
455
|
+
"data-testid": "sticky-scrollbar-sentinel-bottom"
|
|
456
|
+
})));
|
|
413
457
|
}
|
|
414
458
|
}]);
|
|
415
459
|
return TableContainer;
|
|
@@ -63,7 +63,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
63
63
|
var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
64
64
|
var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
65
65
|
var packageName = "@atlaskit/renderer";
|
|
66
|
-
var packageVersion = "110.
|
|
66
|
+
var packageVersion = "110.2.1";
|
|
67
67
|
var defaultNodeComponents = exports.defaultNodeComponents = _nodes.nodeToReact;
|
|
68
68
|
var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
69
69
|
(0, _inherits2.default)(Renderer, _PureComponent);
|
|
@@ -145,6 +145,8 @@ function getAnnotationStyles(_ref6) {
|
|
|
145
145
|
}
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
|
+
var tableRowHeight = 44;
|
|
149
|
+
var stickyScrollbarStyles = "\n\tposition: relative;\n\tflex-direction: column;\n\n\t> .".concat(_styles.TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_CONTAINER, " {\n\t width: 100%;\n\t display: none;\n\t overflow-x: auto;\n\t position: sticky;\n\t bottom: ", "var(--ds-space-0, 0px)", ";\n\t z-index: 1;\n\t}\n\n\t> .").concat(_styles.TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM, ",\n\t> .").concat(_styles.TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP, " {\n\t position: absolute;\n\t width: 100%;\n\t height: 1px;\n\t margin-top: -1px;\n\t // need this to avoid sentinel being focused via keyboard\n\t // this still allows it to be detected by intersection observer\n\t visibility: hidden;\n\t }\n\t > .").concat(_styles.TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP, " {\n\t top: ").concat(tableRowHeight * 3, "px;\n\t }\n\t > .").concat(_styles.TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM, " {\n\t bottom: ", "var(--ds-space-250, 20px)", "; // MAX_BROWSER_SCROLLBAR_HEIGHT = 20;\n\t }\n ");
|
|
148
150
|
var rendererStyles = exports.rendererStyles = function rendererStyles(wrapperProps) {
|
|
149
151
|
return function (theme) {
|
|
150
152
|
var _getGlobalTheme = (0, _tokens.getGlobalTheme)(),
|
|
@@ -153,10 +155,11 @@ var rendererStyles = exports.rendererStyles = function rendererStyles(wrapperPro
|
|
|
153
155
|
var themeProps = {
|
|
154
156
|
theme: theme
|
|
155
157
|
};
|
|
156
|
-
var useBlockRenderForCodeBlock = wrapperProps.useBlockRenderForCodeBlock
|
|
158
|
+
var useBlockRenderForCodeBlock = wrapperProps.useBlockRenderForCodeBlock,
|
|
159
|
+
appearance = wrapperProps.appearance;
|
|
157
160
|
|
|
158
161
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/design-system/no-css-tagged-template-expression
|
|
159
|
-
return (0, _react.css)(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n\t\tfont-size: ", "px;\n\t\tline-height: 1.5rem;\n\t\tcolor: ", ";\n\n\t\t.", "::after {\n\t\t\t// we add a clearfix after ak-renderer-document in order to\n\t\t\t// contain internal floats (such as media images that are \"wrap-left\")\n\t\t\t// to just the renderer (and not spill outside of it)\n\t\t\tcontent: '';\n\t\t\tvisibility: hidden;\n\t\t\tdisplay: block;\n\t\t\theight: 0;\n\t\t\tclear: both;\n\t\t}\n\n\t\t", "\n\t\t", "\n\n .", " {\n\t\t\t", "\n\t\t}\n\n\t\t& h1 {\n\t\t\t", "\n\t\t}\n\n\t\t& h2 {\n\t\t\t", "\n\t\t}\n\n\t\t& h3 {\n\t\t\t", "\n\t\t}\n\n\t\t& h4 {\n\t\t\t", "\n\t\t}\n\n\t\t& h5 {\n\t\t\t", "\n\t\t}\n\n\t\t& h6 {\n\t\t\t", "\n\t\t}\n\n\t\t& span.akActionMark {\n\t\t\tcolor: ", ";\n\t\t\ttext-decoration: none;\n\n\t\t\t&:hover {\n\t\t\t\tcolor: ", ";\n\t\t\t\ttext-decoration: underline;\n\t\t\t}\n\n\t\t\t&:active {\n\t\t\t\tcolor: ", ";\n\t\t\t}\n\t\t}\n\n\t\t& span.akActionMark {\n\t\t\tcursor: pointer;\n\t\t}\n\n\t\t& span[data-placeholder] {\n\t\t\tcolor: ", ";\n\t\t}\n\n\t\t", "\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", "\n\t\t", "\n\n\t\t& .UnknownBlock {\n\t\t\tfont-family: ", ";\n\t\t\tfont-size: ", ";\n\t\t\tfont-weight: 400;\n\t\t\twhite-space: pre-wrap;\n\t\t\tword-wrap: break-word;\n\t\t}\n\n\t\t& span.date-node {\n\t\t\tbackground: ", ";\n\t\t\tborder-radius: ", ";\n\t\t\tcolor: ", ";\n\t\t\tpadding: ", " ", ";\n\t\t\tmargin: 0 1px;\n\t\t\ttransition: background 0.3s;\n\t\t}\n\n\t\t& span.date-node-highlighted {\n\t\t\tbackground: ", ";\n\t\t\tcolor: ", ";\n\t\t}\n\n\t\t& .renderer-image {\n\t\t\tmax-width: 100%;\n\t\t\tdisplay: block;\n\t\t\tmargin: ", " 0;\n\t\t}\n\n\t\t.", ".rich-media-wrapped + .", ":not(.rich-media-wrapped) {\n\t\t\tclear: both;\n\t\t}\n\n\t\t& .code-block,\n\t\t& blockquote,\n\t\t& hr,\n\t\t& > div > div:not(.rich-media-wrapped),\n\t\t.", ".rich-media-wrapped + .rich-media-wrapped + *:not(.rich-media-wrapped),\n\t\t.", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n\t\t.", ".image-align-start,\n\t\t\t.", ".image-center,\n\t\t\t.", ".image-align-end {\n\t\t\tclear: both;\n\t\t}\n\n\t\t& .rich-media-wrapped {\n\t\t\t& + h1,\n\t\t\t& + h2,\n\t\t\t& + h3,\n\t\t\t& + h4,\n\t\t\t& + h5,\n\t\t\t& + h6 {\n\t\t\t\tmargin-top: ", ";\n\t\t\t}\n\t\t}\n\n\t\t", "\n\t\t/* plugin styles */\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n\t\t\tmargin-left: 0;\n\t\t\tmargin-right: 0;\n\t\t}\n\n\t\t/* Breakout for tables and extensions */\n\t\t.", " > {\n\t\t\t", "\n\n\t\t\t* .", " {\n\t\t\t\toverflow-x: auto;\n\t\t\t}\n\n\t\t\t& .", ":first-child {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\t.", " {\n\t\t\t\tmargin-top: ", ";\n\t\t\t}\n\n\t\t\t.", " {\n\t\t\t\tmargin-left: 50%;\n\t\t\t\ttransform: translateX(-50%);\n\t\t\t}\n\n\t\t\t.", " {\n\t\t\t\toverflow-x: auto;\n\t\t\t}\n\n\t\t\t.", " .", " {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\t\t}\n\n\t\t", "\n\n\t\t.", " .", " {\n\t\t\tz-index: 0;\n\t\t\ttransition: all 0.1s linear;\n\t\t\tdisplay: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n\t\t\t/** Shadow overrides */\n\t\t\t&.", "::after, &.", "::before {\n\t\t\t\ttop: ", "px;\n\t\t\t\theight: calc(100% - ", "px);\n\t\t\t\tz-index: ", ";\n\t\t\t}\n\n\t\t\t", "\n\n\t\t\t&\n .", ",\n &\n .", " {\n\t\t\t\theight: calc(100% - ", "px);\n\t\t\t}\n\n\t\t\t/**\n * A hack for making all the <th /> heights equal in case some have shorter\n * content than others.\n *\n * This is done to make sort buttons fill entire <th />.\n */\n\t\t\ttable {\n\t\t\t\theight: 1px; /* will be ignored */\n\t\t\t\t", ";\n\t\t\t\tmargin-left: 0;\n\t\t\t\tmargin-right: 0;\n\t\t\t}\n\n\t\t\ttable tr:first-of-type {\n\t\t\t\theight: 100%;\n\n\t\t\t\ttd,\n\t\t\t\tth {\n\t\t\t\t\tposition: relative;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttable[data-number-column='true'] {\n\t\t\t\t.", " {\n\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\tborder-right: 1px solid\n\t\t\t\t\t\t", ";\n\t\t\t\t\twidth: ", "px;\n\t\t\t\t\ttext-align: center;\n\t\t\t\t\tcolor: ", ";\n\t\t\t\t\tfont-size: ", ";\n\t\t\t\t}\n\n\t\t\t\t.fixed .", " {\n\t\t\t\t\tborder-right: 0px none;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttr[data-header-row].fixed {\n\t\t\tposition: fixed !important;\n\t\t\tdisplay: flex;\n\t\t\toverflow: hidden;\n\t\t\tz-index: ", ";\n\n\t\t\tborder-right: 1px solid ", ";\n\t\t\tborder-bottom: 1px solid ", ";\n\n\t\t\t/* this is to compensate for the table border */\n\t\t\ttransform: translateX(-1px);\n\t\t}\n\n\t\t.sticky > th {\n\t\t\tz-index: ", ";\n\t\t\tposition: sticky !important;\n\t\t\ttop: 0;\n\t\t}\n\n\t\t/* Make the number column header sticky */\n\t\t.sticky > td {\n\t\t\tposition: sticky !important;\n\t\t\ttop: 0;\n\t\t}\n\n\t\t/* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n\t\t.sticky th,\n\t\t.sticky td {\n\t\t\tbox-shadow:\n\t\t\t\t0px 1px ", ",\n\t\t\t\t0px -0.5px ", ",\n\t\t\t\tinset -1px 0px ", ",\n\t\t\t\t0px -1px ", ";\n\t\t}\n\n\t\t/* this will remove jumpiness caused in Chrome for sticky headers */\n\t\t.fixed + tr {\n\t\t\tmin-height: 0px;\n\t\t}\n\n\t\t/*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n\t\t& .code-block {\n\t\t\tmax-width: 100%;\n\t\t\t/* -ms- properties are necessary until MS supports the latest version of the grid spec */\n\t\t\t/* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n\t\t\tdisplay: block;\n\t\t\t/* stylelint-enable */\n\n\t\t\tposition: relative;\n\t\t\tborder-radius: ", ";\n\n\t\t\t/*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n\t\t\tword-wrap: normal;\n\t\t}\n\n\t\t& .MediaGroup,\n\t\t& .code-block {\n\t\t\tmargin-top: ", ";\n\n\t\t\t&:first-child {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\t\t}\n\n\t\t", "\n\n\t\t", "\n\n ", ";\n\t\t& [data-layout-section] {\n\t\t\tmargin-top: ", ";\n\t\t\t& > div + div {\n\t\t\t\tmargin-left: ", ";\n\t\t\t}\n\n\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t& > div + div {\n\t\t\t\t\tmargin-left: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t& .MediaGroup,\n\t\t\t& .code-block {\n\t\t\t\tmargin-top: ", ";\n\n\t\t\t\t&:first-child {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t& li {\n\t\t\t> .code-block {\n\t\t\t\tmargin: ", " 0 0 0;\n\t\t\t}\n\t\t\t> .code-block:first-child {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\n\t\t\t> div:last-of-type.code-block {\n\t\t\t\tmargin-bottom: ", ";\n\t\t\t}\n\t\t}\n\n\t\t&:not([data-node-type='decisionList']) > li,\n // This prevents https://product-fabric.atlassian.net/browse/ED-20924\n &:not(.", ") > li {\n\t\t\t", "\n\t\t}\n\t"])), (0, _editorSharedStyles.editorFontSize)(themeProps), "var(--ds-text, ".concat(colors.N800, ")"), _consts.RendererCssClassName.DOCUMENT, fullPageStyles(wrapperProps, themeProps), fullWidthStyles(wrapperProps), _consts.RendererCssClassName.DOCUMENT, _mediaInline.mediaInlineImageStyles, headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), "var(--ds-link, ".concat(colors.B400, ")"), "var(--ds-link, ".concat(colors.B300, ")"), "var(--ds-link-pressed, ".concat(colors.B500, ")"), "var(--ds-text-subtlest, ".concat(colors.N200, ")"), telepointerStyles(colorMode), _styles.whitespaceSharedStyles, (0, _experiments.editorExperiment)('nested-dnd', true) ? _styles.blockquoteSharedStylesNew : _styles.blockquoteSharedStyles, (0, _styles.headingsSharedStyles)(), (0, _styles.ruleSharedStyles)(), _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.blockMarksSharedStyles, (0, _styles.codeMarkSharedStyles)(), _styles.shadowSharedStyle, _styles.dateSharedStyle, _styles.textColorStyles, (0, _styles.backgroundColorStyles)(), _styles.tasksAndDecisionsStyles, _styles.smartCardSharedStyles, getAnnotationStyles(wrapperProps), (0, _constants.fontFamily)(), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), "var(--ds-background-neutral, ".concat(colors.N30A, ")"), "var(--ds-border-radius-100, 3px)", "var(--ds-text, ".concat(colors.N800, ")"), "var(--ds-space-025, 2px)", "var(--ds-space-050, 4px)", "var(--ds-background-danger, ".concat(colors.R50, ")"), "var(--ds-text-danger, ".concat(colors.R500, ")"), "var(--ds-space-300, 24px)", _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, "var(--ds-space-100, 8px)", alignedHeadingAnchorStyle(wrapperProps), _styles.mediaSingleSharedStyle, _consts.RendererCssClassName.DOCUMENT, breakoutWidthStyle(), _consts.RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, _consts.RendererCssClassName.EXTENSION, _consts.RendererCssClassName.DOCUMENT, _consts.RendererCssClassName.EXTENSION, _editorSharedStyles.blockNodesVerticalMargin, _consts.RendererCssClassName.EXTENSION_CENTER_ALIGN, _styles.TableSharedCssClassName.TABLE_NODE_WRAPPER, _ui.shadowObserverClassNames.SHADOW_CONTAINER, _styles.TableSharedCssClassName.TABLE_NODE_WRAPPER, (0, _styles.tableSharedStyle)(), _consts.RendererCssClassName.DOCUMENT, _styles.TableSharedCssClassName.TABLE_CONTAINER, _ui.shadowClassNames.RIGHT_SHADOW, _ui.shadowClassNames.LEFT_SHADOW, _styles.tableMarginTop - 1, _styles.tableMarginTop, _editorSharedStyles.akEditorStickyHeaderZIndex, getShadowOverrides(), _ui.shadowObserverClassNames.SENTINEL_LEFT, _ui.shadowObserverClassNames.SENTINEL_RIGHT, _styles.tableMarginTop, tableSortableColumnStyle(wrapperProps), _consts.RendererCssClassName.NUMBER_COLUMN, "var(--ds-background-neutral, ".concat(_editorSharedStyles.akEditorTableToolbar, ")"), "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorder, ")"), _editorSharedStyles.akEditorTableNumberColumnWidth, "var(--ds-text-subtlest, ".concat(colors.N200, ")"), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), _consts.RendererCssClassName.NUMBER_COLUMN, _editorSharedStyles.akEditorStickyHeaderZIndex, "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorder, ")"), "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorder, ")"), _editorSharedStyles.akEditorStickyHeaderZIndex, "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorder, ")"), "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorder, ")"), "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableToolbar, ")"), "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableToolbar, ")"), "var(--ds-border-radius-100, 3px)", _editorSharedStyles.blockNodesVerticalMargin, useGridRenderForCodeBlock(useBlockRenderForCodeBlock), (0, _lightWeightCodeBlock.getLightWeightCodeBlockStylesForRootRendererStyleSheet)(), _styles.columnLayoutSharedStyle, "var(--ds-space-250, 20px)", "var(--ds-space-400, 32px)", _editorSharedStyles.gridMediumMaxWidth, _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.blockNodesVerticalMargin, _styles.SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, _browser.browser.safari ? _styles.codeBlockInListSafariFix : '');
|
|
162
|
+
return (0, _react.css)(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n\t\tfont-size: ", "px;\n\t\tline-height: 1.5rem;\n\t\tcolor: ", ";\n\n\t\t.", "::after {\n\t\t\t// we add a clearfix after ak-renderer-document in order to\n\t\t\t// contain internal floats (such as media images that are \"wrap-left\")\n\t\t\t// to just the renderer (and not spill outside of it)\n\t\t\tcontent: '';\n\t\t\tvisibility: hidden;\n\t\t\tdisplay: block;\n\t\t\theight: 0;\n\t\t\tclear: both;\n\t\t}\n\n\t\t", "\n\t\t", "\n\n .", " {\n\t\t\t", "\n\t\t}\n\n\t\t& h1 {\n\t\t\t", "\n\t\t}\n\n\t\t& h2 {\n\t\t\t", "\n\t\t}\n\n\t\t& h3 {\n\t\t\t", "\n\t\t}\n\n\t\t& h4 {\n\t\t\t", "\n\t\t}\n\n\t\t& h5 {\n\t\t\t", "\n\t\t}\n\n\t\t& h6 {\n\t\t\t", "\n\t\t}\n\n\t\t& span.akActionMark {\n\t\t\tcolor: ", ";\n\t\t\ttext-decoration: none;\n\n\t\t\t&:hover {\n\t\t\t\tcolor: ", ";\n\t\t\t\ttext-decoration: underline;\n\t\t\t}\n\n\t\t\t&:active {\n\t\t\t\tcolor: ", ";\n\t\t\t}\n\t\t}\n\n\t\t& span.akActionMark {\n\t\t\tcursor: pointer;\n\t\t}\n\n\t\t& span[data-placeholder] {\n\t\t\tcolor: ", ";\n\t\t}\n\n\t\t", "\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", "\n\t\t", "\n\n\t\t& .UnknownBlock {\n\t\t\tfont-family: ", ";\n\t\t\tfont-size: ", ";\n\t\t\tfont-weight: 400;\n\t\t\twhite-space: pre-wrap;\n\t\t\tword-wrap: break-word;\n\t\t}\n\n\t\t& span.date-node {\n\t\t\tbackground: ", ";\n\t\t\tborder-radius: ", ";\n\t\t\tcolor: ", ";\n\t\t\tpadding: ", " ", ";\n\t\t\tmargin: 0 1px;\n\t\t\ttransition: background 0.3s;\n\t\t}\n\n\t\t& span.date-node-highlighted {\n\t\t\tbackground: ", ";\n\t\t\tcolor: ", ";\n\t\t}\n\n\t\t& .renderer-image {\n\t\t\tmax-width: 100%;\n\t\t\tdisplay: block;\n\t\t\tmargin: ", " 0;\n\t\t}\n\n\t\t.", ".rich-media-wrapped + .", ":not(.rich-media-wrapped) {\n\t\t\tclear: both;\n\t\t}\n\n\t\t& .code-block,\n\t\t& blockquote,\n\t\t& hr,\n\t\t& > div > div:not(.rich-media-wrapped),\n\t\t.", ".rich-media-wrapped + .rich-media-wrapped + *:not(.rich-media-wrapped),\n\t\t.", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n\t\t.", ".image-align-start,\n\t\t\t.", ".image-center,\n\t\t\t.", ".image-align-end {\n\t\t\tclear: both;\n\t\t}\n\n\t\t& .rich-media-wrapped {\n\t\t\t& + h1,\n\t\t\t& + h2,\n\t\t\t& + h3,\n\t\t\t& + h4,\n\t\t\t& + h5,\n\t\t\t& + h6 {\n\t\t\t\tmargin-top: ", ";\n\t\t\t}\n\t\t}\n\n\t\t", "\n\t\t/* plugin styles */\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n\t\t\tmargin-left: 0;\n\t\t\tmargin-right: 0;\n\t\t}\n\n\t\t/* Breakout for tables and extensions */\n\t\t.", " > {\n\t\t\t", "\n\n\t\t\t* .", " {\n\t\t\t\toverflow-x: auto;\n\t\t\t}\n\n\t\t\t& .", ":first-child {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\t.", " {\n\t\t\t\tmargin-top: ", ";\n\t\t\t}\n\n\t\t\t.", " {\n\t\t\t\tmargin-left: 50%;\n\t\t\t\ttransform: translateX(-50%);\n\t\t\t}\n\n\t\t\t.", " {\n\t\t\t\toverflow-x: auto;\n\t\t\t}\n\n\t\t\t.", " .", " {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\t\t}\n\n\t\t", "\n\n\t\t.", " .", " {\n\t\t\tz-index: 0;\n\t\t\ttransition: all 0.1s linear;\n\t\t\tdisplay: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n\t\t\t/** Shadow overrides */\n\t\t\t&.", "::after, &.", "::before {\n\t\t\t\ttop: ", "px;\n\t\t\t\theight: calc(100% - ", "px);\n\t\t\t\tz-index: ", ";\n\t\t\t}\n\n\t\t\t", "\n\n\t\t\t", "\n\n\t\t\t&\n .", ",\n &\n .", " {\n\t\t\t\theight: calc(100% - ", "px);\n\t\t\t}\n\n\t\t\t/**\n * A hack for making all the <th /> heights equal in case some have shorter\n * content than others.\n *\n * This is done to make sort buttons fill entire <th />.\n */\n\t\t\ttable {\n\t\t\t\theight: 1px; /* will be ignored */\n\t\t\t\t", ";\n\t\t\t\tmargin-left: 0;\n\t\t\t\tmargin-right: 0;\n\t\t\t}\n\n\t\t\ttable tr:first-of-type {\n\t\t\t\theight: 100%;\n\n\t\t\t\ttd,\n\t\t\t\tth {\n\t\t\t\t\tposition: relative;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttable[data-number-column='true'] {\n\t\t\t\t.", " {\n\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\tborder-right: 1px solid\n\t\t\t\t\t\t", ";\n\t\t\t\t\twidth: ", "px;\n\t\t\t\t\ttext-align: center;\n\t\t\t\t\tcolor: ", ";\n\t\t\t\t\tfont-size: ", ";\n\t\t\t\t}\n\n\t\t\t\t.fixed .", " {\n\t\t\t\t\tborder-right: 0px none;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttr[data-header-row].fixed {\n\t\t\tposition: fixed !important;\n\t\t\tdisplay: flex;\n\t\t\toverflow: hidden;\n\t\t\tz-index: ", ";\n\n\t\t\tborder-right: 1px solid ", ";\n\t\t\tborder-bottom: 1px solid ", ";\n\n\t\t\t/* this is to compensate for the table border */\n\t\t\ttransform: translateX(-1px);\n\t\t}\n\n\t\t.sticky > th {\n\t\t\tz-index: ", ";\n\t\t\tposition: sticky !important;\n\t\t\ttop: 0;\n\t\t}\n\n\t\t/* Make the number column header sticky */\n\t\t.sticky > td {\n\t\t\tposition: sticky !important;\n\t\t\ttop: 0;\n\t\t}\n\n\t\t/* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n\t\t.sticky th,\n\t\t.sticky td {\n\t\t\tbox-shadow:\n\t\t\t\t0px 1px ", ",\n\t\t\t\t0px -0.5px ", ",\n\t\t\t\tinset -1px 0px ", ",\n\t\t\t\t0px -1px ", ";\n\t\t}\n\n\t\t/* this will remove jumpiness caused in Chrome for sticky headers */\n\t\t.fixed + tr {\n\t\t\tmin-height: 0px;\n\t\t}\n\n\t\t/*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n\t\t& .code-block {\n\t\t\tmax-width: 100%;\n\t\t\t/* -ms- properties are necessary until MS supports the latest version of the grid spec */\n\t\t\t/* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n\t\t\tdisplay: block;\n\t\t\t/* stylelint-enable */\n\n\t\t\tposition: relative;\n\t\t\tborder-radius: ", ";\n\n\t\t\t/*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n\t\t\tword-wrap: normal;\n\t\t}\n\n\t\t& .MediaGroup,\n\t\t& .code-block {\n\t\t\tmargin-top: ", ";\n\n\t\t\t&:first-child {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\t\t}\n\n\t\t", "\n\n\t\t", "\n\n ", ";\n\t\t& [data-layout-section] {\n\t\t\tmargin-top: ", ";\n\t\t\t& > div + div {\n\t\t\t\tmargin-left: ", ";\n\t\t\t}\n\n\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t& > div + div {\n\t\t\t\t\tmargin-left: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t& .MediaGroup,\n\t\t\t& .code-block {\n\t\t\t\tmargin-top: ", ";\n\n\t\t\t\t&:first-child {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t& li {\n\t\t\t> .code-block {\n\t\t\t\tmargin: ", " 0 0 0;\n\t\t\t}\n\t\t\t> .code-block:first-child {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\n\t\t\t> div:last-of-type.code-block {\n\t\t\t\tmargin-bottom: ", ";\n\t\t\t}\n\t\t}\n\n\t\t&:not([data-node-type='decisionList']) > li,\n // This prevents https://product-fabric.atlassian.net/browse/ED-20924\n &:not(.", ") > li {\n\t\t\t", "\n\t\t}\n\t"])), (0, _editorSharedStyles.editorFontSize)(themeProps), "var(--ds-text, ".concat(colors.N800, ")"), _consts.RendererCssClassName.DOCUMENT, fullPageStyles(wrapperProps, themeProps), fullWidthStyles(wrapperProps), _consts.RendererCssClassName.DOCUMENT, _mediaInline.mediaInlineImageStyles, headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), "var(--ds-link, ".concat(colors.B400, ")"), "var(--ds-link, ".concat(colors.B300, ")"), "var(--ds-link-pressed, ".concat(colors.B500, ")"), "var(--ds-text-subtlest, ".concat(colors.N200, ")"), telepointerStyles(colorMode), _styles.whitespaceSharedStyles, (0, _experiments.editorExperiment)('nested-dnd', true) ? _styles.blockquoteSharedStylesNew : _styles.blockquoteSharedStyles, (0, _styles.headingsSharedStyles)(), (0, _styles.ruleSharedStyles)(), _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.blockMarksSharedStyles, (0, _styles.codeMarkSharedStyles)(), _styles.shadowSharedStyle, _styles.dateSharedStyle, _styles.textColorStyles, (0, _styles.backgroundColorStyles)(), _styles.tasksAndDecisionsStyles, _styles.smartCardSharedStyles, getAnnotationStyles(wrapperProps), (0, _constants.fontFamily)(), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), "var(--ds-background-neutral, ".concat(colors.N30A, ")"), "var(--ds-border-radius-100, 3px)", "var(--ds-text, ".concat(colors.N800, ")"), "var(--ds-space-025, 2px)", "var(--ds-space-050, 4px)", "var(--ds-background-danger, ".concat(colors.R50, ")"), "var(--ds-text-danger, ".concat(colors.R500, ")"), "var(--ds-space-300, 24px)", _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, "var(--ds-space-100, 8px)", alignedHeadingAnchorStyle(wrapperProps), _styles.mediaSingleSharedStyle, _consts.RendererCssClassName.DOCUMENT, breakoutWidthStyle(), _consts.RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, _consts.RendererCssClassName.EXTENSION, _consts.RendererCssClassName.DOCUMENT, _consts.RendererCssClassName.EXTENSION, _editorSharedStyles.blockNodesVerticalMargin, _consts.RendererCssClassName.EXTENSION_CENTER_ALIGN, _styles.TableSharedCssClassName.TABLE_NODE_WRAPPER, _ui.shadowObserverClassNames.SHADOW_CONTAINER, _styles.TableSharedCssClassName.TABLE_NODE_WRAPPER, (0, _styles.tableSharedStyle)(), _consts.RendererCssClassName.DOCUMENT, _styles.TableSharedCssClassName.TABLE_CONTAINER, _ui.shadowClassNames.RIGHT_SHADOW, _ui.shadowClassNames.LEFT_SHADOW, _styles.tableMarginTop - 1, _styles.tableMarginTop, _editorSharedStyles.akEditorStickyHeaderZIndex, getShadowOverrides(), (0, _table.isStickyScrollbarEnabled)(appearance) ? stickyScrollbarStyles : '', _ui.shadowObserverClassNames.SENTINEL_LEFT, _ui.shadowObserverClassNames.SENTINEL_RIGHT, _styles.tableMarginTop, tableSortableColumnStyle(wrapperProps), _consts.RendererCssClassName.NUMBER_COLUMN, "var(--ds-background-neutral, ".concat(_editorSharedStyles.akEditorTableToolbar, ")"), "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorder, ")"), _editorSharedStyles.akEditorTableNumberColumnWidth, "var(--ds-text-subtlest, ".concat(colors.N200, ")"), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), _consts.RendererCssClassName.NUMBER_COLUMN, _editorSharedStyles.akEditorStickyHeaderZIndex, "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorder, ")"), "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorder, ")"), _editorSharedStyles.akEditorStickyHeaderZIndex, "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorder, ")"), "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorder, ")"), "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableToolbar, ")"), "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableToolbar, ")"), "var(--ds-border-radius-100, 3px)", _editorSharedStyles.blockNodesVerticalMargin, useGridRenderForCodeBlock(useBlockRenderForCodeBlock), (0, _lightWeightCodeBlock.getLightWeightCodeBlockStylesForRootRendererStyleSheet)(), _styles.columnLayoutSharedStyle, "var(--ds-space-250, 20px)", "var(--ds-space-400, 32px)", _editorSharedStyles.gridMediumMaxWidth, _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.blockNodesVerticalMargin, _styles.SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, _browser.browser.safari ? _styles.codeBlockInListSafariFix : '');
|
|
160
163
|
};
|
|
161
164
|
};
|
|
162
165
|
var useGridRenderForCodeBlock = function useGridRenderForCodeBlock(codeBlockRenderAsBlock) {
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
|
|
3
|
+
import { TableSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
4
|
+
export class TableStickyScrollbar {
|
|
5
|
+
constructor(wrapper) {
|
|
6
|
+
_defineProperty(this, "sentinels", {});
|
|
7
|
+
_defineProperty(this, "handleScroll", event => {
|
|
8
|
+
if (!this.stickyScrollbarContainerElement || !this.wrapper || event.target !== this.stickyScrollbarContainerElement) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
this.wrapper.scrollLeft = this.stickyScrollbarContainerElement.scrollLeft;
|
|
12
|
+
});
|
|
13
|
+
this.wrapper = wrapper;
|
|
14
|
+
this.init();
|
|
15
|
+
}
|
|
16
|
+
dispose() {
|
|
17
|
+
if (this.stickyScrollbarContainerElement) {
|
|
18
|
+
this.stickyScrollbarContainerElement.removeEventListener('scroll', this.handleScroll);
|
|
19
|
+
}
|
|
20
|
+
this.deleteIntersectionObserver();
|
|
21
|
+
}
|
|
22
|
+
scrollLeft(left) {
|
|
23
|
+
if (this.stickyScrollbarContainerElement) {
|
|
24
|
+
this.stickyScrollbarContainerElement.scrollLeft = left;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
init() {
|
|
28
|
+
var _this$wrapper$parentE;
|
|
29
|
+
if (!this.wrapper) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
this.stickyScrollbarContainerElement = (_this$wrapper$parentE = this.wrapper.parentElement) === null || _this$wrapper$parentE === void 0 ? void 0 : _this$wrapper$parentE.querySelector(`.${TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_CONTAINER}`);
|
|
33
|
+
if (this.stickyScrollbarContainerElement) {
|
|
34
|
+
this.stickyScrollbarContainerElement.addEventListener('scroll', this.handleScroll, {
|
|
35
|
+
passive: true
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
this.createIntersectionObserver();
|
|
39
|
+
}
|
|
40
|
+
createIntersectionObserver() {
|
|
41
|
+
var _this$wrapper, _this$wrapper$parentE2, _this$wrapper$parentE3, _this$wrapper2, _this$wrapper2$parent, _this$wrapper2$parent2;
|
|
42
|
+
this.rendererScrollableElement = findOverflowScrollParent(window.document.querySelector('.pm-table-container')) || window.document;
|
|
43
|
+
if (!this.rendererScrollableElement || !this.wrapper) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
this.intersectionObserver = new IntersectionObserver((entries, _) => {
|
|
47
|
+
if (!this.stickyScrollbarContainerElement) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
entries.forEach(entry => {
|
|
51
|
+
var _entry$rootBounds;
|
|
52
|
+
const target = entry.target;
|
|
53
|
+
// if the rootBounds has 0 height, e.g. confluence preview mode, we do nothing.
|
|
54
|
+
if (((_entry$rootBounds = entry.rootBounds) === null || _entry$rootBounds === void 0 ? void 0 : _entry$rootBounds.height) === 0) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (target.classList.contains(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM)) {
|
|
58
|
+
this.sentinelBottomCallback(entry);
|
|
59
|
+
}
|
|
60
|
+
if (target.classList.contains(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP)) {
|
|
61
|
+
this.sentinelTopCallback(entry);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}, {
|
|
65
|
+
root: this.rendererScrollableElement
|
|
66
|
+
});
|
|
67
|
+
this.sentinels.bottom = (_this$wrapper = this.wrapper) === null || _this$wrapper === void 0 ? void 0 : (_this$wrapper$parentE2 = _this$wrapper.parentElement) === null || _this$wrapper$parentE2 === void 0 ? void 0 : (_this$wrapper$parentE3 = _this$wrapper$parentE2.getElementsByClassName(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM)) === null || _this$wrapper$parentE3 === void 0 ? void 0 : _this$wrapper$parentE3.item(0);
|
|
68
|
+
this.sentinels.top = (_this$wrapper2 = this.wrapper) === null || _this$wrapper2 === void 0 ? void 0 : (_this$wrapper2$parent = _this$wrapper2.parentElement) === null || _this$wrapper2$parent === void 0 ? void 0 : (_this$wrapper2$parent2 = _this$wrapper2$parent.getElementsByClassName(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP)) === null || _this$wrapper2$parent2 === void 0 ? void 0 : _this$wrapper2$parent2.item(0);
|
|
69
|
+
[this.sentinels.bottom, this.sentinels.top].forEach(el => this.intersectionObserver.observe(el));
|
|
70
|
+
}
|
|
71
|
+
deleteIntersectionObserver() {
|
|
72
|
+
if (this.intersectionObserver) {
|
|
73
|
+
if (this.sentinels.bottom) {
|
|
74
|
+
this.intersectionObserver.unobserve(this.sentinels.bottom);
|
|
75
|
+
}
|
|
76
|
+
this.intersectionObserver.disconnect();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
sentinelBottomCallback(entry) {
|
|
80
|
+
var _entry$rootBounds2;
|
|
81
|
+
const sentinelIsAboveScrollArea = entry.boundingClientRect.top < (((_entry$rootBounds2 = entry.rootBounds) === null || _entry$rootBounds2 === void 0 ? void 0 : _entry$rootBounds2.top) || 0);
|
|
82
|
+
this.bottomSentinelState = sentinelIsAboveScrollArea ? 'above' : entry.isIntersecting ? 'visible' : 'below';
|
|
83
|
+
this.toggle();
|
|
84
|
+
}
|
|
85
|
+
sentinelTopCallback(entry) {
|
|
86
|
+
var _entry$rootBounds3;
|
|
87
|
+
const sentinelIsBelowScrollArea = (((_entry$rootBounds3 = entry.rootBounds) === null || _entry$rootBounds3 === void 0 ? void 0 : _entry$rootBounds3.bottom) || 0) < entry.boundingClientRect.top;
|
|
88
|
+
this.topSentinelState = sentinelIsBelowScrollArea ? 'below' : entry.isIntersecting ? 'visible' : 'above';
|
|
89
|
+
this.toggle();
|
|
90
|
+
}
|
|
91
|
+
toggle() {
|
|
92
|
+
if ((this.topSentinelState === 'visible' || this.topSentinelState === 'above') && this.bottomSentinelState === 'below') {
|
|
93
|
+
this.show();
|
|
94
|
+
} else {
|
|
95
|
+
this.hide();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
hide() {
|
|
99
|
+
if (this.stickyScrollbarContainerElement && this.stickyScrollbarContainerElement.style.display !== 'none') {
|
|
100
|
+
this.stickyScrollbarContainerElement.style.display = 'none';
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
show() {
|
|
104
|
+
if (this.stickyScrollbarContainerElement && this.stickyScrollbarContainerElement.style.display !== 'block') {
|
|
105
|
+
this.stickyScrollbarContainerElement.style.display = 'block';
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { tableCellBorderWidth, tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
3
3
|
import { akEditorTableNumberColumnWidth, akEditorTableLegacyCellMinWidth } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { useFeatureFlags } from '../../../use-feature-flags';
|
|
7
6
|
// we allow scaling down column widths by no more than 30%
|
|
8
7
|
// this intends to reduce unwanted scrolling in the Renderer in these scenarios:
|
|
@@ -126,7 +125,7 @@ const renderScaleDownColgroup = props => {
|
|
|
126
125
|
let scaleDownPercent = 0;
|
|
127
126
|
const isTableScalingWithFixedColumnWidthsOptionEnabled = isTableScalingEnabled && isTableFixedColumnWidthsOptionEnabled;
|
|
128
127
|
const isTableWidthFixed = isTableScalingWithFixedColumnWidthsOptionEnabled && ((_props$tableNode = props.tableNode) === null || _props$tableNode === void 0 ? void 0 : _props$tableNode.attrs.displayMode) === 'fixed';
|
|
129
|
-
const maxScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled
|
|
128
|
+
const maxScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled ? MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION : MAX_SCALING_PERCENT;
|
|
130
129
|
|
|
131
130
|
// fixes migration tables with zero-width columns
|
|
132
131
|
if (zeroWidthColumnsCount > 0) {
|
|
@@ -14,9 +14,13 @@ import { withSmartCardStorage } from '../../ui/SmartCardStorage';
|
|
|
14
14
|
import { StickyTable, tableStickyPadding, OverflowParent } from './table/sticky';
|
|
15
15
|
import { Table } from './table/table';
|
|
16
16
|
import { isCommentAppearance, isFullPageAppearance, isFullWidthAppearance, isFullWidthOrFullPageAppearance } from '../utils/appearance';
|
|
17
|
+
import { TableStickyScrollbar } from './TableStickyScrollbar';
|
|
17
18
|
export const isTableResizingEnabled = appearance => isFullWidthOrFullPageAppearance(appearance) || isCommentAppearance(appearance) && editorExperiment('support_table_in_comment', true, {
|
|
18
19
|
exposure: true
|
|
19
20
|
});
|
|
21
|
+
export const isStickyScrollbarEnabled = appearance => isFullWidthOrFullPageAppearance(appearance) && editorExperiment('platform_renderer_table_sticky_scrollbar', true, {
|
|
22
|
+
exposure: true
|
|
23
|
+
});
|
|
20
24
|
const orderChildren = (children, tableNode, smartCardStorage, tableOrderStatus) => {
|
|
21
25
|
if (!tableOrderStatus || tableOrderStatus.order === SortOrder.NO_ORDER) {
|
|
22
26
|
return children;
|
|
@@ -98,6 +102,7 @@ export class TableContainer extends React.Component {
|
|
|
98
102
|
});
|
|
99
103
|
_defineProperty(this, "tableRef", /*#__PURE__*/React.createRef());
|
|
100
104
|
_defineProperty(this, "stickyHeaderRef", /*#__PURE__*/React.createRef());
|
|
105
|
+
_defineProperty(this, "stickyScrollbarRef", /*#__PURE__*/React.createRef());
|
|
101
106
|
// used for sync scroll + copying wrapper width to sticky header
|
|
102
107
|
_defineProperty(this, "stickyWrapperRef", /*#__PURE__*/React.createRef());
|
|
103
108
|
_defineProperty(this, "wrapperRef", /*#__PURE__*/React.createRef());
|
|
@@ -130,6 +135,9 @@ export class TableContainer extends React.Component {
|
|
|
130
135
|
if (this.resizeObserver) {
|
|
131
136
|
this.resizeObserver.disconnect();
|
|
132
137
|
}
|
|
138
|
+
if (this.stickyScrollbar) {
|
|
139
|
+
this.stickyScrollbar.dispose();
|
|
140
|
+
}
|
|
133
141
|
});
|
|
134
142
|
_defineProperty(this, "getScrollTop", () => {
|
|
135
143
|
const {
|
|
@@ -172,6 +180,9 @@ export class TableContainer extends React.Component {
|
|
|
172
180
|
return;
|
|
173
181
|
}
|
|
174
182
|
this.stickyWrapperRef.current.scrollLeft = this.wrapperRef.current.scrollLeft;
|
|
183
|
+
if (this.stickyScrollbarRef.current) {
|
|
184
|
+
this.stickyScrollbarRef.current.scrollLeft = this.wrapperRef.current.scrollLeft;
|
|
185
|
+
}
|
|
175
186
|
});
|
|
176
187
|
_defineProperty(this, "grabFirstRowRef", children => {
|
|
177
188
|
return React.Children.map(children || false, (child, idx) => {
|
|
@@ -196,6 +207,9 @@ export class TableContainer extends React.Component {
|
|
|
196
207
|
this.overflowParent = OverflowParent.fromElement(this.tableRef.current);
|
|
197
208
|
this.overflowParent.addEventListener('scroll', this.onScroll);
|
|
198
209
|
}
|
|
210
|
+
if (this.wrapperRef.current && isStickyScrollbarEnabled(this.props.rendererAppearance)) {
|
|
211
|
+
this.stickyScrollbar = new TableStickyScrollbar(this.wrapperRef.current);
|
|
212
|
+
}
|
|
199
213
|
}
|
|
200
214
|
componentDidUpdate(prevProps, prevState) {
|
|
201
215
|
// toggling sticky headers visiblity
|
|
@@ -233,6 +247,7 @@ export class TableContainer extends React.Component {
|
|
|
233
247
|
}
|
|
234
248
|
}
|
|
235
249
|
render() {
|
|
250
|
+
var _this$tableRef$curren;
|
|
236
251
|
const {
|
|
237
252
|
isNumberColumnEnabled,
|
|
238
253
|
layout,
|
|
@@ -324,7 +339,11 @@ export class TableContainer extends React.Component {
|
|
|
324
339
|
left: left,
|
|
325
340
|
marginLeft: shouldCalculateLeftForAlignment && left !== undefined ? -left : undefined
|
|
326
341
|
}
|
|
327
|
-
},
|
|
342
|
+
}, isStickyScrollbarEnabled(this.props.rendererAppearance) && /*#__PURE__*/React.createElement("div", {
|
|
343
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
344
|
+
className: TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP,
|
|
345
|
+
"data-testid": "sticky-scrollbar-sentinel-top"
|
|
346
|
+
}), stickyHeaders && tableCanBeSticky(tableNode, children) && /*#__PURE__*/React.createElement(StickyTable, {
|
|
328
347
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
329
348
|
tableWidth: tableWidth,
|
|
330
349
|
layout: layout,
|
|
@@ -356,7 +375,30 @@ export class TableContainer extends React.Component {
|
|
|
356
375
|
isInsideOfBlockNode: isInsideOfBlockNode,
|
|
357
376
|
isinsideMultiBodiedExtension: isinsideMultiBodiedExtension,
|
|
358
377
|
allowTableResizing: allowTableResizing
|
|
359
|
-
}, this.grabFirstRowRef(children))))
|
|
378
|
+
}, this.grabFirstRowRef(children))), isStickyScrollbarEnabled(this.props.rendererAppearance) && /*#__PURE__*/React.createElement("div", {
|
|
379
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
380
|
+
className: TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_CONTAINER,
|
|
381
|
+
ref: this.stickyScrollbarRef,
|
|
382
|
+
style: {
|
|
383
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
384
|
+
height: "var(--ds-space-250, 20px)",
|
|
385
|
+
// MAX_BROWSER_SCROLLBAR_HEIGHT
|
|
386
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
387
|
+
display: 'block',
|
|
388
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
389
|
+
width: '100%'
|
|
390
|
+
}
|
|
391
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
392
|
+
style: {
|
|
393
|
+
width: (_this$tableRef$curren = this.tableRef.current) === null || _this$tableRef$curren === void 0 ? void 0 : _this$tableRef$curren.clientWidth,
|
|
394
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
395
|
+
height: '100%'
|
|
396
|
+
}
|
|
397
|
+
})), isStickyScrollbarEnabled(this.props.rendererAppearance) && /*#__PURE__*/React.createElement("div", {
|
|
398
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
399
|
+
className: TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM,
|
|
400
|
+
"data-testid": "sticky-scrollbar-sentinel-bottom"
|
|
401
|
+
})));
|
|
360
402
|
}
|
|
361
403
|
}
|
|
362
404
|
export class TableProcessor extends React.Component {
|
|
@@ -45,7 +45,7 @@ import { nodeToReact } from '../../react/nodes';
|
|
|
45
45
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
46
46
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
47
47
|
const packageName = "@atlaskit/renderer";
|
|
48
|
-
const packageVersion = "110.
|
|
48
|
+
const packageVersion = "110.2.1";
|
|
49
49
|
export const defaultNodeComponents = nodeToReact;
|
|
50
50
|
export class Renderer extends PureComponent {
|
|
51
51
|
constructor(props) {
|
|
@@ -18,7 +18,7 @@ import { N40A } from '@atlaskit/theme/colors';
|
|
|
18
18
|
import { RendererCssClassName } from '../../consts';
|
|
19
19
|
import { HeadingAnchorWrapperClassName } from '../../react/nodes/heading-anchor';
|
|
20
20
|
import { getLightWeightCodeBlockStylesForRootRendererStyleSheet } from '../../react/nodes/codeBlock/components/lightWeightCodeBlock';
|
|
21
|
-
import { isTableResizingEnabled } from '../../react/nodes/table';
|
|
21
|
+
import { isTableResizingEnabled, isStickyScrollbarEnabled } from '../../react/nodes/table';
|
|
22
22
|
import { SORTABLE_COLUMN_ICON_CLASSNAME } from '@atlaskit/editor-common/table';
|
|
23
23
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
24
24
|
export const FullPagePadding = 32;
|
|
@@ -403,6 +403,37 @@ function getAnnotationStyles({
|
|
|
403
403
|
}
|
|
404
404
|
});
|
|
405
405
|
}
|
|
406
|
+
const tableRowHeight = 44;
|
|
407
|
+
const stickyScrollbarStyles = `
|
|
408
|
+
position: relative;
|
|
409
|
+
flex-direction: column;
|
|
410
|
+
|
|
411
|
+
> .${TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_CONTAINER} {
|
|
412
|
+
width: 100%;
|
|
413
|
+
display: none;
|
|
414
|
+
overflow-x: auto;
|
|
415
|
+
position: sticky;
|
|
416
|
+
bottom: ${"var(--ds-space-0, 0px)"};
|
|
417
|
+
z-index: 1;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
> .${TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM},
|
|
421
|
+
> .${TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP} {
|
|
422
|
+
position: absolute;
|
|
423
|
+
width: 100%;
|
|
424
|
+
height: 1px;
|
|
425
|
+
margin-top: -1px;
|
|
426
|
+
// need this to avoid sentinel being focused via keyboard
|
|
427
|
+
// this still allows it to be detected by intersection observer
|
|
428
|
+
visibility: hidden;
|
|
429
|
+
}
|
|
430
|
+
> .${TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP} {
|
|
431
|
+
top: ${tableRowHeight * 3}px;
|
|
432
|
+
}
|
|
433
|
+
> .${TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM} {
|
|
434
|
+
bottom: ${"var(--ds-space-250, 20px)"}; // MAX_BROWSER_SCROLLBAR_HEIGHT = 20;
|
|
435
|
+
}
|
|
436
|
+
`;
|
|
406
437
|
export const rendererStyles = wrapperProps => theme => {
|
|
407
438
|
const {
|
|
408
439
|
colorMode
|
|
@@ -412,7 +443,8 @@ export const rendererStyles = wrapperProps => theme => {
|
|
|
412
443
|
theme
|
|
413
444
|
};
|
|
414
445
|
const {
|
|
415
|
-
useBlockRenderForCodeBlock
|
|
446
|
+
useBlockRenderForCodeBlock,
|
|
447
|
+
appearance
|
|
416
448
|
} = wrapperProps;
|
|
417
449
|
|
|
418
450
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/design-system/no-css-tagged-template-expression
|
|
@@ -614,6 +646,8 @@ export const rendererStyles = wrapperProps => theme => {
|
|
|
614
646
|
|
|
615
647
|
${getShadowOverrides()}
|
|
616
648
|
|
|
649
|
+
${isStickyScrollbarEnabled(appearance) ? stickyScrollbarStyles : ''}
|
|
650
|
+
|
|
617
651
|
&
|
|
618
652
|
.${shadowObserverClassNames.SENTINEL_LEFT},
|
|
619
653
|
&
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
+
import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
|
|
5
|
+
import { TableSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
6
|
+
export var TableStickyScrollbar = /*#__PURE__*/function () {
|
|
7
|
+
function TableStickyScrollbar(wrapper) {
|
|
8
|
+
var _this = this;
|
|
9
|
+
_classCallCheck(this, TableStickyScrollbar);
|
|
10
|
+
_defineProperty(this, "sentinels", {});
|
|
11
|
+
_defineProperty(this, "handleScroll", function (event) {
|
|
12
|
+
if (!_this.stickyScrollbarContainerElement || !_this.wrapper || event.target !== _this.stickyScrollbarContainerElement) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
_this.wrapper.scrollLeft = _this.stickyScrollbarContainerElement.scrollLeft;
|
|
16
|
+
});
|
|
17
|
+
this.wrapper = wrapper;
|
|
18
|
+
this.init();
|
|
19
|
+
}
|
|
20
|
+
_createClass(TableStickyScrollbar, [{
|
|
21
|
+
key: "dispose",
|
|
22
|
+
value: function dispose() {
|
|
23
|
+
if (this.stickyScrollbarContainerElement) {
|
|
24
|
+
this.stickyScrollbarContainerElement.removeEventListener('scroll', this.handleScroll);
|
|
25
|
+
}
|
|
26
|
+
this.deleteIntersectionObserver();
|
|
27
|
+
}
|
|
28
|
+
}, {
|
|
29
|
+
key: "scrollLeft",
|
|
30
|
+
value: function scrollLeft(left) {
|
|
31
|
+
if (this.stickyScrollbarContainerElement) {
|
|
32
|
+
this.stickyScrollbarContainerElement.scrollLeft = left;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}, {
|
|
36
|
+
key: "init",
|
|
37
|
+
value: function init() {
|
|
38
|
+
var _this$wrapper$parentE;
|
|
39
|
+
if (!this.wrapper) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
this.stickyScrollbarContainerElement = (_this$wrapper$parentE = this.wrapper.parentElement) === null || _this$wrapper$parentE === void 0 ? void 0 : _this$wrapper$parentE.querySelector(".".concat(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_CONTAINER));
|
|
43
|
+
if (this.stickyScrollbarContainerElement) {
|
|
44
|
+
this.stickyScrollbarContainerElement.addEventListener('scroll', this.handleScroll, {
|
|
45
|
+
passive: true
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
this.createIntersectionObserver();
|
|
49
|
+
}
|
|
50
|
+
}, {
|
|
51
|
+
key: "createIntersectionObserver",
|
|
52
|
+
value: function createIntersectionObserver() {
|
|
53
|
+
var _this2 = this,
|
|
54
|
+
_this$wrapper,
|
|
55
|
+
_this$wrapper2;
|
|
56
|
+
this.rendererScrollableElement = findOverflowScrollParent(window.document.querySelector('.pm-table-container')) || window.document;
|
|
57
|
+
if (!this.rendererScrollableElement || !this.wrapper) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
this.intersectionObserver = new IntersectionObserver(function (entries, _) {
|
|
61
|
+
if (!_this2.stickyScrollbarContainerElement) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
entries.forEach(function (entry) {
|
|
65
|
+
var _entry$rootBounds;
|
|
66
|
+
var target = entry.target;
|
|
67
|
+
// if the rootBounds has 0 height, e.g. confluence preview mode, we do nothing.
|
|
68
|
+
if (((_entry$rootBounds = entry.rootBounds) === null || _entry$rootBounds === void 0 ? void 0 : _entry$rootBounds.height) === 0) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (target.classList.contains(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM)) {
|
|
72
|
+
_this2.sentinelBottomCallback(entry);
|
|
73
|
+
}
|
|
74
|
+
if (target.classList.contains(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP)) {
|
|
75
|
+
_this2.sentinelTopCallback(entry);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}, {
|
|
79
|
+
root: this.rendererScrollableElement
|
|
80
|
+
});
|
|
81
|
+
this.sentinels.bottom = (_this$wrapper = this.wrapper) === null || _this$wrapper === void 0 || (_this$wrapper = _this$wrapper.parentElement) === null || _this$wrapper === void 0 || (_this$wrapper = _this$wrapper.getElementsByClassName(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM)) === null || _this$wrapper === void 0 ? void 0 : _this$wrapper.item(0);
|
|
82
|
+
this.sentinels.top = (_this$wrapper2 = this.wrapper) === null || _this$wrapper2 === void 0 || (_this$wrapper2 = _this$wrapper2.parentElement) === null || _this$wrapper2 === void 0 || (_this$wrapper2 = _this$wrapper2.getElementsByClassName(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP)) === null || _this$wrapper2 === void 0 ? void 0 : _this$wrapper2.item(0);
|
|
83
|
+
[this.sentinels.bottom, this.sentinels.top].forEach(function (el) {
|
|
84
|
+
return _this2.intersectionObserver.observe(el);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}, {
|
|
88
|
+
key: "deleteIntersectionObserver",
|
|
89
|
+
value: function deleteIntersectionObserver() {
|
|
90
|
+
if (this.intersectionObserver) {
|
|
91
|
+
if (this.sentinels.bottom) {
|
|
92
|
+
this.intersectionObserver.unobserve(this.sentinels.bottom);
|
|
93
|
+
}
|
|
94
|
+
this.intersectionObserver.disconnect();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}, {
|
|
98
|
+
key: "sentinelBottomCallback",
|
|
99
|
+
value: function sentinelBottomCallback(entry) {
|
|
100
|
+
var _entry$rootBounds2;
|
|
101
|
+
var sentinelIsAboveScrollArea = entry.boundingClientRect.top < (((_entry$rootBounds2 = entry.rootBounds) === null || _entry$rootBounds2 === void 0 ? void 0 : _entry$rootBounds2.top) || 0);
|
|
102
|
+
this.bottomSentinelState = sentinelIsAboveScrollArea ? 'above' : entry.isIntersecting ? 'visible' : 'below';
|
|
103
|
+
this.toggle();
|
|
104
|
+
}
|
|
105
|
+
}, {
|
|
106
|
+
key: "sentinelTopCallback",
|
|
107
|
+
value: function sentinelTopCallback(entry) {
|
|
108
|
+
var _entry$rootBounds3;
|
|
109
|
+
var sentinelIsBelowScrollArea = (((_entry$rootBounds3 = entry.rootBounds) === null || _entry$rootBounds3 === void 0 ? void 0 : _entry$rootBounds3.bottom) || 0) < entry.boundingClientRect.top;
|
|
110
|
+
this.topSentinelState = sentinelIsBelowScrollArea ? 'below' : entry.isIntersecting ? 'visible' : 'above';
|
|
111
|
+
this.toggle();
|
|
112
|
+
}
|
|
113
|
+
}, {
|
|
114
|
+
key: "toggle",
|
|
115
|
+
value: function toggle() {
|
|
116
|
+
if ((this.topSentinelState === 'visible' || this.topSentinelState === 'above') && this.bottomSentinelState === 'below') {
|
|
117
|
+
this.show();
|
|
118
|
+
} else {
|
|
119
|
+
this.hide();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}, {
|
|
123
|
+
key: "hide",
|
|
124
|
+
value: function hide() {
|
|
125
|
+
if (this.stickyScrollbarContainerElement && this.stickyScrollbarContainerElement.style.display !== 'none') {
|
|
126
|
+
this.stickyScrollbarContainerElement.style.display = 'none';
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}, {
|
|
130
|
+
key: "show",
|
|
131
|
+
value: function show() {
|
|
132
|
+
if (this.stickyScrollbarContainerElement && this.stickyScrollbarContainerElement.style.display !== 'block') {
|
|
133
|
+
this.stickyScrollbarContainerElement.style.display = 'block';
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}]);
|
|
137
|
+
return TableStickyScrollbar;
|
|
138
|
+
}();
|
|
@@ -5,7 +5,6 @@ import React from 'react';
|
|
|
5
5
|
import { tableCellBorderWidth, tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
6
6
|
import { akEditorTableNumberColumnWidth, akEditorTableLegacyCellMinWidth } from '@atlaskit/editor-shared-styles';
|
|
7
7
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { useFeatureFlags } from '../../../use-feature-flags';
|
|
10
9
|
// we allow scaling down column widths by no more than 30%
|
|
11
10
|
// this intends to reduce unwanted scrolling in the Renderer in these scenarios:
|
|
@@ -132,7 +131,7 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
|
132
131
|
var scaleDownPercent = 0;
|
|
133
132
|
var isTableScalingWithFixedColumnWidthsOptionEnabled = isTableScalingEnabled && isTableFixedColumnWidthsOptionEnabled;
|
|
134
133
|
var isTableWidthFixed = isTableScalingWithFixedColumnWidthsOptionEnabled && ((_props$tableNode = props.tableNode) === null || _props$tableNode === void 0 ? void 0 : _props$tableNode.attrs.displayMode) === 'fixed';
|
|
135
|
-
var maxScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled
|
|
134
|
+
var maxScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled ? MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION : MAX_SCALING_PERCENT;
|
|
136
135
|
|
|
137
136
|
// fixes migration tables with zero-width columns
|
|
138
137
|
if (zeroWidthColumnsCount > 0) {
|
|
@@ -25,11 +25,17 @@ import { withSmartCardStorage } from '../../ui/SmartCardStorage';
|
|
|
25
25
|
import { StickyTable, tableStickyPadding, OverflowParent } from './table/sticky';
|
|
26
26
|
import { Table } from './table/table';
|
|
27
27
|
import { isCommentAppearance, isFullPageAppearance, isFullWidthAppearance, isFullWidthOrFullPageAppearance } from '../utils/appearance';
|
|
28
|
+
import { TableStickyScrollbar } from './TableStickyScrollbar';
|
|
28
29
|
export var isTableResizingEnabled = function isTableResizingEnabled(appearance) {
|
|
29
30
|
return isFullWidthOrFullPageAppearance(appearance) || isCommentAppearance(appearance) && editorExperiment('support_table_in_comment', true, {
|
|
30
31
|
exposure: true
|
|
31
32
|
});
|
|
32
33
|
};
|
|
34
|
+
export var isStickyScrollbarEnabled = function isStickyScrollbarEnabled(appearance) {
|
|
35
|
+
return isFullWidthOrFullPageAppearance(appearance) && editorExperiment('platform_renderer_table_sticky_scrollbar', true, {
|
|
36
|
+
exposure: true
|
|
37
|
+
});
|
|
38
|
+
};
|
|
33
39
|
var orderChildren = function orderChildren(children, tableNode, smartCardStorage, tableOrderStatus) {
|
|
34
40
|
if (!tableOrderStatus || tableOrderStatus.order === SortOrder.NO_ORDER) {
|
|
35
41
|
return children;
|
|
@@ -129,6 +135,7 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
129
135
|
});
|
|
130
136
|
_defineProperty(_assertThisInitialized(_this), "tableRef", /*#__PURE__*/React.createRef());
|
|
131
137
|
_defineProperty(_assertThisInitialized(_this), "stickyHeaderRef", /*#__PURE__*/React.createRef());
|
|
138
|
+
_defineProperty(_assertThisInitialized(_this), "stickyScrollbarRef", /*#__PURE__*/React.createRef());
|
|
132
139
|
// used for sync scroll + copying wrapper width to sticky header
|
|
133
140
|
_defineProperty(_assertThisInitialized(_this), "stickyWrapperRef", /*#__PURE__*/React.createRef());
|
|
134
141
|
_defineProperty(_assertThisInitialized(_this), "wrapperRef", /*#__PURE__*/React.createRef());
|
|
@@ -170,6 +177,9 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
170
177
|
if (_this.resizeObserver) {
|
|
171
178
|
_this.resizeObserver.disconnect();
|
|
172
179
|
}
|
|
180
|
+
if (_this.stickyScrollbar) {
|
|
181
|
+
_this.stickyScrollbar.dispose();
|
|
182
|
+
}
|
|
173
183
|
});
|
|
174
184
|
_defineProperty(_assertThisInitialized(_this), "getScrollTop", function () {
|
|
175
185
|
var stickyHeaders = _this.props.stickyHeaders;
|
|
@@ -210,6 +220,9 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
210
220
|
return;
|
|
211
221
|
}
|
|
212
222
|
_this.stickyWrapperRef.current.scrollLeft = _this.wrapperRef.current.scrollLeft;
|
|
223
|
+
if (_this.stickyScrollbarRef.current) {
|
|
224
|
+
_this.stickyScrollbarRef.current.scrollLeft = _this.wrapperRef.current.scrollLeft;
|
|
225
|
+
}
|
|
213
226
|
});
|
|
214
227
|
_defineProperty(_assertThisInitialized(_this), "grabFirstRowRef", function (children) {
|
|
215
228
|
return React.Children.map(children || false, function (child, idx) {
|
|
@@ -237,6 +250,9 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
237
250
|
this.overflowParent = OverflowParent.fromElement(this.tableRef.current);
|
|
238
251
|
this.overflowParent.addEventListener('scroll', this.onScroll);
|
|
239
252
|
}
|
|
253
|
+
if (this.wrapperRef.current && isStickyScrollbarEnabled(this.props.rendererAppearance)) {
|
|
254
|
+
this.stickyScrollbar = new TableStickyScrollbar(this.wrapperRef.current);
|
|
255
|
+
}
|
|
240
256
|
}
|
|
241
257
|
}, {
|
|
242
258
|
key: "componentDidUpdate",
|
|
@@ -282,6 +298,7 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
282
298
|
}, {
|
|
283
299
|
key: "render",
|
|
284
300
|
value: function render() {
|
|
301
|
+
var _this$tableRef$curren;
|
|
285
302
|
var _this$props = this.props,
|
|
286
303
|
isNumberColumnEnabled = _this$props.isNumberColumnEnabled,
|
|
287
304
|
layout = _this$props.layout,
|
|
@@ -370,7 +387,11 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
370
387
|
left: left,
|
|
371
388
|
marginLeft: shouldCalculateLeftForAlignment && left !== undefined ? -left : undefined
|
|
372
389
|
}
|
|
373
|
-
},
|
|
390
|
+
}, isStickyScrollbarEnabled(this.props.rendererAppearance) && /*#__PURE__*/React.createElement("div", {
|
|
391
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
392
|
+
className: TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP,
|
|
393
|
+
"data-testid": "sticky-scrollbar-sentinel-top"
|
|
394
|
+
}), stickyHeaders && tableCanBeSticky(tableNode, children) && /*#__PURE__*/React.createElement(StickyTable, {
|
|
374
395
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
375
396
|
tableWidth: tableWidth,
|
|
376
397
|
layout: layout,
|
|
@@ -402,7 +423,30 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
402
423
|
isInsideOfBlockNode: isInsideOfBlockNode,
|
|
403
424
|
isinsideMultiBodiedExtension: isinsideMultiBodiedExtension,
|
|
404
425
|
allowTableResizing: allowTableResizing
|
|
405
|
-
}, this.grabFirstRowRef(children))))
|
|
426
|
+
}, this.grabFirstRowRef(children))), isStickyScrollbarEnabled(this.props.rendererAppearance) && /*#__PURE__*/React.createElement("div", {
|
|
427
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
428
|
+
className: TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_CONTAINER,
|
|
429
|
+
ref: this.stickyScrollbarRef,
|
|
430
|
+
style: {
|
|
431
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
432
|
+
height: "var(--ds-space-250, 20px)",
|
|
433
|
+
// MAX_BROWSER_SCROLLBAR_HEIGHT
|
|
434
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
435
|
+
display: 'block',
|
|
436
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
437
|
+
width: '100%'
|
|
438
|
+
}
|
|
439
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
440
|
+
style: {
|
|
441
|
+
width: (_this$tableRef$curren = this.tableRef.current) === null || _this$tableRef$curren === void 0 ? void 0 : _this$tableRef$curren.clientWidth,
|
|
442
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
443
|
+
height: '100%'
|
|
444
|
+
}
|
|
445
|
+
})), isStickyScrollbarEnabled(this.props.rendererAppearance) && /*#__PURE__*/React.createElement("div", {
|
|
446
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
447
|
+
className: TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM,
|
|
448
|
+
"data-testid": "sticky-scrollbar-sentinel-bottom"
|
|
449
|
+
})));
|
|
406
450
|
}
|
|
407
451
|
}]);
|
|
408
452
|
return TableContainer;
|
|
@@ -55,7 +55,7 @@ import { nodeToReact } from '../../react/nodes';
|
|
|
55
55
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
56
56
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
57
57
|
var packageName = "@atlaskit/renderer";
|
|
58
|
-
var packageVersion = "110.
|
|
58
|
+
var packageVersion = "110.2.1";
|
|
59
59
|
export var defaultNodeComponents = nodeToReact;
|
|
60
60
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
61
61
|
_inherits(Renderer, _PureComponent);
|
|
@@ -20,7 +20,7 @@ import { N40A } from '@atlaskit/theme/colors';
|
|
|
20
20
|
import { RendererCssClassName } from '../../consts';
|
|
21
21
|
import { HeadingAnchorWrapperClassName } from '../../react/nodes/heading-anchor';
|
|
22
22
|
import { getLightWeightCodeBlockStylesForRootRendererStyleSheet } from '../../react/nodes/codeBlock/components/lightWeightCodeBlock';
|
|
23
|
-
import { isTableResizingEnabled } from '../../react/nodes/table';
|
|
23
|
+
import { isTableResizingEnabled, isStickyScrollbarEnabled } from '../../react/nodes/table';
|
|
24
24
|
import { SORTABLE_COLUMN_ICON_CLASSNAME } from '@atlaskit/editor-common/table';
|
|
25
25
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
26
26
|
export var FullPagePadding = 32;
|
|
@@ -136,6 +136,8 @@ function getAnnotationStyles(_ref6) {
|
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
|
+
var tableRowHeight = 44;
|
|
140
|
+
var stickyScrollbarStyles = "\n\tposition: relative;\n\tflex-direction: column;\n\n\t> .".concat(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_CONTAINER, " {\n\t width: 100%;\n\t display: none;\n\t overflow-x: auto;\n\t position: sticky;\n\t bottom: ", "var(--ds-space-0, 0px)", ";\n\t z-index: 1;\n\t}\n\n\t> .").concat(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM, ",\n\t> .").concat(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP, " {\n\t position: absolute;\n\t width: 100%;\n\t height: 1px;\n\t margin-top: -1px;\n\t // need this to avoid sentinel being focused via keyboard\n\t // this still allows it to be detected by intersection observer\n\t visibility: hidden;\n\t }\n\t > .").concat(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP, " {\n\t top: ").concat(tableRowHeight * 3, "px;\n\t }\n\t > .").concat(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM, " {\n\t bottom: ", "var(--ds-space-250, 20px)", "; // MAX_BROWSER_SCROLLBAR_HEIGHT = 20;\n\t }\n ");
|
|
139
141
|
export var rendererStyles = function rendererStyles(wrapperProps) {
|
|
140
142
|
return function (theme) {
|
|
141
143
|
var _getGlobalTheme = getGlobalTheme(),
|
|
@@ -144,10 +146,11 @@ export var rendererStyles = function rendererStyles(wrapperProps) {
|
|
|
144
146
|
var themeProps = {
|
|
145
147
|
theme: theme
|
|
146
148
|
};
|
|
147
|
-
var useBlockRenderForCodeBlock = wrapperProps.useBlockRenderForCodeBlock
|
|
149
|
+
var useBlockRenderForCodeBlock = wrapperProps.useBlockRenderForCodeBlock,
|
|
150
|
+
appearance = wrapperProps.appearance;
|
|
148
151
|
|
|
149
152
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/design-system/no-css-tagged-template-expression
|
|
150
|
-
return css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n\t\tfont-size: ", "px;\n\t\tline-height: 1.5rem;\n\t\tcolor: ", ";\n\n\t\t.", "::after {\n\t\t\t// we add a clearfix after ak-renderer-document in order to\n\t\t\t// contain internal floats (such as media images that are \"wrap-left\")\n\t\t\t// to just the renderer (and not spill outside of it)\n\t\t\tcontent: '';\n\t\t\tvisibility: hidden;\n\t\t\tdisplay: block;\n\t\t\theight: 0;\n\t\t\tclear: both;\n\t\t}\n\n\t\t", "\n\t\t", "\n\n .", " {\n\t\t\t", "\n\t\t}\n\n\t\t& h1 {\n\t\t\t", "\n\t\t}\n\n\t\t& h2 {\n\t\t\t", "\n\t\t}\n\n\t\t& h3 {\n\t\t\t", "\n\t\t}\n\n\t\t& h4 {\n\t\t\t", "\n\t\t}\n\n\t\t& h5 {\n\t\t\t", "\n\t\t}\n\n\t\t& h6 {\n\t\t\t", "\n\t\t}\n\n\t\t& span.akActionMark {\n\t\t\tcolor: ", ";\n\t\t\ttext-decoration: none;\n\n\t\t\t&:hover {\n\t\t\t\tcolor: ", ";\n\t\t\t\ttext-decoration: underline;\n\t\t\t}\n\n\t\t\t&:active {\n\t\t\t\tcolor: ", ";\n\t\t\t}\n\t\t}\n\n\t\t& span.akActionMark {\n\t\t\tcursor: pointer;\n\t\t}\n\n\t\t& span[data-placeholder] {\n\t\t\tcolor: ", ";\n\t\t}\n\n\t\t", "\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", "\n\t\t", "\n\n\t\t& .UnknownBlock {\n\t\t\tfont-family: ", ";\n\t\t\tfont-size: ", ";\n\t\t\tfont-weight: 400;\n\t\t\twhite-space: pre-wrap;\n\t\t\tword-wrap: break-word;\n\t\t}\n\n\t\t& span.date-node {\n\t\t\tbackground: ", ";\n\t\t\tborder-radius: ", ";\n\t\t\tcolor: ", ";\n\t\t\tpadding: ", " ", ";\n\t\t\tmargin: 0 1px;\n\t\t\ttransition: background 0.3s;\n\t\t}\n\n\t\t& span.date-node-highlighted {\n\t\t\tbackground: ", ";\n\t\t\tcolor: ", ";\n\t\t}\n\n\t\t& .renderer-image {\n\t\t\tmax-width: 100%;\n\t\t\tdisplay: block;\n\t\t\tmargin: ", " 0;\n\t\t}\n\n\t\t.", ".rich-media-wrapped + .", ":not(.rich-media-wrapped) {\n\t\t\tclear: both;\n\t\t}\n\n\t\t& .code-block,\n\t\t& blockquote,\n\t\t& hr,\n\t\t& > div > div:not(.rich-media-wrapped),\n\t\t.", ".rich-media-wrapped + .rich-media-wrapped + *:not(.rich-media-wrapped),\n\t\t.", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n\t\t.", ".image-align-start,\n\t\t\t.", ".image-center,\n\t\t\t.", ".image-align-end {\n\t\t\tclear: both;\n\t\t}\n\n\t\t& .rich-media-wrapped {\n\t\t\t& + h1,\n\t\t\t& + h2,\n\t\t\t& + h3,\n\t\t\t& + h4,\n\t\t\t& + h5,\n\t\t\t& + h6 {\n\t\t\t\tmargin-top: ", ";\n\t\t\t}\n\t\t}\n\n\t\t", "\n\t\t/* plugin styles */\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n\t\t\tmargin-left: 0;\n\t\t\tmargin-right: 0;\n\t\t}\n\n\t\t/* Breakout for tables and extensions */\n\t\t.", " > {\n\t\t\t", "\n\n\t\t\t* .", " {\n\t\t\t\toverflow-x: auto;\n\t\t\t}\n\n\t\t\t& .", ":first-child {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\t.", " {\n\t\t\t\tmargin-top: ", ";\n\t\t\t}\n\n\t\t\t.", " {\n\t\t\t\tmargin-left: 50%;\n\t\t\t\ttransform: translateX(-50%);\n\t\t\t}\n\n\t\t\t.", " {\n\t\t\t\toverflow-x: auto;\n\t\t\t}\n\n\t\t\t.", " .", " {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\t\t}\n\n\t\t", "\n\n\t\t.", " .", " {\n\t\t\tz-index: 0;\n\t\t\ttransition: all 0.1s linear;\n\t\t\tdisplay: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n\t\t\t/** Shadow overrides */\n\t\t\t&.", "::after, &.", "::before {\n\t\t\t\ttop: ", "px;\n\t\t\t\theight: calc(100% - ", "px);\n\t\t\t\tz-index: ", ";\n\t\t\t}\n\n\t\t\t", "\n\n\t\t\t&\n .", ",\n &\n .", " {\n\t\t\t\theight: calc(100% - ", "px);\n\t\t\t}\n\n\t\t\t/**\n * A hack for making all the <th /> heights equal in case some have shorter\n * content than others.\n *\n * This is done to make sort buttons fill entire <th />.\n */\n\t\t\ttable {\n\t\t\t\theight: 1px; /* will be ignored */\n\t\t\t\t", ";\n\t\t\t\tmargin-left: 0;\n\t\t\t\tmargin-right: 0;\n\t\t\t}\n\n\t\t\ttable tr:first-of-type {\n\t\t\t\theight: 100%;\n\n\t\t\t\ttd,\n\t\t\t\tth {\n\t\t\t\t\tposition: relative;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttable[data-number-column='true'] {\n\t\t\t\t.", " {\n\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\tborder-right: 1px solid\n\t\t\t\t\t\t", ";\n\t\t\t\t\twidth: ", "px;\n\t\t\t\t\ttext-align: center;\n\t\t\t\t\tcolor: ", ";\n\t\t\t\t\tfont-size: ", ";\n\t\t\t\t}\n\n\t\t\t\t.fixed .", " {\n\t\t\t\t\tborder-right: 0px none;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttr[data-header-row].fixed {\n\t\t\tposition: fixed !important;\n\t\t\tdisplay: flex;\n\t\t\toverflow: hidden;\n\t\t\tz-index: ", ";\n\n\t\t\tborder-right: 1px solid ", ";\n\t\t\tborder-bottom: 1px solid ", ";\n\n\t\t\t/* this is to compensate for the table border */\n\t\t\ttransform: translateX(-1px);\n\t\t}\n\n\t\t.sticky > th {\n\t\t\tz-index: ", ";\n\t\t\tposition: sticky !important;\n\t\t\ttop: 0;\n\t\t}\n\n\t\t/* Make the number column header sticky */\n\t\t.sticky > td {\n\t\t\tposition: sticky !important;\n\t\t\ttop: 0;\n\t\t}\n\n\t\t/* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n\t\t.sticky th,\n\t\t.sticky td {\n\t\t\tbox-shadow:\n\t\t\t\t0px 1px ", ",\n\t\t\t\t0px -0.5px ", ",\n\t\t\t\tinset -1px 0px ", ",\n\t\t\t\t0px -1px ", ";\n\t\t}\n\n\t\t/* this will remove jumpiness caused in Chrome for sticky headers */\n\t\t.fixed + tr {\n\t\t\tmin-height: 0px;\n\t\t}\n\n\t\t/*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n\t\t& .code-block {\n\t\t\tmax-width: 100%;\n\t\t\t/* -ms- properties are necessary until MS supports the latest version of the grid spec */\n\t\t\t/* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n\t\t\tdisplay: block;\n\t\t\t/* stylelint-enable */\n\n\t\t\tposition: relative;\n\t\t\tborder-radius: ", ";\n\n\t\t\t/*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n\t\t\tword-wrap: normal;\n\t\t}\n\n\t\t& .MediaGroup,\n\t\t& .code-block {\n\t\t\tmargin-top: ", ";\n\n\t\t\t&:first-child {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\t\t}\n\n\t\t", "\n\n\t\t", "\n\n ", ";\n\t\t& [data-layout-section] {\n\t\t\tmargin-top: ", ";\n\t\t\t& > div + div {\n\t\t\t\tmargin-left: ", ";\n\t\t\t}\n\n\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t& > div + div {\n\t\t\t\t\tmargin-left: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t& .MediaGroup,\n\t\t\t& .code-block {\n\t\t\t\tmargin-top: ", ";\n\n\t\t\t\t&:first-child {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t& li {\n\t\t\t> .code-block {\n\t\t\t\tmargin: ", " 0 0 0;\n\t\t\t}\n\t\t\t> .code-block:first-child {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\n\t\t\t> div:last-of-type.code-block {\n\t\t\t\tmargin-bottom: ", ";\n\t\t\t}\n\t\t}\n\n\t\t&:not([data-node-type='decisionList']) > li,\n // This prevents https://product-fabric.atlassian.net/browse/ED-20924\n &:not(.", ") > li {\n\t\t\t", "\n\t\t}\n\t"])), editorFontSize(themeProps), "var(--ds-text, ".concat(colors.N800, ")"), RendererCssClassName.DOCUMENT, fullPageStyles(wrapperProps, themeProps), fullWidthStyles(wrapperProps), RendererCssClassName.DOCUMENT, mediaInlineImageStyles, headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), "var(--ds-link, ".concat(colors.B400, ")"), "var(--ds-link, ".concat(colors.B300, ")"), "var(--ds-link-pressed, ".concat(colors.B500, ")"), "var(--ds-text-subtlest, ".concat(colors.N200, ")"), telepointerStyles(colorMode), whitespaceSharedStyles, editorExperiment('nested-dnd', true) ? blockquoteSharedStylesNew : blockquoteSharedStyles, headingsSharedStyles(), ruleSharedStyles(), paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, codeMarkSharedStyles(), shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles(), tasksAndDecisionsStyles, smartCardSharedStyles, getAnnotationStyles(wrapperProps), fontFamily(), relativeFontSizeToBase16(fontSize()), "var(--ds-background-neutral, ".concat(colors.N30A, ")"), "var(--ds-border-radius-100, 3px)", "var(--ds-text, ".concat(colors.N800, ")"), "var(--ds-space-025, 2px)", "var(--ds-space-050, 4px)", "var(--ds-background-danger, ".concat(colors.R50, ")"), "var(--ds-text-danger, ".concat(colors.R500, ")"), "var(--ds-space-300, 24px)", richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, "var(--ds-space-100, 8px)", alignedHeadingAnchorStyle(wrapperProps), mediaSingleSharedStyle, RendererCssClassName.DOCUMENT, breakoutWidthStyle(), RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, RendererCssClassName.EXTENSION, RendererCssClassName.DOCUMENT, RendererCssClassName.EXTENSION, blockNodesVerticalMargin, RendererCssClassName.EXTENSION_CENTER_ALIGN, TableSharedCssClassName.TABLE_NODE_WRAPPER, shadowObserverClassNames.SHADOW_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, tableSharedStyle(), RendererCssClassName.DOCUMENT, TableSharedCssClassName.TABLE_CONTAINER, shadowClassNames.RIGHT_SHADOW, shadowClassNames.LEFT_SHADOW, tableMarginTop - 1, tableMarginTop, akEditorStickyHeaderZIndex, getShadowOverrides(), shadowObserverClassNames.SENTINEL_LEFT, shadowObserverClassNames.SENTINEL_RIGHT, tableMarginTop, tableSortableColumnStyle(wrapperProps), RendererCssClassName.NUMBER_COLUMN, "var(--ds-background-neutral, ".concat(akEditorTableToolbar, ")"), "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), akEditorTableNumberColumnWidth, "var(--ds-text-subtlest, ".concat(colors.N200, ")"), relativeFontSizeToBase16(fontSize()), RendererCssClassName.NUMBER_COLUMN, akEditorStickyHeaderZIndex, "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), akEditorStickyHeaderZIndex, "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableToolbar, ")"), "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableToolbar, ")"), "var(--ds-border-radius-100, 3px)", blockNodesVerticalMargin, useGridRenderForCodeBlock(useBlockRenderForCodeBlock), getLightWeightCodeBlockStylesForRootRendererStyleSheet(), columnLayoutSharedStyle, "var(--ds-space-250, 20px)", "var(--ds-space-400, 32px)", gridMediumMaxWidth, blockNodesVerticalMargin, blockNodesVerticalMargin, blockNodesVerticalMargin, SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, browser.safari ? codeBlockInListSafariFix : '');
|
|
153
|
+
return css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n\t\tfont-size: ", "px;\n\t\tline-height: 1.5rem;\n\t\tcolor: ", ";\n\n\t\t.", "::after {\n\t\t\t// we add a clearfix after ak-renderer-document in order to\n\t\t\t// contain internal floats (such as media images that are \"wrap-left\")\n\t\t\t// to just the renderer (and not spill outside of it)\n\t\t\tcontent: '';\n\t\t\tvisibility: hidden;\n\t\t\tdisplay: block;\n\t\t\theight: 0;\n\t\t\tclear: both;\n\t\t}\n\n\t\t", "\n\t\t", "\n\n .", " {\n\t\t\t", "\n\t\t}\n\n\t\t& h1 {\n\t\t\t", "\n\t\t}\n\n\t\t& h2 {\n\t\t\t", "\n\t\t}\n\n\t\t& h3 {\n\t\t\t", "\n\t\t}\n\n\t\t& h4 {\n\t\t\t", "\n\t\t}\n\n\t\t& h5 {\n\t\t\t", "\n\t\t}\n\n\t\t& h6 {\n\t\t\t", "\n\t\t}\n\n\t\t& span.akActionMark {\n\t\t\tcolor: ", ";\n\t\t\ttext-decoration: none;\n\n\t\t\t&:hover {\n\t\t\t\tcolor: ", ";\n\t\t\t\ttext-decoration: underline;\n\t\t\t}\n\n\t\t\t&:active {\n\t\t\t\tcolor: ", ";\n\t\t\t}\n\t\t}\n\n\t\t& span.akActionMark {\n\t\t\tcursor: pointer;\n\t\t}\n\n\t\t& span[data-placeholder] {\n\t\t\tcolor: ", ";\n\t\t}\n\n\t\t", "\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", "\n\t\t", "\n\n\t\t& .UnknownBlock {\n\t\t\tfont-family: ", ";\n\t\t\tfont-size: ", ";\n\t\t\tfont-weight: 400;\n\t\t\twhite-space: pre-wrap;\n\t\t\tword-wrap: break-word;\n\t\t}\n\n\t\t& span.date-node {\n\t\t\tbackground: ", ";\n\t\t\tborder-radius: ", ";\n\t\t\tcolor: ", ";\n\t\t\tpadding: ", " ", ";\n\t\t\tmargin: 0 1px;\n\t\t\ttransition: background 0.3s;\n\t\t}\n\n\t\t& span.date-node-highlighted {\n\t\t\tbackground: ", ";\n\t\t\tcolor: ", ";\n\t\t}\n\n\t\t& .renderer-image {\n\t\t\tmax-width: 100%;\n\t\t\tdisplay: block;\n\t\t\tmargin: ", " 0;\n\t\t}\n\n\t\t.", ".rich-media-wrapped + .", ":not(.rich-media-wrapped) {\n\t\t\tclear: both;\n\t\t}\n\n\t\t& .code-block,\n\t\t& blockquote,\n\t\t& hr,\n\t\t& > div > div:not(.rich-media-wrapped),\n\t\t.", ".rich-media-wrapped + .rich-media-wrapped + *:not(.rich-media-wrapped),\n\t\t.", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n\t\t.", ".image-align-start,\n\t\t\t.", ".image-center,\n\t\t\t.", ".image-align-end {\n\t\t\tclear: both;\n\t\t}\n\n\t\t& .rich-media-wrapped {\n\t\t\t& + h1,\n\t\t\t& + h2,\n\t\t\t& + h3,\n\t\t\t& + h4,\n\t\t\t& + h5,\n\t\t\t& + h6 {\n\t\t\t\tmargin-top: ", ";\n\t\t\t}\n\t\t}\n\n\t\t", "\n\t\t/* plugin styles */\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n\t\t\tmargin-left: 0;\n\t\t\tmargin-right: 0;\n\t\t}\n\n\t\t/* Breakout for tables and extensions */\n\t\t.", " > {\n\t\t\t", "\n\n\t\t\t* .", " {\n\t\t\t\toverflow-x: auto;\n\t\t\t}\n\n\t\t\t& .", ":first-child {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\t.", " {\n\t\t\t\tmargin-top: ", ";\n\t\t\t}\n\n\t\t\t.", " {\n\t\t\t\tmargin-left: 50%;\n\t\t\t\ttransform: translateX(-50%);\n\t\t\t}\n\n\t\t\t.", " {\n\t\t\t\toverflow-x: auto;\n\t\t\t}\n\n\t\t\t.", " .", " {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\t\t}\n\n\t\t", "\n\n\t\t.", " .", " {\n\t\t\tz-index: 0;\n\t\t\ttransition: all 0.1s linear;\n\t\t\tdisplay: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n\t\t\t/** Shadow overrides */\n\t\t\t&.", "::after, &.", "::before {\n\t\t\t\ttop: ", "px;\n\t\t\t\theight: calc(100% - ", "px);\n\t\t\t\tz-index: ", ";\n\t\t\t}\n\n\t\t\t", "\n\n\t\t\t", "\n\n\t\t\t&\n .", ",\n &\n .", " {\n\t\t\t\theight: calc(100% - ", "px);\n\t\t\t}\n\n\t\t\t/**\n * A hack for making all the <th /> heights equal in case some have shorter\n * content than others.\n *\n * This is done to make sort buttons fill entire <th />.\n */\n\t\t\ttable {\n\t\t\t\theight: 1px; /* will be ignored */\n\t\t\t\t", ";\n\t\t\t\tmargin-left: 0;\n\t\t\t\tmargin-right: 0;\n\t\t\t}\n\n\t\t\ttable tr:first-of-type {\n\t\t\t\theight: 100%;\n\n\t\t\t\ttd,\n\t\t\t\tth {\n\t\t\t\t\tposition: relative;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttable[data-number-column='true'] {\n\t\t\t\t.", " {\n\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\tborder-right: 1px solid\n\t\t\t\t\t\t", ";\n\t\t\t\t\twidth: ", "px;\n\t\t\t\t\ttext-align: center;\n\t\t\t\t\tcolor: ", ";\n\t\t\t\t\tfont-size: ", ";\n\t\t\t\t}\n\n\t\t\t\t.fixed .", " {\n\t\t\t\t\tborder-right: 0px none;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttr[data-header-row].fixed {\n\t\t\tposition: fixed !important;\n\t\t\tdisplay: flex;\n\t\t\toverflow: hidden;\n\t\t\tz-index: ", ";\n\n\t\t\tborder-right: 1px solid ", ";\n\t\t\tborder-bottom: 1px solid ", ";\n\n\t\t\t/* this is to compensate for the table border */\n\t\t\ttransform: translateX(-1px);\n\t\t}\n\n\t\t.sticky > th {\n\t\t\tz-index: ", ";\n\t\t\tposition: sticky !important;\n\t\t\ttop: 0;\n\t\t}\n\n\t\t/* Make the number column header sticky */\n\t\t.sticky > td {\n\t\t\tposition: sticky !important;\n\t\t\ttop: 0;\n\t\t}\n\n\t\t/* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n\t\t.sticky th,\n\t\t.sticky td {\n\t\t\tbox-shadow:\n\t\t\t\t0px 1px ", ",\n\t\t\t\t0px -0.5px ", ",\n\t\t\t\tinset -1px 0px ", ",\n\t\t\t\t0px -1px ", ";\n\t\t}\n\n\t\t/* this will remove jumpiness caused in Chrome for sticky headers */\n\t\t.fixed + tr {\n\t\t\tmin-height: 0px;\n\t\t}\n\n\t\t/*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n\t\t& .code-block {\n\t\t\tmax-width: 100%;\n\t\t\t/* -ms- properties are necessary until MS supports the latest version of the grid spec */\n\t\t\t/* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n\t\t\tdisplay: block;\n\t\t\t/* stylelint-enable */\n\n\t\t\tposition: relative;\n\t\t\tborder-radius: ", ";\n\n\t\t\t/*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n\t\t\tword-wrap: normal;\n\t\t}\n\n\t\t& .MediaGroup,\n\t\t& .code-block {\n\t\t\tmargin-top: ", ";\n\n\t\t\t&:first-child {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\t\t}\n\n\t\t", "\n\n\t\t", "\n\n ", ";\n\t\t& [data-layout-section] {\n\t\t\tmargin-top: ", ";\n\t\t\t& > div + div {\n\t\t\t\tmargin-left: ", ";\n\t\t\t}\n\n\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t& > div + div {\n\t\t\t\t\tmargin-left: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t& .MediaGroup,\n\t\t\t& .code-block {\n\t\t\t\tmargin-top: ", ";\n\n\t\t\t\t&:first-child {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t& li {\n\t\t\t> .code-block {\n\t\t\t\tmargin: ", " 0 0 0;\n\t\t\t}\n\t\t\t> .code-block:first-child {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\n\t\t\t> div:last-of-type.code-block {\n\t\t\t\tmargin-bottom: ", ";\n\t\t\t}\n\t\t}\n\n\t\t&:not([data-node-type='decisionList']) > li,\n // This prevents https://product-fabric.atlassian.net/browse/ED-20924\n &:not(.", ") > li {\n\t\t\t", "\n\t\t}\n\t"])), editorFontSize(themeProps), "var(--ds-text, ".concat(colors.N800, ")"), RendererCssClassName.DOCUMENT, fullPageStyles(wrapperProps, themeProps), fullWidthStyles(wrapperProps), RendererCssClassName.DOCUMENT, mediaInlineImageStyles, headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), "var(--ds-link, ".concat(colors.B400, ")"), "var(--ds-link, ".concat(colors.B300, ")"), "var(--ds-link-pressed, ".concat(colors.B500, ")"), "var(--ds-text-subtlest, ".concat(colors.N200, ")"), telepointerStyles(colorMode), whitespaceSharedStyles, editorExperiment('nested-dnd', true) ? blockquoteSharedStylesNew : blockquoteSharedStyles, headingsSharedStyles(), ruleSharedStyles(), paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, codeMarkSharedStyles(), shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles(), tasksAndDecisionsStyles, smartCardSharedStyles, getAnnotationStyles(wrapperProps), fontFamily(), relativeFontSizeToBase16(fontSize()), "var(--ds-background-neutral, ".concat(colors.N30A, ")"), "var(--ds-border-radius-100, 3px)", "var(--ds-text, ".concat(colors.N800, ")"), "var(--ds-space-025, 2px)", "var(--ds-space-050, 4px)", "var(--ds-background-danger, ".concat(colors.R50, ")"), "var(--ds-text-danger, ".concat(colors.R500, ")"), "var(--ds-space-300, 24px)", richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, "var(--ds-space-100, 8px)", alignedHeadingAnchorStyle(wrapperProps), mediaSingleSharedStyle, RendererCssClassName.DOCUMENT, breakoutWidthStyle(), RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, RendererCssClassName.EXTENSION, RendererCssClassName.DOCUMENT, RendererCssClassName.EXTENSION, blockNodesVerticalMargin, RendererCssClassName.EXTENSION_CENTER_ALIGN, TableSharedCssClassName.TABLE_NODE_WRAPPER, shadowObserverClassNames.SHADOW_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, tableSharedStyle(), RendererCssClassName.DOCUMENT, TableSharedCssClassName.TABLE_CONTAINER, shadowClassNames.RIGHT_SHADOW, shadowClassNames.LEFT_SHADOW, tableMarginTop - 1, tableMarginTop, akEditorStickyHeaderZIndex, getShadowOverrides(), isStickyScrollbarEnabled(appearance) ? stickyScrollbarStyles : '', shadowObserverClassNames.SENTINEL_LEFT, shadowObserverClassNames.SENTINEL_RIGHT, tableMarginTop, tableSortableColumnStyle(wrapperProps), RendererCssClassName.NUMBER_COLUMN, "var(--ds-background-neutral, ".concat(akEditorTableToolbar, ")"), "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), akEditorTableNumberColumnWidth, "var(--ds-text-subtlest, ".concat(colors.N200, ")"), relativeFontSizeToBase16(fontSize()), RendererCssClassName.NUMBER_COLUMN, akEditorStickyHeaderZIndex, "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), akEditorStickyHeaderZIndex, "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableToolbar, ")"), "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableToolbar, ")"), "var(--ds-border-radius-100, 3px)", blockNodesVerticalMargin, useGridRenderForCodeBlock(useBlockRenderForCodeBlock), getLightWeightCodeBlockStylesForRootRendererStyleSheet(), columnLayoutSharedStyle, "var(--ds-space-250, 20px)", "var(--ds-space-400, 32px)", gridMediumMaxWidth, blockNodesVerticalMargin, blockNodesVerticalMargin, blockNodesVerticalMargin, SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, browser.safari ? codeBlockInListSafariFix : '');
|
|
151
154
|
};
|
|
152
155
|
};
|
|
153
156
|
var useGridRenderForCodeBlock = function useGridRenderForCodeBlock(codeBlockRenderAsBlock) {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare class TableStickyScrollbar {
|
|
2
|
+
private wrapper;
|
|
3
|
+
private rendererScrollableElement?;
|
|
4
|
+
private intersectionObserver?;
|
|
5
|
+
private stickyScrollbarContainerElement?;
|
|
6
|
+
private sentinels;
|
|
7
|
+
private topSentinelState?;
|
|
8
|
+
private bottomSentinelState?;
|
|
9
|
+
constructor(wrapper: HTMLDivElement);
|
|
10
|
+
dispose(): void;
|
|
11
|
+
scrollLeft(left: number): void;
|
|
12
|
+
private init;
|
|
13
|
+
private createIntersectionObserver;
|
|
14
|
+
private deleteIntersectionObserver;
|
|
15
|
+
private sentinelBottomCallback;
|
|
16
|
+
private sentinelTopCallback;
|
|
17
|
+
private toggle;
|
|
18
|
+
private hide;
|
|
19
|
+
private show;
|
|
20
|
+
private handleScroll;
|
|
21
|
+
}
|
|
@@ -7,7 +7,9 @@ import type { WithSmartCardStorageProps } from '../../ui/SmartCardStorage';
|
|
|
7
7
|
import type { StickyMode } from './table/sticky';
|
|
8
8
|
import { OverflowParent } from './table/sticky';
|
|
9
9
|
import type { SharedTableProps } from './table/types';
|
|
10
|
+
import { TableStickyScrollbar } from './TableStickyScrollbar';
|
|
10
11
|
export declare const isTableResizingEnabled: (appearance: RendererAppearance) => boolean;
|
|
12
|
+
export declare const isStickyScrollbarEnabled: (appearance: RendererAppearance) => boolean;
|
|
11
13
|
type TableProps = SharedTableProps & {
|
|
12
14
|
children: React.ReactElement<any> | Array<React.ReactElement<any>>;
|
|
13
15
|
tableNode?: PMNode;
|
|
@@ -30,8 +32,10 @@ export declare class TableContainer extends React.Component<TableProps & Overflo
|
|
|
30
32
|
state: TableState;
|
|
31
33
|
tableRef: React.RefObject<HTMLTableElement>;
|
|
32
34
|
stickyHeaderRef: React.RefObject<HTMLElement>;
|
|
35
|
+
stickyScrollbarRef: React.RefObject<HTMLDivElement>;
|
|
33
36
|
stickyWrapperRef: React.RefObject<HTMLDivElement>;
|
|
34
37
|
wrapperRef: React.RefObject<HTMLDivElement>;
|
|
38
|
+
stickyScrollbar?: TableStickyScrollbar;
|
|
35
39
|
nextFrame: number | undefined;
|
|
36
40
|
overflowParent: OverflowParent | null;
|
|
37
41
|
private resizeObserver;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare class TableStickyScrollbar {
|
|
2
|
+
private wrapper;
|
|
3
|
+
private rendererScrollableElement?;
|
|
4
|
+
private intersectionObserver?;
|
|
5
|
+
private stickyScrollbarContainerElement?;
|
|
6
|
+
private sentinels;
|
|
7
|
+
private topSentinelState?;
|
|
8
|
+
private bottomSentinelState?;
|
|
9
|
+
constructor(wrapper: HTMLDivElement);
|
|
10
|
+
dispose(): void;
|
|
11
|
+
scrollLeft(left: number): void;
|
|
12
|
+
private init;
|
|
13
|
+
private createIntersectionObserver;
|
|
14
|
+
private deleteIntersectionObserver;
|
|
15
|
+
private sentinelBottomCallback;
|
|
16
|
+
private sentinelTopCallback;
|
|
17
|
+
private toggle;
|
|
18
|
+
private hide;
|
|
19
|
+
private show;
|
|
20
|
+
private handleScroll;
|
|
21
|
+
}
|
|
@@ -7,7 +7,9 @@ import type { WithSmartCardStorageProps } from '../../ui/SmartCardStorage';
|
|
|
7
7
|
import type { StickyMode } from './table/sticky';
|
|
8
8
|
import { OverflowParent } from './table/sticky';
|
|
9
9
|
import type { SharedTableProps } from './table/types';
|
|
10
|
+
import { TableStickyScrollbar } from './TableStickyScrollbar';
|
|
10
11
|
export declare const isTableResizingEnabled: (appearance: RendererAppearance) => boolean;
|
|
12
|
+
export declare const isStickyScrollbarEnabled: (appearance: RendererAppearance) => boolean;
|
|
11
13
|
type TableProps = SharedTableProps & {
|
|
12
14
|
children: React.ReactElement<any> | Array<React.ReactElement<any>>;
|
|
13
15
|
tableNode?: PMNode;
|
|
@@ -30,8 +32,10 @@ export declare class TableContainer extends React.Component<TableProps & Overflo
|
|
|
30
32
|
state: TableState;
|
|
31
33
|
tableRef: React.RefObject<HTMLTableElement>;
|
|
32
34
|
stickyHeaderRef: React.RefObject<HTMLElement>;
|
|
35
|
+
stickyScrollbarRef: React.RefObject<HTMLDivElement>;
|
|
33
36
|
stickyWrapperRef: React.RefObject<HTMLDivElement>;
|
|
34
37
|
wrapperRef: React.RefObject<HTMLDivElement>;
|
|
38
|
+
stickyScrollbar?: TableStickyScrollbar;
|
|
35
39
|
nextFrame: number | undefined;
|
|
36
40
|
overflowParent: OverflowParent | null;
|
|
37
41
|
private resizeObserver;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "110.
|
|
3
|
+
"version": "110.2.1",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@atlaskit/analytics-next": "^10.1.0",
|
|
30
30
|
"@atlaskit/button": "^20.1.0",
|
|
31
31
|
"@atlaskit/code": "^15.6.0",
|
|
32
|
-
"@atlaskit/editor-common": "^89.
|
|
32
|
+
"@atlaskit/editor-common": "^89.3.0",
|
|
33
33
|
"@atlaskit/editor-json-transformer": "^8.18.0",
|
|
34
34
|
"@atlaskit/editor-palette": "1.6.0",
|
|
35
35
|
"@atlaskit/editor-prosemirror": "6.0.0",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"@atlaskit/feature-gate-js-client": "^4.19.0",
|
|
39
39
|
"@atlaskit/icon": "^22.18.0",
|
|
40
40
|
"@atlaskit/link-datasource": "^3.0.0",
|
|
41
|
-
"@atlaskit/media-card": "^78.
|
|
41
|
+
"@atlaskit/media-card": "^78.5.0",
|
|
42
42
|
"@atlaskit/media-client": "^28.0.0",
|
|
43
43
|
"@atlaskit/media-client-react": "^2.2.0",
|
|
44
44
|
"@atlaskit/media-common": "^11.4.0",
|
|
45
|
-
"@atlaskit/media-filmstrip": "^47.
|
|
46
|
-
"@atlaskit/media-ui": "^25.
|
|
47
|
-
"@atlaskit/media-viewer": "^48.
|
|
45
|
+
"@atlaskit/media-filmstrip": "^47.3.0",
|
|
46
|
+
"@atlaskit/media-ui": "^25.14.0",
|
|
47
|
+
"@atlaskit/media-viewer": "^48.10.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
49
49
|
"@atlaskit/smart-card": "^28.1.0",
|
|
50
50
|
"@atlaskit/status": "^1.4.0",
|
|
@@ -71,14 +71,14 @@
|
|
|
71
71
|
"@af/integration-testing": "*",
|
|
72
72
|
"@af/visual-regression": "*",
|
|
73
73
|
"@atlaskit/analytics-gas-types": "^5.1.0",
|
|
74
|
-
"@atlaskit/css-reset": "^6.
|
|
74
|
+
"@atlaskit/css-reset": "^6.11.0",
|
|
75
75
|
"@atlaskit/editor-test-helpers": "^18.33.0",
|
|
76
76
|
"@atlaskit/link-provider": "^1.16.0",
|
|
77
77
|
"@atlaskit/link-test-helpers": "^7.5.0",
|
|
78
78
|
"@atlaskit/linking-common": "^5.11.0",
|
|
79
79
|
"@atlaskit/media-core": "^34.3.0",
|
|
80
80
|
"@atlaskit/media-integration-test-helpers": "^3.1.0",
|
|
81
|
-
"@atlaskit/media-test-helpers": "^34.
|
|
81
|
+
"@atlaskit/media-test-helpers": "^34.4.0",
|
|
82
82
|
"@atlaskit/mention": "^23.2.0",
|
|
83
83
|
"@atlaskit/navigation-next": "^9.0.0",
|
|
84
84
|
"@atlaskit/util-data-test": "^17.9.0",
|
|
@@ -131,9 +131,6 @@
|
|
|
131
131
|
"editor_inline_comments_on_inline_nodes": {
|
|
132
132
|
"type": "boolean"
|
|
133
133
|
},
|
|
134
|
-
"platform.editor.table.use-increased-scaling-percent": {
|
|
135
|
-
"type": "boolean"
|
|
136
|
-
},
|
|
137
134
|
"annotations_align_editor_and_renderer_styles": {
|
|
138
135
|
"type": "boolean"
|
|
139
136
|
},
|