@atlaskit/renderer 108.11.1 → 108.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/react/nodes/table/table.js +1 -0
- package/dist/cjs/react/nodes/table.js +47 -11
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/react/nodes/table/table.js +1 -0
- package/dist/es2019/react/nodes/table.js +35 -9
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/react/nodes/table/table.js +1 -0
- package/dist/esm/react/nodes/table.js +47 -11
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/react/nodes/table/sticky.d.ts +3 -3
- package/dist/types/react/nodes/table.d.ts +10 -6
- package/dist/types/ui/Renderer/index.d.ts +1 -1
- package/dist/types-ts4.5/react/nodes/table/sticky.d.ts +3 -3
- package/dist/types-ts4.5/react/nodes/table.d.ts +10 -6
- package/dist/types-ts4.5/ui/Renderer/index.d.ts +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 108.11.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 108.11.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`32f9d24dcdb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/32f9d24dcdb) - Improve table renderer resizing performance.
|
|
14
|
+
|
|
3
15
|
## 108.11.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -17,6 +17,7 @@ var Table = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
17
17
|
tableNode = _ref.tableNode,
|
|
18
18
|
rendererAppearance = _ref.rendererAppearance;
|
|
19
19
|
return /*#__PURE__*/_react.default.createElement("table", {
|
|
20
|
+
"data-testid": "renderer-table",
|
|
20
21
|
"data-number-column": isNumberColumnEnabled,
|
|
21
22
|
ref: innerRef
|
|
22
23
|
}, /*#__PURE__*/_react.default.createElement(_colgroup.Colgroup, {
|
|
@@ -27,6 +27,9 @@ 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
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
31
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
32
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
30
33
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
31
34
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
32
35
|
var isTableResizingEnabled = function isTableResizingEnabled(appearance) {
|
|
@@ -126,7 +129,9 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
126
129
|
}
|
|
127
130
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
128
131
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
|
129
|
-
stickyMode: 'none'
|
|
132
|
+
stickyMode: 'none',
|
|
133
|
+
wrapperWidth: 0,
|
|
134
|
+
headerRowHeight: 0
|
|
130
135
|
});
|
|
131
136
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "tableRef", /*#__PURE__*/_react.default.createRef());
|
|
132
137
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "stickyHeaderRef", /*#__PURE__*/_react.default.createRef());
|
|
@@ -134,6 +139,33 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
134
139
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "stickyWrapperRef", /*#__PURE__*/_react.default.createRef());
|
|
135
140
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "wrapperRef", /*#__PURE__*/_react.default.createRef());
|
|
136
141
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "overflowParent", null);
|
|
142
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "resizeObserver", null);
|
|
143
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "applyResizerChange", function (entries) {
|
|
144
|
+
var wrapperWidth = _this.state.wrapperWidth;
|
|
145
|
+
var headerRowHeight = _this.state.headerRowHeight;
|
|
146
|
+
var _iterator = _createForOfIteratorHelper(entries),
|
|
147
|
+
_step;
|
|
148
|
+
try {
|
|
149
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
150
|
+
var entry = _step.value;
|
|
151
|
+
if (entry.target === _this.wrapperRef.current) {
|
|
152
|
+
wrapperWidth = entry.contentRect.width;
|
|
153
|
+
} else if (entry.target === _this.stickyHeaderRef.current) {
|
|
154
|
+
headerRowHeight = Math.round(entry.contentRect.height);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
} catch (err) {
|
|
158
|
+
_iterator.e(err);
|
|
159
|
+
} finally {
|
|
160
|
+
_iterator.f();
|
|
161
|
+
}
|
|
162
|
+
if (headerRowHeight !== _this.state.headerRowHeight || wrapperWidth !== _this.state.wrapperWidth) {
|
|
163
|
+
_this.setState({
|
|
164
|
+
wrapperWidth: wrapperWidth,
|
|
165
|
+
headerRowHeight: headerRowHeight
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
});
|
|
137
169
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "componentWillUnmount", function () {
|
|
138
170
|
if (_this.overflowParent) {
|
|
139
171
|
_this.overflowParent.removeEventListener('scroll', _this.onScroll);
|
|
@@ -141,6 +173,9 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
141
173
|
if (_this.nextFrame) {
|
|
142
174
|
cancelAnimationFrame(_this.nextFrame);
|
|
143
175
|
}
|
|
176
|
+
if (_this.resizeObserver) {
|
|
177
|
+
_this.resizeObserver.disconnect();
|
|
178
|
+
}
|
|
144
179
|
});
|
|
145
180
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getScrollTop", function () {
|
|
146
181
|
var stickyHeaders = _this.props.stickyHeaders;
|
|
@@ -197,6 +232,13 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
197
232
|
(0, _createClass2.default)(TableContainer, [{
|
|
198
233
|
key: "componentDidMount",
|
|
199
234
|
value: function componentDidMount() {
|
|
235
|
+
this.resizeObserver = new ResizeObserver(this.applyResizerChange);
|
|
236
|
+
if (this.wrapperRef.current) {
|
|
237
|
+
this.resizeObserver.observe(this.wrapperRef.current);
|
|
238
|
+
}
|
|
239
|
+
if (this.stickyHeaderRef.current) {
|
|
240
|
+
this.resizeObserver.observe(this.stickyHeaderRef.current);
|
|
241
|
+
}
|
|
200
242
|
if (this.props.stickyHeaders) {
|
|
201
243
|
this.overflowParent = _sticky.OverflowParent.fromElement(this.tableRef.current);
|
|
202
244
|
this.overflowParent.addEventListener('scroll', this.onScroll);
|
|
@@ -243,11 +285,6 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
243
285
|
return undefined;
|
|
244
286
|
}
|
|
245
287
|
}
|
|
246
|
-
}, {
|
|
247
|
-
key: "headerRowHeight",
|
|
248
|
-
get: function get() {
|
|
249
|
-
return this.stickyHeaderRef.current ? this.stickyHeaderRef.current.offsetHeight : 0;
|
|
250
|
-
}
|
|
251
288
|
}, {
|
|
252
289
|
key: "render",
|
|
253
290
|
value: function render() {
|
|
@@ -274,7 +311,6 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
274
311
|
if (canUseLinelength(rendererAppearance) && tableWidth !== 'inherit' && tableWidth > lineLength) {
|
|
275
312
|
left = lineLength / 2 - tableWidth / 2;
|
|
276
313
|
}
|
|
277
|
-
var wrapperWidth = this.wrapperRef.current ? this.wrapperRef.current.clientWidth : 0;
|
|
278
314
|
var children = _react.default.Children.toArray(this.props.children);
|
|
279
315
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !(0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') && stickyHeaders && tableCanBeSticky(tableNode, children) && /*#__PURE__*/_react.default.createElement(_sticky.StickyTable, {
|
|
280
316
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
@@ -287,9 +323,9 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
287
323
|
left: left,
|
|
288
324
|
mode: stickyMode,
|
|
289
325
|
innerRef: this.stickyWrapperRef,
|
|
290
|
-
wrapperWidth: wrapperWidth,
|
|
326
|
+
wrapperWidth: this.state.wrapperWidth,
|
|
291
327
|
columnWidths: columnWidths,
|
|
292
|
-
rowHeight: this.headerRowHeight,
|
|
328
|
+
rowHeight: this.state.headerRowHeight,
|
|
293
329
|
rendererAppearance: rendererAppearance
|
|
294
330
|
}, [children && children[0]]), /*#__PURE__*/_react.default.createElement("div", {
|
|
295
331
|
className: "".concat(_styles.TableSharedCssClassName.TABLE_CONTAINER, " ").concat(this.props.shadowClassNames || ''),
|
|
@@ -309,9 +345,9 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
309
345
|
top: this.stickyTop,
|
|
310
346
|
mode: stickyMode,
|
|
311
347
|
innerRef: this.stickyWrapperRef,
|
|
312
|
-
wrapperWidth: wrapperWidth,
|
|
348
|
+
wrapperWidth: this.state.wrapperWidth,
|
|
313
349
|
columnWidths: columnWidths,
|
|
314
|
-
rowHeight: this.headerRowHeight,
|
|
350
|
+
rowHeight: this.state.headerRowHeight,
|
|
315
351
|
tableNode: tableNode,
|
|
316
352
|
rendererAppearance: rendererAppearance
|
|
317
353
|
}, [children && children[0]]), /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -55,7 +55,7 @@ exports.NORMAL_SEVERITY_THRESHOLD = NORMAL_SEVERITY_THRESHOLD;
|
|
|
55
55
|
var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
56
56
|
exports.DEGRADED_SEVERITY_THRESHOLD = DEGRADED_SEVERITY_THRESHOLD;
|
|
57
57
|
var packageName = "@atlaskit/renderer";
|
|
58
|
-
var packageVersion = "108.11.
|
|
58
|
+
var packageVersion = "108.11.3";
|
|
59
59
|
var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
60
60
|
(0, _inherits2.default)(Renderer, _PureComponent);
|
|
61
61
|
var _super = _createSuper(Renderer);
|
package/dist/cjs/version.json
CHANGED
|
@@ -11,6 +11,7 @@ export const Table = /*#__PURE__*/React.memo(({
|
|
|
11
11
|
rendererAppearance
|
|
12
12
|
}) => {
|
|
13
13
|
return /*#__PURE__*/React.createElement("table", {
|
|
14
|
+
"data-testid": "renderer-table",
|
|
14
15
|
"data-number-column": isNumberColumnEnabled,
|
|
15
16
|
ref: innerRef
|
|
16
17
|
}, /*#__PURE__*/React.createElement(Colgroup, {
|
|
@@ -91,7 +91,9 @@ export class TableContainer extends React.Component {
|
|
|
91
91
|
constructor(...args) {
|
|
92
92
|
super(...args);
|
|
93
93
|
_defineProperty(this, "state", {
|
|
94
|
-
stickyMode: 'none'
|
|
94
|
+
stickyMode: 'none',
|
|
95
|
+
wrapperWidth: 0,
|
|
96
|
+
headerRowHeight: 0
|
|
95
97
|
});
|
|
96
98
|
_defineProperty(this, "tableRef", /*#__PURE__*/React.createRef());
|
|
97
99
|
_defineProperty(this, "stickyHeaderRef", /*#__PURE__*/React.createRef());
|
|
@@ -99,6 +101,24 @@ export class TableContainer extends React.Component {
|
|
|
99
101
|
_defineProperty(this, "stickyWrapperRef", /*#__PURE__*/React.createRef());
|
|
100
102
|
_defineProperty(this, "wrapperRef", /*#__PURE__*/React.createRef());
|
|
101
103
|
_defineProperty(this, "overflowParent", null);
|
|
104
|
+
_defineProperty(this, "resizeObserver", null);
|
|
105
|
+
_defineProperty(this, "applyResizerChange", entries => {
|
|
106
|
+
let wrapperWidth = this.state.wrapperWidth;
|
|
107
|
+
let headerRowHeight = this.state.headerRowHeight;
|
|
108
|
+
for (const entry of entries) {
|
|
109
|
+
if (entry.target === this.wrapperRef.current) {
|
|
110
|
+
wrapperWidth = entry.contentRect.width;
|
|
111
|
+
} else if (entry.target === this.stickyHeaderRef.current) {
|
|
112
|
+
headerRowHeight = Math.round(entry.contentRect.height);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (headerRowHeight !== this.state.headerRowHeight || wrapperWidth !== this.state.wrapperWidth) {
|
|
116
|
+
this.setState({
|
|
117
|
+
wrapperWidth,
|
|
118
|
+
headerRowHeight
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
});
|
|
102
122
|
_defineProperty(this, "componentWillUnmount", () => {
|
|
103
123
|
if (this.overflowParent) {
|
|
104
124
|
this.overflowParent.removeEventListener('scroll', this.onScroll);
|
|
@@ -106,6 +126,9 @@ export class TableContainer extends React.Component {
|
|
|
106
126
|
if (this.nextFrame) {
|
|
107
127
|
cancelAnimationFrame(this.nextFrame);
|
|
108
128
|
}
|
|
129
|
+
if (this.resizeObserver) {
|
|
130
|
+
this.resizeObserver.disconnect();
|
|
131
|
+
}
|
|
109
132
|
});
|
|
110
133
|
_defineProperty(this, "getScrollTop", () => {
|
|
111
134
|
const {
|
|
@@ -161,6 +184,13 @@ export class TableContainer extends React.Component {
|
|
|
161
184
|
});
|
|
162
185
|
}
|
|
163
186
|
componentDidMount() {
|
|
187
|
+
this.resizeObserver = new ResizeObserver(this.applyResizerChange);
|
|
188
|
+
if (this.wrapperRef.current) {
|
|
189
|
+
this.resizeObserver.observe(this.wrapperRef.current);
|
|
190
|
+
}
|
|
191
|
+
if (this.stickyHeaderRef.current) {
|
|
192
|
+
this.resizeObserver.observe(this.stickyHeaderRef.current);
|
|
193
|
+
}
|
|
164
194
|
if (this.props.stickyHeaders) {
|
|
165
195
|
this.overflowParent = OverflowParent.fromElement(this.tableRef.current);
|
|
166
196
|
this.overflowParent.addEventListener('scroll', this.onScroll);
|
|
@@ -201,9 +231,6 @@ export class TableContainer extends React.Component {
|
|
|
201
231
|
return undefined;
|
|
202
232
|
}
|
|
203
233
|
}
|
|
204
|
-
get headerRowHeight() {
|
|
205
|
-
return this.stickyHeaderRef.current ? this.stickyHeaderRef.current.offsetHeight : 0;
|
|
206
|
-
}
|
|
207
234
|
render() {
|
|
208
235
|
const {
|
|
209
236
|
isNumberColumnEnabled,
|
|
@@ -231,7 +258,6 @@ export class TableContainer extends React.Component {
|
|
|
231
258
|
if (canUseLinelength(rendererAppearance) && tableWidth !== 'inherit' && tableWidth > lineLength) {
|
|
232
259
|
left = lineLength / 2 - tableWidth / 2;
|
|
233
260
|
}
|
|
234
|
-
const wrapperWidth = this.wrapperRef.current ? this.wrapperRef.current.clientWidth : 0;
|
|
235
261
|
const children = React.Children.toArray(this.props.children);
|
|
236
262
|
return /*#__PURE__*/React.createElement(React.Fragment, null, !getBooleanFF('platform.editor.custom-table-width') && stickyHeaders && tableCanBeSticky(tableNode, children) && /*#__PURE__*/React.createElement(StickyTable, {
|
|
237
263
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
@@ -244,9 +270,9 @@ export class TableContainer extends React.Component {
|
|
|
244
270
|
left: left,
|
|
245
271
|
mode: stickyMode,
|
|
246
272
|
innerRef: this.stickyWrapperRef,
|
|
247
|
-
wrapperWidth: wrapperWidth,
|
|
273
|
+
wrapperWidth: this.state.wrapperWidth,
|
|
248
274
|
columnWidths: columnWidths,
|
|
249
|
-
rowHeight: this.headerRowHeight,
|
|
275
|
+
rowHeight: this.state.headerRowHeight,
|
|
250
276
|
rendererAppearance: rendererAppearance
|
|
251
277
|
}, [children && children[0]]), /*#__PURE__*/React.createElement("div", {
|
|
252
278
|
className: `${TableSharedCssClassName.TABLE_CONTAINER} ${this.props.shadowClassNames || ''}`,
|
|
@@ -266,9 +292,9 @@ export class TableContainer extends React.Component {
|
|
|
266
292
|
top: this.stickyTop,
|
|
267
293
|
mode: stickyMode,
|
|
268
294
|
innerRef: this.stickyWrapperRef,
|
|
269
|
-
wrapperWidth: wrapperWidth,
|
|
295
|
+
wrapperWidth: this.state.wrapperWidth,
|
|
270
296
|
columnWidths: columnWidths,
|
|
271
|
-
rowHeight: this.headerRowHeight,
|
|
297
|
+
rowHeight: this.state.headerRowHeight,
|
|
272
298
|
tableNode: tableNode,
|
|
273
299
|
rendererAppearance: rendererAppearance
|
|
274
300
|
}, [children && children[0]]), /*#__PURE__*/React.createElement("div", {
|
|
@@ -35,7 +35,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
|
|
|
35
35
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
36
36
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
37
37
|
const packageName = "@atlaskit/renderer";
|
|
38
|
-
const packageVersion = "108.11.
|
|
38
|
+
const packageVersion = "108.11.3";
|
|
39
39
|
export class Renderer extends PureComponent {
|
|
40
40
|
constructor(props) {
|
|
41
41
|
super(props);
|
package/dist/es2019/version.json
CHANGED
|
@@ -10,6 +10,7 @@ export var Table = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
10
10
|
tableNode = _ref.tableNode,
|
|
11
11
|
rendererAppearance = _ref.rendererAppearance;
|
|
12
12
|
return /*#__PURE__*/React.createElement("table", {
|
|
13
|
+
"data-testid": "renderer-table",
|
|
13
14
|
"data-number-column": isNumberColumnEnabled,
|
|
14
15
|
ref: innerRef
|
|
15
16
|
}, /*#__PURE__*/React.createElement(Colgroup, {
|
|
@@ -6,6 +6,9 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
6
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
10
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
13
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11
14
|
import React from 'react';
|
|
@@ -119,7 +122,9 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
119
122
|
}
|
|
120
123
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
121
124
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
122
|
-
stickyMode: 'none'
|
|
125
|
+
stickyMode: 'none',
|
|
126
|
+
wrapperWidth: 0,
|
|
127
|
+
headerRowHeight: 0
|
|
123
128
|
});
|
|
124
129
|
_defineProperty(_assertThisInitialized(_this), "tableRef", /*#__PURE__*/React.createRef());
|
|
125
130
|
_defineProperty(_assertThisInitialized(_this), "stickyHeaderRef", /*#__PURE__*/React.createRef());
|
|
@@ -127,6 +132,33 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
127
132
|
_defineProperty(_assertThisInitialized(_this), "stickyWrapperRef", /*#__PURE__*/React.createRef());
|
|
128
133
|
_defineProperty(_assertThisInitialized(_this), "wrapperRef", /*#__PURE__*/React.createRef());
|
|
129
134
|
_defineProperty(_assertThisInitialized(_this), "overflowParent", null);
|
|
135
|
+
_defineProperty(_assertThisInitialized(_this), "resizeObserver", null);
|
|
136
|
+
_defineProperty(_assertThisInitialized(_this), "applyResizerChange", function (entries) {
|
|
137
|
+
var wrapperWidth = _this.state.wrapperWidth;
|
|
138
|
+
var headerRowHeight = _this.state.headerRowHeight;
|
|
139
|
+
var _iterator = _createForOfIteratorHelper(entries),
|
|
140
|
+
_step;
|
|
141
|
+
try {
|
|
142
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
143
|
+
var entry = _step.value;
|
|
144
|
+
if (entry.target === _this.wrapperRef.current) {
|
|
145
|
+
wrapperWidth = entry.contentRect.width;
|
|
146
|
+
} else if (entry.target === _this.stickyHeaderRef.current) {
|
|
147
|
+
headerRowHeight = Math.round(entry.contentRect.height);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
} catch (err) {
|
|
151
|
+
_iterator.e(err);
|
|
152
|
+
} finally {
|
|
153
|
+
_iterator.f();
|
|
154
|
+
}
|
|
155
|
+
if (headerRowHeight !== _this.state.headerRowHeight || wrapperWidth !== _this.state.wrapperWidth) {
|
|
156
|
+
_this.setState({
|
|
157
|
+
wrapperWidth: wrapperWidth,
|
|
158
|
+
headerRowHeight: headerRowHeight
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
});
|
|
130
162
|
_defineProperty(_assertThisInitialized(_this), "componentWillUnmount", function () {
|
|
131
163
|
if (_this.overflowParent) {
|
|
132
164
|
_this.overflowParent.removeEventListener('scroll', _this.onScroll);
|
|
@@ -134,6 +166,9 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
134
166
|
if (_this.nextFrame) {
|
|
135
167
|
cancelAnimationFrame(_this.nextFrame);
|
|
136
168
|
}
|
|
169
|
+
if (_this.resizeObserver) {
|
|
170
|
+
_this.resizeObserver.disconnect();
|
|
171
|
+
}
|
|
137
172
|
});
|
|
138
173
|
_defineProperty(_assertThisInitialized(_this), "getScrollTop", function () {
|
|
139
174
|
var stickyHeaders = _this.props.stickyHeaders;
|
|
@@ -190,6 +225,13 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
190
225
|
_createClass(TableContainer, [{
|
|
191
226
|
key: "componentDidMount",
|
|
192
227
|
value: function componentDidMount() {
|
|
228
|
+
this.resizeObserver = new ResizeObserver(this.applyResizerChange);
|
|
229
|
+
if (this.wrapperRef.current) {
|
|
230
|
+
this.resizeObserver.observe(this.wrapperRef.current);
|
|
231
|
+
}
|
|
232
|
+
if (this.stickyHeaderRef.current) {
|
|
233
|
+
this.resizeObserver.observe(this.stickyHeaderRef.current);
|
|
234
|
+
}
|
|
193
235
|
if (this.props.stickyHeaders) {
|
|
194
236
|
this.overflowParent = OverflowParent.fromElement(this.tableRef.current);
|
|
195
237
|
this.overflowParent.addEventListener('scroll', this.onScroll);
|
|
@@ -236,11 +278,6 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
236
278
|
return undefined;
|
|
237
279
|
}
|
|
238
280
|
}
|
|
239
|
-
}, {
|
|
240
|
-
key: "headerRowHeight",
|
|
241
|
-
get: function get() {
|
|
242
|
-
return this.stickyHeaderRef.current ? this.stickyHeaderRef.current.offsetHeight : 0;
|
|
243
|
-
}
|
|
244
281
|
}, {
|
|
245
282
|
key: "render",
|
|
246
283
|
value: function render() {
|
|
@@ -267,7 +304,6 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
267
304
|
if (canUseLinelength(rendererAppearance) && tableWidth !== 'inherit' && tableWidth > lineLength) {
|
|
268
305
|
left = lineLength / 2 - tableWidth / 2;
|
|
269
306
|
}
|
|
270
|
-
var wrapperWidth = this.wrapperRef.current ? this.wrapperRef.current.clientWidth : 0;
|
|
271
307
|
var children = React.Children.toArray(this.props.children);
|
|
272
308
|
return /*#__PURE__*/React.createElement(React.Fragment, null, !getBooleanFF('platform.editor.custom-table-width') && stickyHeaders && tableCanBeSticky(tableNode, children) && /*#__PURE__*/React.createElement(StickyTable, {
|
|
273
309
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
@@ -280,9 +316,9 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
280
316
|
left: left,
|
|
281
317
|
mode: stickyMode,
|
|
282
318
|
innerRef: this.stickyWrapperRef,
|
|
283
|
-
wrapperWidth: wrapperWidth,
|
|
319
|
+
wrapperWidth: this.state.wrapperWidth,
|
|
284
320
|
columnWidths: columnWidths,
|
|
285
|
-
rowHeight: this.headerRowHeight,
|
|
321
|
+
rowHeight: this.state.headerRowHeight,
|
|
286
322
|
rendererAppearance: rendererAppearance
|
|
287
323
|
}, [children && children[0]]), /*#__PURE__*/React.createElement("div", {
|
|
288
324
|
className: "".concat(TableSharedCssClassName.TABLE_CONTAINER, " ").concat(this.props.shadowClassNames || ''),
|
|
@@ -302,9 +338,9 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
302
338
|
top: this.stickyTop,
|
|
303
339
|
mode: stickyMode,
|
|
304
340
|
innerRef: this.stickyWrapperRef,
|
|
305
|
-
wrapperWidth: wrapperWidth,
|
|
341
|
+
wrapperWidth: this.state.wrapperWidth,
|
|
306
342
|
columnWidths: columnWidths,
|
|
307
|
-
rowHeight: this.headerRowHeight,
|
|
343
|
+
rowHeight: this.state.headerRowHeight,
|
|
308
344
|
tableNode: tableNode,
|
|
309
345
|
rendererAppearance: rendererAppearance
|
|
310
346
|
}, [children && children[0]]), /*#__PURE__*/React.createElement("div", {
|
|
@@ -45,7 +45,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
|
|
|
45
45
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
46
46
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
47
47
|
var packageName = "@atlaskit/renderer";
|
|
48
|
-
var packageVersion = "108.11.
|
|
48
|
+
var packageVersion = "108.11.3";
|
|
49
49
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
50
50
|
_inherits(Renderer, _PureComponent);
|
|
51
51
|
var _super = _createSuper(Renderer);
|
package/dist/esm/version.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import type { OverflowShadowProps } from '@atlaskit/editor-common/ui';
|
|
6
|
-
import { TableLayout } from '@atlaskit/adf-schema';
|
|
7
|
-
import { RendererAppearance } from '../../../ui/Renderer/types';
|
|
6
|
+
import type { TableLayout } from '@atlaskit/adf-schema';
|
|
7
|
+
import type { RendererAppearance } from '../../../ui/Renderer/types';
|
|
8
8
|
export type StickyMode = 'none' | 'stick' | 'pin-bottom';
|
|
9
9
|
export declare const tableStickyPadding = 8;
|
|
10
10
|
interface FixedProps {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import type { OverflowShadowProps } from '@atlaskit/editor-common/ui';
|
|
4
4
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
5
|
-
import { RendererAppearance, StickyHeaderConfig } from '../../ui/Renderer/types';
|
|
6
|
-
import { WithSmartCardStorageProps } from '../../ui/SmartCardStorage';
|
|
7
|
-
import { StickyMode
|
|
8
|
-
import {
|
|
5
|
+
import type { RendererAppearance, StickyHeaderConfig } from '../../ui/Renderer/types';
|
|
6
|
+
import type { WithSmartCardStorageProps } from '../../ui/SmartCardStorage';
|
|
7
|
+
import type { StickyMode } from './table/sticky';
|
|
8
|
+
import { OverflowParent } from './table/sticky';
|
|
9
|
+
import type { SharedTableProps } from './table/types';
|
|
9
10
|
export declare const isTableResizingEnabled: (appearance: RendererAppearance) => boolean;
|
|
10
11
|
export type TableProps = SharedTableProps & {
|
|
11
12
|
children: React.ReactElement<any> | Array<React.ReactElement<any>>;
|
|
@@ -20,6 +21,8 @@ interface TableOrderStatus {
|
|
|
20
21
|
}
|
|
21
22
|
interface TableState {
|
|
22
23
|
stickyMode: StickyMode;
|
|
24
|
+
wrapperWidth: number;
|
|
25
|
+
headerRowHeight: number;
|
|
23
26
|
}
|
|
24
27
|
export declare class TableContainer extends React.Component<TableProps & OverflowShadowProps & WithSmartCardStorageProps, TableState> {
|
|
25
28
|
state: TableState;
|
|
@@ -29,6 +32,8 @@ export declare class TableContainer extends React.Component<TableProps & Overflo
|
|
|
29
32
|
wrapperRef: React.RefObject<HTMLDivElement>;
|
|
30
33
|
nextFrame: number | undefined;
|
|
31
34
|
overflowParent: OverflowParent | null;
|
|
35
|
+
private resizeObserver;
|
|
36
|
+
private applyResizerChange;
|
|
32
37
|
componentDidMount(): void;
|
|
33
38
|
componentDidUpdate(prevProps: TableProps, prevState: TableState): void;
|
|
34
39
|
componentWillUnmount: () => void;
|
|
@@ -38,7 +43,6 @@ export declare class TableContainer extends React.Component<TableProps & Overflo
|
|
|
38
43
|
onWrapperScrolled: () => void;
|
|
39
44
|
get pinTop(): number | undefined;
|
|
40
45
|
get stickyTop(): number | undefined;
|
|
41
|
-
get headerRowHeight(): number;
|
|
42
46
|
render(): JSX.Element;
|
|
43
47
|
private grabFirstRowRef;
|
|
44
48
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import { PureComponent } from 'react';
|
|
3
|
-
import { RendererProps } from '../renderer-props';
|
|
3
|
+
import type { RendererProps } from '../renderer-props';
|
|
4
4
|
export declare const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
5
5
|
export declare const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
6
6
|
export interface Extension<T> {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import type { OverflowShadowProps } from '@atlaskit/editor-common/ui';
|
|
6
|
-
import { TableLayout } from '@atlaskit/adf-schema';
|
|
7
|
-
import { RendererAppearance } from '../../../ui/Renderer/types';
|
|
6
|
+
import type { TableLayout } from '@atlaskit/adf-schema';
|
|
7
|
+
import type { RendererAppearance } from '../../../ui/Renderer/types';
|
|
8
8
|
export type StickyMode = 'none' | 'stick' | 'pin-bottom';
|
|
9
9
|
export declare const tableStickyPadding = 8;
|
|
10
10
|
interface FixedProps {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import type { OverflowShadowProps } from '@atlaskit/editor-common/ui';
|
|
4
4
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
5
|
-
import { RendererAppearance, StickyHeaderConfig } from '../../ui/Renderer/types';
|
|
6
|
-
import { WithSmartCardStorageProps } from '../../ui/SmartCardStorage';
|
|
7
|
-
import { StickyMode
|
|
8
|
-
import {
|
|
5
|
+
import type { RendererAppearance, StickyHeaderConfig } from '../../ui/Renderer/types';
|
|
6
|
+
import type { WithSmartCardStorageProps } from '../../ui/SmartCardStorage';
|
|
7
|
+
import type { StickyMode } from './table/sticky';
|
|
8
|
+
import { OverflowParent } from './table/sticky';
|
|
9
|
+
import type { SharedTableProps } from './table/types';
|
|
9
10
|
export declare const isTableResizingEnabled: (appearance: RendererAppearance) => boolean;
|
|
10
11
|
export type TableProps = SharedTableProps & {
|
|
11
12
|
children: React.ReactElement<any> | Array<React.ReactElement<any>>;
|
|
@@ -20,6 +21,8 @@ interface TableOrderStatus {
|
|
|
20
21
|
}
|
|
21
22
|
interface TableState {
|
|
22
23
|
stickyMode: StickyMode;
|
|
24
|
+
wrapperWidth: number;
|
|
25
|
+
headerRowHeight: number;
|
|
23
26
|
}
|
|
24
27
|
export declare class TableContainer extends React.Component<TableProps & OverflowShadowProps & WithSmartCardStorageProps, TableState> {
|
|
25
28
|
state: TableState;
|
|
@@ -29,6 +32,8 @@ export declare class TableContainer extends React.Component<TableProps & Overflo
|
|
|
29
32
|
wrapperRef: React.RefObject<HTMLDivElement>;
|
|
30
33
|
nextFrame: number | undefined;
|
|
31
34
|
overflowParent: OverflowParent | null;
|
|
35
|
+
private resizeObserver;
|
|
36
|
+
private applyResizerChange;
|
|
32
37
|
componentDidMount(): void;
|
|
33
38
|
componentDidUpdate(prevProps: TableProps, prevState: TableState): void;
|
|
34
39
|
componentWillUnmount: () => void;
|
|
@@ -38,7 +43,6 @@ export declare class TableContainer extends React.Component<TableProps & Overflo
|
|
|
38
43
|
onWrapperScrolled: () => void;
|
|
39
44
|
get pinTop(): number | undefined;
|
|
40
45
|
get stickyTop(): number | undefined;
|
|
41
|
-
get headerRowHeight(): number;
|
|
42
46
|
render(): JSX.Element;
|
|
43
47
|
private grabFirstRowRef;
|
|
44
48
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import { PureComponent } from 'react';
|
|
3
|
-
import { RendererProps } from '../renderer-props';
|
|
3
|
+
import type { RendererProps } from '../renderer-props';
|
|
4
4
|
export declare const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
5
5
|
export declare const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
6
6
|
export interface Extension<T> {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "108.11.
|
|
3
|
+
"version": "108.11.3",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -24,17 +24,17 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@atlaskit/adf-schema": "^28.
|
|
27
|
+
"@atlaskit/adf-schema": "^28.1.0",
|
|
28
28
|
"@atlaskit/adf-utils": "^19.0.0",
|
|
29
29
|
"@atlaskit/analytics-listeners": "^8.7.0",
|
|
30
30
|
"@atlaskit/analytics-namespaced-context": "^6.7.0",
|
|
31
31
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
32
|
-
"@atlaskit/button": "^16.
|
|
32
|
+
"@atlaskit/button": "^16.9.0",
|
|
33
33
|
"@atlaskit/code": "^14.6.0",
|
|
34
|
-
"@atlaskit/editor-common": "^74.
|
|
34
|
+
"@atlaskit/editor-common": "^74.42.0",
|
|
35
35
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
36
36
|
"@atlaskit/editor-palette": "1.5.1",
|
|
37
|
-
"@atlaskit/editor-prosemirror": "1.0
|
|
37
|
+
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
38
38
|
"@atlaskit/editor-shared-styles": "^2.6.0",
|
|
39
39
|
"@atlaskit/emoji": "^67.4.0",
|
|
40
40
|
"@atlaskit/icon": "^21.12.0",
|