@atlaskit/renderer 109.29.4 → 109.29.5
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 +8 -0
- package/dist/cjs/react/nodes/table.js +14 -5
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/react/nodes/table.js +15 -6
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/react/nodes/table.js +15 -6
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 109.29.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#103178](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/103178)
|
|
8
|
+
[`71c9ef285341`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/71c9ef285341) -
|
|
9
|
+
ED-22930: Support for table alignment in renderer
|
|
10
|
+
|
|
3
11
|
## 109.29.4
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -298,7 +298,7 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
298
298
|
isInsideOfBlockNode = _this$props.isInsideOfBlockNode,
|
|
299
299
|
isinsideMultiBodiedExtension = _this$props.isinsideMultiBodiedExtension;
|
|
300
300
|
var stickyMode = this.state.stickyMode;
|
|
301
|
-
var
|
|
301
|
+
var lineLengthFixedWidth = _editorSharedStyles.akEditorDefaultLayoutWidth;
|
|
302
302
|
var left;
|
|
303
303
|
var updatedLayout;
|
|
304
304
|
|
|
@@ -316,8 +316,17 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
316
316
|
}
|
|
317
317
|
};
|
|
318
318
|
var tableWidth = calcDefaultLayoutWidthByAppearance(rendererAppearance, tableNode);
|
|
319
|
-
|
|
320
|
-
|
|
319
|
+
|
|
320
|
+
// Logic for table alignment in renderer
|
|
321
|
+
var isTableAlignStart = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.allow-table-alignment') && (0, _appearance.isFullWidthOrFullPageAppearance)(rendererAppearance) && tableNode && tableNode.attrs && tableNode.attrs.layout === 'align-start';
|
|
322
|
+
var fullWidthLineLength = isRenderWidthValid ? Math.min(_editorSharedStyles.akEditorFullWidthLayoutWidth, renderWidth) : _editorSharedStyles.akEditorFullWidthLayoutWidth;
|
|
323
|
+
var lineLength = (0, _appearance.isFullWidthAppearance)(rendererAppearance) ? fullWidthLineLength : lineLengthFixedWidth;
|
|
324
|
+
var shouldCalculateLeftForAlignment = isTableAlignStart && ((0, _appearance.isFullPageAppearance)(rendererAppearance) && tableWidth <= lineLengthFixedWidth || (0, _appearance.isFullWidthAppearance)(rendererAppearance));
|
|
325
|
+
if (shouldCalculateLeftForAlignment) {
|
|
326
|
+
left = (tableWidth - lineLength) / 2;
|
|
327
|
+
}
|
|
328
|
+
if (!shouldCalculateLeftForAlignment && canUseLinelength(rendererAppearance) && tableWidth > lineLengthFixedWidth) {
|
|
329
|
+
left = lineLengthFixedWidth / 2 - tableWidth / 2;
|
|
321
330
|
}
|
|
322
331
|
var children = _react.default.Children.toArray(this.props.children);
|
|
323
332
|
|
|
@@ -338,8 +347,8 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
338
347
|
ref: this.props.handleRef,
|
|
339
348
|
style: {
|
|
340
349
|
width: isTableResizingEnabled(rendererAppearance) ? tableWidth : 'inherit',
|
|
341
|
-
|
|
342
|
-
left:
|
|
350
|
+
left: left,
|
|
351
|
+
marginLeft: shouldCalculateLeftForAlignment && left !== undefined ? -left : undefined
|
|
343
352
|
}
|
|
344
353
|
}, stickyHeaders && tableCanBeSticky(tableNode, children) && /*#__PURE__*/_react.default.createElement(_sticky.StickyTable, {
|
|
345
354
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
@@ -56,7 +56,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
56
56
|
var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
57
57
|
var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
58
58
|
var packageName = "@atlaskit/renderer";
|
|
59
|
-
var packageVersion = "109.29.
|
|
59
|
+
var packageVersion = "109.29.5";
|
|
60
60
|
var defaultNodeComponents = exports.defaultNodeComponents = _nodes.nodeToReact;
|
|
61
61
|
var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
62
62
|
(0, _inherits2.default)(Renderer, _PureComponent);
|
|
@@ -13,7 +13,7 @@ import { TableHeader } from './tableCell';
|
|
|
13
13
|
import { withSmartCardStorage } from '../../ui/SmartCardStorage';
|
|
14
14
|
import { StickyTable, tableStickyPadding, OverflowParent } from './table/sticky';
|
|
15
15
|
import { Table } from './table/table';
|
|
16
|
-
import { isFullWidthOrFullPageAppearance } from '../utils/appearance';
|
|
16
|
+
import { isFullPageAppearance, isFullWidthAppearance, isFullWidthOrFullPageAppearance } from '../utils/appearance';
|
|
17
17
|
export const isTableResizingEnabled = appearance => isFullWidthOrFullPageAppearance(appearance);
|
|
18
18
|
const orderChildren = (children, tableNode, smartCardStorage, tableOrderStatus) => {
|
|
19
19
|
if (!tableOrderStatus || tableOrderStatus.order === SortOrder.NO_ORDER) {
|
|
@@ -245,7 +245,7 @@ export class TableContainer extends React.Component {
|
|
|
245
245
|
const {
|
|
246
246
|
stickyMode
|
|
247
247
|
} = this.state;
|
|
248
|
-
const
|
|
248
|
+
const lineLengthFixedWidth = akEditorDefaultLayoutWidth;
|
|
249
249
|
let left;
|
|
250
250
|
let updatedLayout;
|
|
251
251
|
|
|
@@ -263,8 +263,17 @@ export class TableContainer extends React.Component {
|
|
|
263
263
|
}
|
|
264
264
|
};
|
|
265
265
|
const tableWidth = calcDefaultLayoutWidthByAppearance(rendererAppearance, tableNode);
|
|
266
|
-
|
|
267
|
-
|
|
266
|
+
|
|
267
|
+
// Logic for table alignment in renderer
|
|
268
|
+
const isTableAlignStart = getBooleanFF('platform.editor.table.allow-table-alignment') && isFullWidthOrFullPageAppearance(rendererAppearance) && tableNode && tableNode.attrs && tableNode.attrs.layout === 'align-start';
|
|
269
|
+
const fullWidthLineLength = isRenderWidthValid ? Math.min(akEditorFullWidthLayoutWidth, renderWidth) : akEditorFullWidthLayoutWidth;
|
|
270
|
+
const lineLength = isFullWidthAppearance(rendererAppearance) ? fullWidthLineLength : lineLengthFixedWidth;
|
|
271
|
+
const shouldCalculateLeftForAlignment = isTableAlignStart && (isFullPageAppearance(rendererAppearance) && tableWidth <= lineLengthFixedWidth || isFullWidthAppearance(rendererAppearance));
|
|
272
|
+
if (shouldCalculateLeftForAlignment) {
|
|
273
|
+
left = (tableWidth - lineLength) / 2;
|
|
274
|
+
}
|
|
275
|
+
if (!shouldCalculateLeftForAlignment && canUseLinelength(rendererAppearance) && tableWidth > lineLengthFixedWidth) {
|
|
276
|
+
left = lineLengthFixedWidth / 2 - tableWidth / 2;
|
|
268
277
|
}
|
|
269
278
|
const children = React.Children.toArray(this.props.children);
|
|
270
279
|
|
|
@@ -285,8 +294,8 @@ export class TableContainer extends React.Component {
|
|
|
285
294
|
ref: this.props.handleRef,
|
|
286
295
|
style: {
|
|
287
296
|
width: isTableResizingEnabled(rendererAppearance) ? tableWidth : 'inherit',
|
|
288
|
-
|
|
289
|
-
left
|
|
297
|
+
left: left,
|
|
298
|
+
marginLeft: shouldCalculateLeftForAlignment && left !== undefined ? -left : undefined
|
|
290
299
|
}
|
|
291
300
|
}, stickyHeaders && tableCanBeSticky(tableNode, children) && /*#__PURE__*/React.createElement(StickyTable, {
|
|
292
301
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
@@ -37,7 +37,7 @@ import { nodeToReact } from '../../react/nodes';
|
|
|
37
37
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
38
38
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
39
39
|
const packageName = "@atlaskit/renderer";
|
|
40
|
-
const packageVersion = "109.29.
|
|
40
|
+
const packageVersion = "109.29.5";
|
|
41
41
|
export const defaultNodeComponents = nodeToReact;
|
|
42
42
|
export class Renderer extends PureComponent {
|
|
43
43
|
constructor(props) {
|
|
@@ -24,7 +24,7 @@ import { TableHeader } from './tableCell';
|
|
|
24
24
|
import { withSmartCardStorage } from '../../ui/SmartCardStorage';
|
|
25
25
|
import { StickyTable, tableStickyPadding, OverflowParent } from './table/sticky';
|
|
26
26
|
import { Table } from './table/table';
|
|
27
|
-
import { isFullWidthOrFullPageAppearance } from '../utils/appearance';
|
|
27
|
+
import { isFullPageAppearance, isFullWidthAppearance, isFullWidthOrFullPageAppearance } from '../utils/appearance';
|
|
28
28
|
export var isTableResizingEnabled = function isTableResizingEnabled(appearance) {
|
|
29
29
|
return isFullWidthOrFullPageAppearance(appearance);
|
|
30
30
|
};
|
|
@@ -291,7 +291,7 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
291
291
|
isInsideOfBlockNode = _this$props.isInsideOfBlockNode,
|
|
292
292
|
isinsideMultiBodiedExtension = _this$props.isinsideMultiBodiedExtension;
|
|
293
293
|
var stickyMode = this.state.stickyMode;
|
|
294
|
-
var
|
|
294
|
+
var lineLengthFixedWidth = akEditorDefaultLayoutWidth;
|
|
295
295
|
var left;
|
|
296
296
|
var updatedLayout;
|
|
297
297
|
|
|
@@ -309,8 +309,17 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
309
309
|
}
|
|
310
310
|
};
|
|
311
311
|
var tableWidth = calcDefaultLayoutWidthByAppearance(rendererAppearance, tableNode);
|
|
312
|
-
|
|
313
|
-
|
|
312
|
+
|
|
313
|
+
// Logic for table alignment in renderer
|
|
314
|
+
var isTableAlignStart = getBooleanFF('platform.editor.table.allow-table-alignment') && isFullWidthOrFullPageAppearance(rendererAppearance) && tableNode && tableNode.attrs && tableNode.attrs.layout === 'align-start';
|
|
315
|
+
var fullWidthLineLength = isRenderWidthValid ? Math.min(akEditorFullWidthLayoutWidth, renderWidth) : akEditorFullWidthLayoutWidth;
|
|
316
|
+
var lineLength = isFullWidthAppearance(rendererAppearance) ? fullWidthLineLength : lineLengthFixedWidth;
|
|
317
|
+
var shouldCalculateLeftForAlignment = isTableAlignStart && (isFullPageAppearance(rendererAppearance) && tableWidth <= lineLengthFixedWidth || isFullWidthAppearance(rendererAppearance));
|
|
318
|
+
if (shouldCalculateLeftForAlignment) {
|
|
319
|
+
left = (tableWidth - lineLength) / 2;
|
|
320
|
+
}
|
|
321
|
+
if (!shouldCalculateLeftForAlignment && canUseLinelength(rendererAppearance) && tableWidth > lineLengthFixedWidth) {
|
|
322
|
+
left = lineLengthFixedWidth / 2 - tableWidth / 2;
|
|
314
323
|
}
|
|
315
324
|
var children = React.Children.toArray(this.props.children);
|
|
316
325
|
|
|
@@ -331,8 +340,8 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
331
340
|
ref: this.props.handleRef,
|
|
332
341
|
style: {
|
|
333
342
|
width: isTableResizingEnabled(rendererAppearance) ? tableWidth : 'inherit',
|
|
334
|
-
|
|
335
|
-
left:
|
|
343
|
+
left: left,
|
|
344
|
+
marginLeft: shouldCalculateLeftForAlignment && left !== undefined ? -left : undefined
|
|
336
345
|
}
|
|
337
346
|
}, stickyHeaders && tableCanBeSticky(tableNode, children) && /*#__PURE__*/React.createElement(StickyTable, {
|
|
338
347
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
@@ -47,7 +47,7 @@ import { nodeToReact } from '../../react/nodes';
|
|
|
47
47
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
48
48
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
49
49
|
var packageName = "@atlaskit/renderer";
|
|
50
|
-
var packageVersion = "109.29.
|
|
50
|
+
var packageVersion = "109.29.5";
|
|
51
51
|
export var defaultNodeComponents = nodeToReact;
|
|
52
52
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
53
53
|
_inherits(Renderer, _PureComponent);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "109.29.
|
|
3
|
+
"version": "109.29.5",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"@atlaskit/analytics-listeners": "^8.9.0",
|
|
30
30
|
"@atlaskit/analytics-namespaced-context": "^6.9.0",
|
|
31
31
|
"@atlaskit/analytics-next": "^9.3.0",
|
|
32
|
-
"@atlaskit/button": "^17.
|
|
32
|
+
"@atlaskit/button": "^17.17.0",
|
|
33
33
|
"@atlaskit/code": "^15.2.0",
|
|
34
|
-
"@atlaskit/editor-common": "^81.
|
|
34
|
+
"@atlaskit/editor-common": "^81.1.0",
|
|
35
35
|
"@atlaskit/editor-json-transformer": "^8.13.0",
|
|
36
36
|
"@atlaskit/editor-palette": "1.6.0",
|
|
37
37
|
"@atlaskit/editor-prosemirror": "4.0.1",
|
|
@@ -143,6 +143,9 @@
|
|
|
143
143
|
},
|
|
144
144
|
"platform.editor.table.preserve-widths-with-lock-button": {
|
|
145
145
|
"type": "boolean"
|
|
146
|
+
},
|
|
147
|
+
"platform.editor.table.allow-table-alignment": {
|
|
148
|
+
"type": "boolean"
|
|
146
149
|
}
|
|
147
150
|
},
|
|
148
151
|
"af:exports": {
|