@atlaskit/renderer 108.7.1 → 108.7.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/colgroup.js +5 -4
- package/dist/cjs/react/nodes/table/sticky.js +19 -15
- package/dist/cjs/react/nodes/table/table.js +4 -2
- package/dist/cjs/react/nodes/table.js +13 -5
- package/dist/cjs/react/utils/appearance.js +18 -0
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/cjs/ui/Renderer/style.js +7 -4
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/react/nodes/table/colgroup.js +6 -4
- package/dist/es2019/react/nodes/table/sticky.js +46 -40
- package/dist/es2019/react/nodes/table/table.js +4 -2
- package/dist/es2019/react/nodes/table.js +9 -4
- package/dist/es2019/react/utils/appearance.js +3 -0
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/es2019/ui/Renderer/style.js +8 -5
- package/dist/es2019/version.json +1 -1
- package/dist/esm/react/nodes/table/colgroup.js +6 -4
- package/dist/esm/react/nodes/table/sticky.js +19 -15
- package/dist/esm/react/nodes/table/table.js +4 -2
- package/dist/esm/react/nodes/table.js +11 -4
- package/dist/esm/react/utils/appearance.js +9 -0
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/esm/ui/Renderer/style.js +7 -4
- package/dist/esm/version.json +1 -1
- package/dist/types/react/nodes/table/sticky.d.ts +4 -1
- package/dist/types/react/nodes/table/table.d.ts +1 -1
- package/dist/types/react/nodes/table/types.d.ts +2 -0
- package/dist/types/react/nodes/table.d.ts +1 -0
- package/dist/types/react/utils/appearance.d.ts +4 -0
- package/dist/types-ts4.5/react/nodes/table/sticky.d.ts +4 -1
- package/dist/types-ts4.5/react/nodes/table/table.d.ts +1 -1
- package/dist/types-ts4.5/react/nodes/table/types.d.ts +2 -0
- package/dist/types-ts4.5/react/nodes/table.d.ts +1 -0
- package/dist/types-ts4.5/react/utils/appearance.d.ts +4 -0
- package/package.json +7 -3
- package/tmp/api-report-tmp.d.ts +0 -546
|
@@ -3,7 +3,6 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
3
3
|
import { fontFamily, fontSize } from '@atlaskit/theme/constants';
|
|
4
4
|
import * as colors from '@atlaskit/theme/colors';
|
|
5
5
|
import { headingSizes as headingSizesImport } from '@atlaskit/theme/typography';
|
|
6
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { tableSharedStyle, columnLayoutSharedStyle, blockquoteSharedStyles, headingsSharedStyles, ruleSharedStyles, whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, mediaSingleSharedStyle, TableSharedCssClassName, tableMarginTop, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, richMediaClassName, tasksAndDecisionsStyles, smartCardSharedStyles, tableCellPadding, textColorStyles, codeBlockInListSafariFix } from '@atlaskit/editor-common/styles';
|
|
8
7
|
import { shadowClassNames } from '@atlaskit/editor-common/ui';
|
|
9
8
|
import { browser } from '@atlaskit/editor-common/utils';
|
|
@@ -12,6 +11,7 @@ import { RendererCssClassName } from '../../consts';
|
|
|
12
11
|
import { HeadingAnchorWrapperClassName } from '../../react/nodes/heading-anchor';
|
|
13
12
|
import { shadowObserverClassNames } from '@atlaskit/editor-common/ui';
|
|
14
13
|
import { getLightWeightCodeBlockStylesForRootRendererStyleSheet } from '../../react/nodes/codeBlock/components/lightWeightCodeBlock';
|
|
14
|
+
import { isTableResizingEnabled } from '../../react/nodes/table';
|
|
15
15
|
export const FullPagePadding = 32;
|
|
16
16
|
const getLineHeight = fontCode => headingSizesImport[fontCode].lineHeight / headingSizesImport[fontCode].size;
|
|
17
17
|
export const headingSizes = {
|
|
@@ -34,7 +34,9 @@ export const headingSizes = {
|
|
|
34
34
|
lineHeight: getLineHeight('h100')
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
const headingAnchorStyle = headingTag =>
|
|
37
|
+
const headingAnchorStyle = headingTag =>
|
|
38
|
+
// TODO Delete this comment after verifying space token -> previous value `margin-left: 6px`
|
|
39
|
+
css`
|
|
38
40
|
/**
|
|
39
41
|
* The copy link button doesn't reserve space in the DOM so that
|
|
40
42
|
* the text alignment isn't impacted by the button/icon's space.
|
|
@@ -43,7 +45,7 @@ const headingAnchorStyle = headingTag => css`
|
|
|
43
45
|
position: absolute;
|
|
44
46
|
height: ${headingSizes[headingTag].lineHeight}em;
|
|
45
47
|
|
|
46
|
-
margin-left: 6px;
|
|
48
|
+
margin-left: ${"var(--ds-space-075, 6px)"};
|
|
47
49
|
|
|
48
50
|
button {
|
|
49
51
|
padding-left: 0;
|
|
@@ -83,6 +85,7 @@ const alignedHeadingAnchorStyle = ({
|
|
|
83
85
|
if (!allowNestedHeaderLinks) {
|
|
84
86
|
return '';
|
|
85
87
|
}
|
|
88
|
+
// TODO Delete this comment after verifying space token -> previous value `margin: 6px`
|
|
86
89
|
return css`
|
|
87
90
|
.fabric-editor-block-mark[data-align] > {
|
|
88
91
|
h1,
|
|
@@ -134,7 +137,7 @@ const alignedHeadingAnchorStyle = ({
|
|
|
134
137
|
}
|
|
135
138
|
}
|
|
136
139
|
.${HeadingAnchorWrapperClassName} {
|
|
137
|
-
margin: 0 6px 0 0;
|
|
140
|
+
margin: 0 ${"var(--ds-space-075, 6px)"} 0 0;
|
|
138
141
|
}
|
|
139
142
|
|
|
140
143
|
@media (hover: hover) and (pointer: fine) {
|
|
@@ -272,7 +275,7 @@ const fullWidthStyles = ({
|
|
|
272
275
|
width: 100% !important;
|
|
273
276
|
}
|
|
274
277
|
|
|
275
|
-
${
|
|
278
|
+
${isTableResizingEnabled(appearance) ? '' : `
|
|
276
279
|
.pm-table-container {
|
|
277
280
|
width: 100% !important;
|
|
278
281
|
}
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { tableCellBorderWidth, tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
3
3
|
import { akEditorTableNumberColumnWidth, akEditorWideLayoutWidth, akEditorFullWidthLayoutWidth, akEditorTableLegacyCellMinWidth, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
4
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
5
|
+
import { isTableResizingEnabled } from '../table';
|
|
6
|
+
|
|
6
7
|
// we allow scaling down column widths by no more than 30%
|
|
7
8
|
// this intends to reduce unwanted scrolling in the Renderer in these scenarios:
|
|
8
9
|
// User A creates a table with column widths → User B views it on a smaller screen
|
|
@@ -50,12 +51,13 @@ export var Colgroup = function Colgroup(props) {
|
|
|
50
51
|
layout = props.layout,
|
|
51
52
|
isNumberColumnEnabled = props.isNumberColumnEnabled,
|
|
52
53
|
renderWidth = props.renderWidth,
|
|
53
|
-
tableNode = props.tableNode
|
|
54
|
+
tableNode = props.tableNode,
|
|
55
|
+
rendererAppearance = props.rendererAppearance;
|
|
54
56
|
if (!columnWidths) {
|
|
55
57
|
return null;
|
|
56
58
|
}
|
|
57
59
|
var tableResized = isTableResized(columnWidths);
|
|
58
|
-
if (
|
|
60
|
+
if (isTableResizingEnabled(rendererAppearance) && !tableResized) {
|
|
59
61
|
return /*#__PURE__*/React.createElement("colgroup", null, isNumberColumnEnabled && /*#__PURE__*/React.createElement("col", {
|
|
60
62
|
style: {
|
|
61
63
|
width: akEditorTableNumberColumnWidth
|
|
@@ -72,7 +74,7 @@ export var Colgroup = function Colgroup(props) {
|
|
|
72
74
|
return null;
|
|
73
75
|
}
|
|
74
76
|
var tableContainerWidth;
|
|
75
|
-
if (
|
|
77
|
+
if (isTableResizingEnabled(rendererAppearance) && tableNode) {
|
|
76
78
|
tableContainerWidth = getTableContainerWidth(tableNode);
|
|
77
79
|
} else {
|
|
78
80
|
tableContainerWidth = getTableLayoutWidth(layout);
|
|
@@ -9,31 +9,32 @@ import { css, jsx } from '@emotion/react';
|
|
|
9
9
|
import { TableSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
10
10
|
import { akEditorStickyHeaderZIndex } from '@atlaskit/editor-shared-styles';
|
|
11
11
|
import { N40A } from '@atlaskit/theme/colors';
|
|
12
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
13
12
|
import { Table } from './table';
|
|
14
13
|
import { recursivelyInjectProps } from '../../utils/inject-props';
|
|
14
|
+
import { isTableResizingEnabled } from '../table';
|
|
15
15
|
export var tableStickyPadding = 8;
|
|
16
16
|
var modeSpecficStyles = {
|
|
17
17
|
none: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: none;\n "]))),
|
|
18
18
|
stick: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: fixed;\n "]))),
|
|
19
19
|
'pin-bottom': css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n "])))
|
|
20
20
|
};
|
|
21
|
-
var stickyHeaderZIndex;
|
|
22
|
-
if (getBooleanFF('platform.editor.custom-table-width')) {
|
|
23
|
-
stickyHeaderZIndex = 13;
|
|
24
|
-
} else {
|
|
25
|
-
stickyHeaderZIndex = akEditorStickyHeaderZIndex;
|
|
26
|
-
}
|
|
27
21
|
|
|
28
22
|
// TODO: Quality ticket: https://product-fabric.atlassian.net/browse/DSP-4123
|
|
29
|
-
var fixedTableDivStaticStyles = function fixedTableDivStaticStyles(top, width) {
|
|
30
|
-
|
|
23
|
+
var fixedTableDivStaticStyles = function fixedTableDivStaticStyles(top, width, rendererAppearance) {
|
|
24
|
+
var stickyHeaderZIndex;
|
|
25
|
+
if (isTableResizingEnabled(rendererAppearance)) {
|
|
26
|
+
stickyHeaderZIndex = 13;
|
|
27
|
+
} else {
|
|
28
|
+
stickyHeaderZIndex = akEditorStickyHeaderZIndex;
|
|
29
|
+
}
|
|
30
|
+
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", "\n width: ", "px;\n z-index: ", ";\n &\n .", ",\n &\n .", "\n > table {\n margin-top: 0;\n margin-bottom: 0;\n tr {\n background: ", ";\n }\n }\n\n border-top: ", "px solid\n ", ";\n background: ", ";\n box-shadow: 0 6px 4px -4px ", ";\n\n div[data-expanded='false'] & {\n display: none;\n }\n\n &\n .", ".is-sticky.right-shadow::after,\n &\n .", ".is-sticky.left-shadow::before {\n top: 0px;\n height: 100%;\n }\n "])), typeof top === 'number' && "top: ".concat(top, "px;"), width, stickyHeaderZIndex, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, "var(--ds-surface, white)", tableStickyPadding, "var(--ds-surface, white)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overflow-perimeter, ".concat(N40A, ")"), TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_CONTAINER);
|
|
31
31
|
};
|
|
32
32
|
export var FixedTableDiv = function FixedTableDiv(props) {
|
|
33
33
|
var top = props.top,
|
|
34
34
|
wrapperWidth = props.wrapperWidth,
|
|
35
|
-
mode = props.mode
|
|
36
|
-
|
|
35
|
+
mode = props.mode,
|
|
36
|
+
rendererAppearance = props.rendererAppearance;
|
|
37
|
+
var fixedTableCss = [fixedTableDivStaticStyles(top, wrapperWidth, rendererAppearance), modeSpecficStyles === null || modeSpecficStyles === void 0 ? void 0 : modeSpecficStyles[mode]];
|
|
37
38
|
var attrs = {
|
|
38
39
|
mode: mode
|
|
39
40
|
};
|
|
@@ -56,10 +57,11 @@ export var StickyTable = function StickyTable(_ref) {
|
|
|
56
57
|
columnWidths = _ref.columnWidths,
|
|
57
58
|
renderWidth = _ref.renderWidth,
|
|
58
59
|
rowHeight = _ref.rowHeight,
|
|
59
|
-
tableNode = _ref.tableNode
|
|
60
|
+
tableNode = _ref.tableNode,
|
|
61
|
+
rendererAppearance = _ref.rendererAppearance;
|
|
60
62
|
var styles;
|
|
61
63
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
62
|
-
if (
|
|
64
|
+
if (isTableResizingEnabled(rendererAppearance)) {
|
|
63
65
|
styles = css({
|
|
64
66
|
top: mode === 'pin-bottom' ? top : undefined,
|
|
65
67
|
position: 'relative'
|
|
@@ -77,7 +79,8 @@ export var StickyTable = function StickyTable(_ref) {
|
|
|
77
79
|
}, jsx(FixedTableDiv, {
|
|
78
80
|
top: mode === 'stick' ? top : undefined,
|
|
79
81
|
mode: rowHeight > 300 ? 'none' : mode,
|
|
80
|
-
wrapperWidth: wrapperWidth
|
|
82
|
+
wrapperWidth: wrapperWidth,
|
|
83
|
+
rendererAppearance: rendererAppearance
|
|
81
84
|
}, jsx("div", {
|
|
82
85
|
className: "".concat(TableSharedCssClassName.TABLE_CONTAINER, " is-sticky ").concat(shadowClassNames || ''),
|
|
83
86
|
"data-layout": layout,
|
|
@@ -95,7 +98,8 @@ export var StickyTable = function StickyTable(_ref) {
|
|
|
95
98
|
layout: layout,
|
|
96
99
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
97
100
|
renderWidth: renderWidth,
|
|
98
|
-
tableNode: tableNode
|
|
101
|
+
tableNode: tableNode,
|
|
102
|
+
rendererAppearance: rendererAppearance
|
|
99
103
|
},
|
|
100
104
|
/**
|
|
101
105
|
* @see https://product-fabric.atlassian.net/browse/ED-10235
|
|
@@ -7,7 +7,8 @@ export var Table = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
7
7
|
layout = _ref.layout,
|
|
8
8
|
renderWidth = _ref.renderWidth,
|
|
9
9
|
children = _ref.children,
|
|
10
|
-
tableNode = _ref.tableNode
|
|
10
|
+
tableNode = _ref.tableNode,
|
|
11
|
+
rendererAppearance = _ref.rendererAppearance;
|
|
11
12
|
return /*#__PURE__*/React.createElement("table", {
|
|
12
13
|
"data-number-column": isNumberColumnEnabled,
|
|
13
14
|
ref: innerRef
|
|
@@ -16,6 +17,7 @@ export var Table = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
16
17
|
layout: layout,
|
|
17
18
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
18
19
|
renderWidth: renderWidth,
|
|
19
|
-
tableNode: tableNode
|
|
20
|
+
tableNode: tableNode,
|
|
21
|
+
rendererAppearance: rendererAppearance
|
|
20
22
|
}), /*#__PURE__*/React.createElement("tbody", null, children));
|
|
21
23
|
});
|
|
@@ -22,6 +22,10 @@ import { TableHeader } from './tableCell';
|
|
|
22
22
|
import { withSmartCardStorage } from '../../ui/SmartCardStorage';
|
|
23
23
|
import { StickyTable, tableStickyPadding, OverflowParent } from './table/sticky';
|
|
24
24
|
import { Table } from './table/table';
|
|
25
|
+
import { isFullWidthOrFullPageAppearance } from '../utils/appearance';
|
|
26
|
+
export var isTableResizingEnabled = function isTableResizingEnabled(appearance) {
|
|
27
|
+
return getBooleanFF('platform.editor.custom-table-width') && isFullWidthOrFullPageAppearance(appearance);
|
|
28
|
+
};
|
|
25
29
|
var orderChildren = function orderChildren(children, tableNode, smartCardStorage, tableOrderStatus) {
|
|
26
30
|
if (!tableOrderStatus || tableOrderStatus.order === SortOrder.NO_ORDER) {
|
|
27
31
|
return children;
|
|
@@ -255,7 +259,7 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
255
259
|
var calcDefaultLayoutWidthByAppearance = function calcDefaultLayoutWidthByAppearance(tableNode, rendererAppearance) {
|
|
256
260
|
return rendererAppearance === 'full-width' && !tableNode.attrs.width ? Math.min(akEditorFullWidthLayoutWidth, renderWidth) : Math.min(getTableContainerWidth(tableNode), renderWidth);
|
|
257
261
|
};
|
|
258
|
-
if (
|
|
262
|
+
if (isTableResizingEnabled(rendererAppearance) && tableNode) {
|
|
259
263
|
tableWidth = calcDefaultLayoutWidthByAppearance(tableNode, rendererAppearance);
|
|
260
264
|
} else {
|
|
261
265
|
tableWidth = calcTableWidth(layout, renderWidth, false);
|
|
@@ -278,7 +282,8 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
278
282
|
innerRef: this.stickyWrapperRef,
|
|
279
283
|
wrapperWidth: wrapperWidth,
|
|
280
284
|
columnWidths: columnWidths,
|
|
281
|
-
rowHeight: this.headerRowHeight
|
|
285
|
+
rowHeight: this.headerRowHeight,
|
|
286
|
+
rendererAppearance: rendererAppearance
|
|
282
287
|
}, [children && children[0]]), /*#__PURE__*/React.createElement("div", {
|
|
283
288
|
className: "".concat(TableSharedCssClassName.TABLE_CONTAINER, " ").concat(this.props.shadowClassNames || ''),
|
|
284
289
|
"data-layout": layout,
|
|
@@ -300,7 +305,8 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
300
305
|
wrapperWidth: wrapperWidth,
|
|
301
306
|
columnWidths: columnWidths,
|
|
302
307
|
rowHeight: this.headerRowHeight,
|
|
303
|
-
tableNode: tableNode
|
|
308
|
+
tableNode: tableNode,
|
|
309
|
+
rendererAppearance: rendererAppearance
|
|
304
310
|
}, [children && children[0]]), /*#__PURE__*/React.createElement("div", {
|
|
305
311
|
className: TableSharedCssClassName.TABLE_NODE_WRAPPER,
|
|
306
312
|
ref: this.wrapperRef,
|
|
@@ -311,7 +317,8 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
311
317
|
layout: layout,
|
|
312
318
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
313
319
|
renderWidth: renderWidth,
|
|
314
|
-
tableNode: tableNode
|
|
320
|
+
tableNode: tableNode,
|
|
321
|
+
rendererAppearance: rendererAppearance
|
|
315
322
|
}, this.grabFirstRowRef(children)))));
|
|
316
323
|
}
|
|
317
324
|
}]);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export var isFullWidthAppearance = function isFullWidthAppearance(appearance) {
|
|
2
|
+
return appearance === 'full-width';
|
|
3
|
+
};
|
|
4
|
+
export var isFullPageAppearance = function isFullPageAppearance(appearance) {
|
|
5
|
+
return appearance === 'full-page';
|
|
6
|
+
};
|
|
7
|
+
export var isFullWidthOrFullPageAppearance = function isFullWidthOrFullPageAppearance(appearance) {
|
|
8
|
+
return isFullPageAppearance(appearance) || isFullWidthAppearance(appearance);
|
|
9
|
+
};
|
|
@@ -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.7.
|
|
48
|
+
var packageVersion = "108.7.3";
|
|
49
49
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
50
50
|
_inherits(Renderer, _PureComponent);
|
|
51
51
|
var _super = _createSuper(Renderer);
|
|
@@ -5,7 +5,6 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
5
5
|
import { fontFamily, fontSize } from '@atlaskit/theme/constants';
|
|
6
6
|
import * as colors from '@atlaskit/theme/colors';
|
|
7
7
|
import { headingSizes as headingSizesImport } from '@atlaskit/theme/typography';
|
|
8
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { tableSharedStyle, columnLayoutSharedStyle, blockquoteSharedStyles, headingsSharedStyles, ruleSharedStyles, whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, mediaSingleSharedStyle, TableSharedCssClassName, tableMarginTop, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, richMediaClassName, tasksAndDecisionsStyles, smartCardSharedStyles, tableCellPadding, textColorStyles, codeBlockInListSafariFix } from '@atlaskit/editor-common/styles';
|
|
10
9
|
import { shadowClassNames } from '@atlaskit/editor-common/ui';
|
|
11
10
|
import { browser } from '@atlaskit/editor-common/utils';
|
|
@@ -14,6 +13,7 @@ import { RendererCssClassName } from '../../consts';
|
|
|
14
13
|
import { HeadingAnchorWrapperClassName } from '../../react/nodes/heading-anchor';
|
|
15
14
|
import { shadowObserverClassNames } from '@atlaskit/editor-common/ui';
|
|
16
15
|
import { getLightWeightCodeBlockStylesForRootRendererStyleSheet } from '../../react/nodes/codeBlock/components/lightWeightCodeBlock';
|
|
16
|
+
import { isTableResizingEnabled } from '../../react/nodes/table';
|
|
17
17
|
export var FullPagePadding = 32;
|
|
18
18
|
var getLineHeight = function getLineHeight(fontCode) {
|
|
19
19
|
return headingSizesImport[fontCode].lineHeight / headingSizesImport[fontCode].size;
|
|
@@ -39,14 +39,17 @@ export var headingSizes = {
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
var headingAnchorStyle = function headingAnchorStyle(headingTag) {
|
|
42
|
-
return
|
|
42
|
+
return (// TODO Delete this comment after verifying space token -> previous value `margin-left: 6px`
|
|
43
|
+
css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /**\n * The copy link button doesn't reserve space in the DOM so that\n * the text alignment isn't impacted by the button/icon's space.\n */\n .", " {\n position: absolute;\n height: ", "em;\n\n margin-left: ", ";\n\n button {\n padding-left: 0;\n padding-right: 0;\n }\n }\n\n /**\n * Applies hover effects to the heading anchor link button\n * to fade in when the user rolls over the heading.\n *\n * The link is persistent on mobile, so we use feature detection\n * to enable hover effects for systems that support it (desktop).\n *\n * @see https://caniuse.com/mdn-css_at-rules_media_hover\n */\n @media (hover: hover) and (pointer: fine) {\n .", " {\n > button {\n opacity: 0;\n transform: translate(-8px, 0px);\n transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;\n }\n }\n\n &:hover {\n .", " > button {\n opacity: 1;\n transform: none !important;\n }\n }\n }\n "])), HeadingAnchorWrapperClassName, headingSizes[headingTag].lineHeight, "var(--ds-space-075, 6px)", HeadingAnchorWrapperClassName, HeadingAnchorWrapperClassName)
|
|
44
|
+
);
|
|
43
45
|
};
|
|
44
46
|
var alignedHeadingAnchorStyle = function alignedHeadingAnchorStyle(_ref) {
|
|
45
47
|
var allowNestedHeaderLinks = _ref.allowNestedHeaderLinks;
|
|
46
48
|
if (!allowNestedHeaderLinks) {
|
|
47
49
|
return '';
|
|
48
50
|
}
|
|
49
|
-
|
|
51
|
+
// TODO Delete this comment after verifying space token -> previous value `margin: 6px`
|
|
52
|
+
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .fabric-editor-block-mark[data-align] > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n position: relative;\n }\n }\n\n /**\n * For right-alignment we flip the link to be before the heading\n * text so that the text is flush up against the edge of the editor's\n * container edge.\n */\n .fabric-editor-block-mark:not([data-align='center'])[data-align] {\n > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n // Using right to left text to achieve the inverse effect\n // of where the copy link button icon sits for left/center\n // alignment.\n // Although this is unorthodox it's the only approach which\n // allows the button to sit flush against the left edge of\n // bottom line of text.\n direction: rtl;\n\n // By default RTL will negatively impact the layout of special\n // characters within the heading text, and potentially other\n // nested inline nodes. To prevent this we insert pseudo elements\n // containing HTML entities to retain LTR for all heading content\n // except for the copy link button.\n > *:not(.", "):not(br) {\n ::before {\n // Open LTR: https://www.fileformat.info/info/unicode/char/202a/index.htm\n content: '\u202A';\n }\n ::after {\n // Close LTR: https://www.fileformat.info/info/unicode/char/202c/index.htm\n content: '\u202C';\n }\n }\n }\n }\n .", " {\n margin: 0 ", " 0 0;\n }\n\n @media (hover: hover) and (pointer: fine) {\n .", " > button {\n transform: translate(8px, 0px);\n }\n }\n }\n "], ["\n .fabric-editor-block-mark[data-align] > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n position: relative;\n }\n }\n\n /**\n * For right-alignment we flip the link to be before the heading\n * text so that the text is flush up against the edge of the editor's\n * container edge.\n */\n .fabric-editor-block-mark:not([data-align='center'])[data-align] {\n > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n // Using right to left text to achieve the inverse effect\n // of where the copy link button icon sits for left/center\n // alignment.\n // Although this is unorthodox it's the only approach which\n // allows the button to sit flush against the left edge of\n // bottom line of text.\n direction: rtl;\n\n // By default RTL will negatively impact the layout of special\n // characters within the heading text, and potentially other\n // nested inline nodes. To prevent this we insert pseudo elements\n // containing HTML entities to retain LTR for all heading content\n // except for the copy link button.\n > *:not(.", "):not(br) {\n ::before {\n // Open LTR: https://www.fileformat.info/info/unicode/char/202a/index.htm\n content: '\\u202A';\n }\n ::after {\n // Close LTR: https://www.fileformat.info/info/unicode/char/202c/index.htm\n content: '\\u202C';\n }\n }\n }\n }\n .", " {\n margin: 0 ", " 0 0;\n }\n\n @media (hover: hover) and (pointer: fine) {\n .", " > button {\n transform: translate(8px, 0px);\n }\n }\n }\n "])), HeadingAnchorWrapperClassName, HeadingAnchorWrapperClassName, "var(--ds-space-075, 6px)", HeadingAnchorWrapperClassName);
|
|
50
53
|
};
|
|
51
54
|
var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
|
|
52
55
|
var allowColumnSorting = _ref2.allowColumnSorting,
|
|
@@ -73,7 +76,7 @@ var fullWidthStyles = function fullWidthStyles(_ref5) {
|
|
|
73
76
|
if (appearance !== 'full-width') {
|
|
74
77
|
return '';
|
|
75
78
|
}
|
|
76
|
-
return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n max-width: ", "px;\n margin: 0 auto;\n\n .fabric-editor-breakout-mark,\n .ak-renderer-extension {\n width: 100% !important;\n }\n\n ", "\n "])), akEditorFullWidthLayoutWidth,
|
|
79
|
+
return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n max-width: ", "px;\n margin: 0 auto;\n\n .fabric-editor-breakout-mark,\n .ak-renderer-extension {\n width: 100% !important;\n }\n\n ", "\n "])), akEditorFullWidthLayoutWidth, isTableResizingEnabled(appearance) ? '' : "\n .pm-table-container {\n width: 100% !important;\n }\n ");
|
|
77
80
|
};
|
|
78
81
|
var breakoutWidthStyle = function breakoutWidthStyle(useFragmentMarkBreakoutWidthStylingFix) {
|
|
79
82
|
if (useFragmentMarkBreakoutWidthStylingFix) {
|
package/dist/esm/version.json
CHANGED
|
@@ -4,12 +4,14 @@ import { jsx } from '@emotion/react';
|
|
|
4
4
|
import { Node as PMNode } from 'prosemirror-model';
|
|
5
5
|
import type { OverflowShadowProps } from '@atlaskit/editor-common/ui';
|
|
6
6
|
import { TableLayout } from '@atlaskit/adf-schema';
|
|
7
|
+
import { RendererAppearance } from '../../../ui/Renderer/types';
|
|
7
8
|
export type StickyMode = 'none' | 'stick' | 'pin-bottom';
|
|
8
9
|
export declare const tableStickyPadding = 8;
|
|
9
10
|
interface FixedProps {
|
|
10
11
|
top?: number;
|
|
11
12
|
wrapperWidth: number;
|
|
12
13
|
mode: StickyMode;
|
|
14
|
+
rendererAppearance: RendererAppearance;
|
|
13
15
|
}
|
|
14
16
|
export declare const FixedTableDiv: React.FC<FixedProps>;
|
|
15
17
|
export type StickyTableProps = {
|
|
@@ -26,8 +28,9 @@ export type StickyTableProps = {
|
|
|
26
28
|
columnWidths?: number[];
|
|
27
29
|
renderWidth: number;
|
|
28
30
|
tableNode?: PMNode;
|
|
31
|
+
rendererAppearance: RendererAppearance;
|
|
29
32
|
} & OverflowShadowProps;
|
|
30
|
-
export declare const StickyTable: ({ top, left, mode, shadowClassNames, innerRef, wrapperWidth, tableWidth, isNumberColumnEnabled, layout, children, columnWidths, renderWidth, rowHeight, tableNode, }: StickyTableProps) => jsx.JSX.Element;
|
|
33
|
+
export declare const StickyTable: ({ top, left, mode, shadowClassNames, innerRef, wrapperWidth, tableWidth, isNumberColumnEnabled, layout, children, columnWidths, renderWidth, rowHeight, tableNode, rendererAppearance, }: StickyTableProps) => jsx.JSX.Element;
|
|
31
34
|
export declare class OverflowParent {
|
|
32
35
|
private ref;
|
|
33
36
|
private constructor();
|
|
@@ -4,4 +4,4 @@ export type TableProps = SharedTableProps & {
|
|
|
4
4
|
innerRef?: React.RefObject<HTMLTableElement>;
|
|
5
5
|
children: React.ReactNode[];
|
|
6
6
|
};
|
|
7
|
-
export declare const Table: React.MemoExoticComponent<({ innerRef, isNumberColumnEnabled, columnWidths, layout, renderWidth, children, tableNode, }: TableProps) => JSX.Element>;
|
|
7
|
+
export declare const Table: React.MemoExoticComponent<({ innerRef, isNumberColumnEnabled, columnWidths, layout, renderWidth, children, tableNode, rendererAppearance, }: TableProps) => JSX.Element>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Node as PMNode } from 'prosemirror-model';
|
|
2
2
|
import { TableLayout } from '@atlaskit/adf-schema';
|
|
3
|
+
import { RendererAppearance } from '../../../ui/Renderer/types';
|
|
3
4
|
export type SharedTableProps = {
|
|
4
5
|
columnWidths?: Array<number>;
|
|
5
6
|
layout: TableLayout;
|
|
6
7
|
isNumberColumnEnabled: boolean;
|
|
7
8
|
renderWidth: number;
|
|
8
9
|
tableNode?: PMNode;
|
|
10
|
+
rendererAppearance: RendererAppearance;
|
|
9
11
|
};
|
|
@@ -6,6 +6,7 @@ import { RendererAppearance, StickyHeaderConfig } from '../../ui/Renderer/types'
|
|
|
6
6
|
import { WithSmartCardStorageProps } from '../../ui/SmartCardStorage';
|
|
7
7
|
import { StickyMode, OverflowParent } from './table/sticky';
|
|
8
8
|
import { SharedTableProps } from './table/types';
|
|
9
|
+
export declare const isTableResizingEnabled: (appearance: RendererAppearance) => boolean;
|
|
9
10
|
export type TableProps = SharedTableProps & {
|
|
10
11
|
children: React.ReactElement<any> | Array<React.ReactElement<any>>;
|
|
11
12
|
tableNode?: PMNode;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RendererAppearance } from '../../ui/Renderer/types';
|
|
2
|
+
export declare const isFullWidthAppearance: (appearance: RendererAppearance) => boolean;
|
|
3
|
+
export declare const isFullPageAppearance: (appearance: RendererAppearance) => boolean;
|
|
4
|
+
export declare const isFullWidthOrFullPageAppearance: (appearance: RendererAppearance) => boolean;
|
|
@@ -4,12 +4,14 @@ import { jsx } from '@emotion/react';
|
|
|
4
4
|
import { Node as PMNode } from 'prosemirror-model';
|
|
5
5
|
import type { OverflowShadowProps } from '@atlaskit/editor-common/ui';
|
|
6
6
|
import { TableLayout } from '@atlaskit/adf-schema';
|
|
7
|
+
import { RendererAppearance } from '../../../ui/Renderer/types';
|
|
7
8
|
export type StickyMode = 'none' | 'stick' | 'pin-bottom';
|
|
8
9
|
export declare const tableStickyPadding = 8;
|
|
9
10
|
interface FixedProps {
|
|
10
11
|
top?: number;
|
|
11
12
|
wrapperWidth: number;
|
|
12
13
|
mode: StickyMode;
|
|
14
|
+
rendererAppearance: RendererAppearance;
|
|
13
15
|
}
|
|
14
16
|
export declare const FixedTableDiv: React.FC<FixedProps>;
|
|
15
17
|
export type StickyTableProps = {
|
|
@@ -26,8 +28,9 @@ export type StickyTableProps = {
|
|
|
26
28
|
columnWidths?: number[];
|
|
27
29
|
renderWidth: number;
|
|
28
30
|
tableNode?: PMNode;
|
|
31
|
+
rendererAppearance: RendererAppearance;
|
|
29
32
|
} & OverflowShadowProps;
|
|
30
|
-
export declare const StickyTable: ({ top, left, mode, shadowClassNames, innerRef, wrapperWidth, tableWidth, isNumberColumnEnabled, layout, children, columnWidths, renderWidth, rowHeight, tableNode, }: StickyTableProps) => jsx.JSX.Element;
|
|
33
|
+
export declare const StickyTable: ({ top, left, mode, shadowClassNames, innerRef, wrapperWidth, tableWidth, isNumberColumnEnabled, layout, children, columnWidths, renderWidth, rowHeight, tableNode, rendererAppearance, }: StickyTableProps) => jsx.JSX.Element;
|
|
31
34
|
export declare class OverflowParent {
|
|
32
35
|
private ref;
|
|
33
36
|
private constructor();
|
|
@@ -4,4 +4,4 @@ export type TableProps = SharedTableProps & {
|
|
|
4
4
|
innerRef?: React.RefObject<HTMLTableElement>;
|
|
5
5
|
children: React.ReactNode[];
|
|
6
6
|
};
|
|
7
|
-
export declare const Table: React.MemoExoticComponent<({ innerRef, isNumberColumnEnabled, columnWidths, layout, renderWidth, children, tableNode, }: TableProps) => JSX.Element>;
|
|
7
|
+
export declare const Table: React.MemoExoticComponent<({ innerRef, isNumberColumnEnabled, columnWidths, layout, renderWidth, children, tableNode, rendererAppearance, }: TableProps) => JSX.Element>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Node as PMNode } from 'prosemirror-model';
|
|
2
2
|
import { TableLayout } from '@atlaskit/adf-schema';
|
|
3
|
+
import { RendererAppearance } from '../../../ui/Renderer/types';
|
|
3
4
|
export type SharedTableProps = {
|
|
4
5
|
columnWidths?: Array<number>;
|
|
5
6
|
layout: TableLayout;
|
|
6
7
|
isNumberColumnEnabled: boolean;
|
|
7
8
|
renderWidth: number;
|
|
8
9
|
tableNode?: PMNode;
|
|
10
|
+
rendererAppearance: RendererAppearance;
|
|
9
11
|
};
|
|
@@ -6,6 +6,7 @@ import { RendererAppearance, StickyHeaderConfig } from '../../ui/Renderer/types'
|
|
|
6
6
|
import { WithSmartCardStorageProps } from '../../ui/SmartCardStorage';
|
|
7
7
|
import { StickyMode, OverflowParent } from './table/sticky';
|
|
8
8
|
import { SharedTableProps } from './table/types';
|
|
9
|
+
export declare const isTableResizingEnabled: (appearance: RendererAppearance) => boolean;
|
|
9
10
|
export type TableProps = SharedTableProps & {
|
|
10
11
|
children: React.ReactElement<any> | Array<React.ReactElement<any>>;
|
|
11
12
|
tableNode?: PMNode;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RendererAppearance } from '../../ui/Renderer/types';
|
|
2
|
+
export declare const isFullWidthAppearance: (appearance: RendererAppearance) => boolean;
|
|
3
|
+
export declare const isFullPageAppearance: (appearance: RendererAppearance) => boolean;
|
|
4
|
+
export declare const isFullWidthOrFullPageAppearance: (appearance: RendererAppearance) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "108.7.
|
|
3
|
+
"version": "108.7.3",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"@atlaskit/editor-palette": "1.5.1",
|
|
37
37
|
"@atlaskit/editor-shared-styles": "^2.4.0",
|
|
38
38
|
"@atlaskit/emoji": "^67.4.0",
|
|
39
|
+
"@atlaskit/enforce-peer-dependencies": "^1.0.1",
|
|
39
40
|
"@atlaskit/icon": "^21.12.0",
|
|
40
41
|
"@atlaskit/link-datasource": "^0.28.0",
|
|
41
42
|
"@atlaskit/media-card": "^76.1.0",
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
"@atlaskit/status": "^1.3.0",
|
|
50
51
|
"@atlaskit/task-decision": "^17.7.0",
|
|
51
52
|
"@atlaskit/theme": "^12.5.0",
|
|
52
|
-
"@atlaskit/tokens": "^1.
|
|
53
|
+
"@atlaskit/tokens": "^1.13.0",
|
|
53
54
|
"@atlaskit/tooltip": "^17.8.0",
|
|
54
55
|
"@babel/runtime": "^7.0.0",
|
|
55
56
|
"@emotion/react": "^11.7.1",
|
|
@@ -72,7 +73,7 @@
|
|
|
72
73
|
"@af/visual-regression": "*",
|
|
73
74
|
"@atlaskit/analytics-gas-types": "^5.1.0",
|
|
74
75
|
"@atlaskit/css-reset": "^6.5.0",
|
|
75
|
-
"@atlaskit/editor-core": "^
|
|
76
|
+
"@atlaskit/editor-core": "^187.2.0",
|
|
76
77
|
"@atlaskit/editor-test-helpers": "^18.10.0",
|
|
77
78
|
"@atlaskit/link-provider": "^1.6.0",
|
|
78
79
|
"@atlaskit/link-test-helpers": "^4.1.0",
|
|
@@ -122,5 +123,8 @@
|
|
|
122
123
|
"platform.editor.custom-table-width": {
|
|
123
124
|
"type": "boolean"
|
|
124
125
|
}
|
|
126
|
+
},
|
|
127
|
+
"scripts": {
|
|
128
|
+
"postinstall": "npx enforce-peer-dependencies --internal-packages"
|
|
125
129
|
}
|
|
126
130
|
}
|