@atlaskit/renderer 128.11.1 → 130.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/dist/cjs/messages.js +4 -4
- package/dist/cjs/react/hooks/use-bidi-warnings.js +2 -2
- package/dist/cjs/react/marks/code.js +2 -2
- package/dist/cjs/react/nodes/codeBlock/codeBlock.js +2 -2
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockCopyButton.js +2 -2
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockWrapButton.js +2 -2
- package/dist/cjs/react/nodes/date.js +2 -2
- package/dist/cjs/react/nodes/heading-anchor.js +2 -2
- package/dist/cjs/react/nodes/mediaInline.js +2 -2
- package/dist/cjs/react/nodes/mediaSingle/index.js +2 -2
- package/dist/cjs/react/nodes/table/content-mode.js +71 -0
- package/dist/cjs/react/nodes/table/table.js +9 -0
- package/dist/cjs/react/nodes/table.js +19 -6
- package/dist/cjs/react/nodes/tableCell.js +2 -2
- package/dist/cjs/react/nodes/tableNew.js +11 -2
- package/dist/cjs/ui/Expand.js +2 -2
- package/dist/cjs/ui/Renderer/RendererStyleContainer.js +13 -1
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/cjs/ui/annotations/element/mark.js +2 -2
- package/dist/es2019/messages.js +1 -1
- package/dist/es2019/react/hooks/use-bidi-warnings.js +1 -1
- package/dist/es2019/react/marks/code.js +1 -1
- package/dist/es2019/react/nodes/codeBlock/codeBlock.js +1 -1
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockCopyButton.js +1 -1
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockWrapButton.js +1 -1
- package/dist/es2019/react/nodes/date.js +1 -1
- package/dist/es2019/react/nodes/heading-anchor.js +1 -1
- package/dist/es2019/react/nodes/mediaInline.js +1 -1
- package/dist/es2019/react/nodes/mediaSingle/index.js +1 -1
- package/dist/es2019/react/nodes/table/content-mode.js +67 -0
- package/dist/es2019/react/nodes/table/table.js +9 -0
- package/dist/es2019/react/nodes/table.js +14 -1
- package/dist/es2019/react/nodes/tableCell.js +1 -1
- package/dist/es2019/react/nodes/tableNew.js +10 -0
- package/dist/es2019/ui/Expand.js +1 -1
- package/dist/es2019/ui/Renderer/RendererStyleContainer.js +18 -1
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/es2019/ui/annotations/element/mark.js +1 -1
- package/dist/esm/messages.js +1 -1
- package/dist/esm/react/hooks/use-bidi-warnings.js +1 -1
- package/dist/esm/react/marks/code.js +1 -1
- package/dist/esm/react/nodes/codeBlock/codeBlock.js +1 -1
- package/dist/esm/react/nodes/codeBlock/components/codeBlockCopyButton.js +1 -1
- package/dist/esm/react/nodes/codeBlock/components/codeBlockWrapButton.js +1 -1
- package/dist/esm/react/nodes/date.js +1 -1
- package/dist/esm/react/nodes/heading-anchor.js +1 -1
- package/dist/esm/react/nodes/mediaInline.js +1 -1
- package/dist/esm/react/nodes/mediaSingle/index.js +1 -1
- package/dist/esm/react/nodes/table/content-mode.js +65 -0
- package/dist/esm/react/nodes/table/table.js +9 -0
- package/dist/esm/react/nodes/table.js +18 -5
- package/dist/esm/react/nodes/tableCell.js +1 -1
- package/dist/esm/react/nodes/tableNew.js +11 -2
- package/dist/esm/ui/Expand.js +1 -1
- package/dist/esm/ui/Renderer/RendererStyleContainer.js +13 -1
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/esm/ui/annotations/element/mark.js +1 -1
- package/dist/types/react/marks/code.d.ts +2 -2
- package/dist/types/react/nodes/codeBlock/codeBlock.d.ts +2 -2
- package/dist/types/react/nodes/codeBlock/components/codeBlockCopyButton.d.ts +2 -2
- package/dist/types/react/nodes/codeBlock/components/codeBlockWrapButton.d.ts +2 -2
- package/dist/types/react/nodes/date.d.ts +2 -2
- package/dist/types/react/nodes/heading-anchor.d.ts +2 -2
- package/dist/types/react/nodes/index.d.ts +5 -5
- package/dist/types/react/nodes/mediaInline.d.ts +2 -2
- package/dist/types/react/nodes/mediaSingle/index.d.ts +2 -2
- package/dist/types/react/nodes/table/content-mode.d.ts +34 -0
- package/dist/types/ui/Expand.d.ts +2 -2
- package/dist/types-ts4.5/react/marks/code.d.ts +2 -2
- package/dist/types-ts4.5/react/nodes/codeBlock/codeBlock.d.ts +2 -2
- package/dist/types-ts4.5/react/nodes/codeBlock/components/codeBlockCopyButton.d.ts +2 -2
- package/dist/types-ts4.5/react/nodes/codeBlock/components/codeBlockWrapButton.d.ts +2 -2
- package/dist/types-ts4.5/react/nodes/date.d.ts +2 -2
- package/dist/types-ts4.5/react/nodes/heading-anchor.d.ts +2 -2
- package/dist/types-ts4.5/react/nodes/index.d.ts +5 -5
- package/dist/types-ts4.5/react/nodes/mediaInline.d.ts +2 -2
- package/dist/types-ts4.5/react/nodes/mediaSingle/index.d.ts +2 -2
- package/dist/types-ts4.5/react/nodes/table/content-mode.d.ts +34 -0
- package/dist/types-ts4.5/ui/Expand.d.ts +2 -2
- package/package.json +15 -14
|
@@ -7,7 +7,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
7
7
|
import { default as React, Fragment, useCallback, useContext, useMemo, useEffect } from 'react';
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
|
-
import { injectIntl } from 'react-intl
|
|
10
|
+
import { injectIntl } from 'react-intl';
|
|
11
11
|
import { MediaSingle as UIMediaSingle, WidthContext } from '@atlaskit/editor-common/ui';
|
|
12
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
13
|
import { akEditorFullWidthLayoutWidth, akEditorDefaultLayoutWidth, akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
2
|
+
/**
|
|
3
|
+
* Checks whether any cell in the first row of the table has a colwidth attribute set.
|
|
4
|
+
*
|
|
5
|
+
* This mirrors `hasTableColumnBeenResized` from editor-plugin-table's `colgroup.ts`.
|
|
6
|
+
*/
|
|
7
|
+
export const hasColWidths = tableNode => {
|
|
8
|
+
const firstRow = tableNode.content.firstChild;
|
|
9
|
+
if (!firstRow) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
for (let i = 0; i < firstRow.childCount; i++) {
|
|
13
|
+
if (firstRow.child(i).attrs.colwidth) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Mirrors `isContentModeSupported()` from editor-plugin-table's `tableMode.ts`.
|
|
21
|
+
*
|
|
22
|
+
* In the editor this checks `allowColumnResizing && allowTableResizing && isFullPageEditor`.
|
|
23
|
+
* In the renderer there is no separate `allowColumnResizing` flag — `allowTableResizing`
|
|
24
|
+
* covers both — and `isFullPageEditor` maps to `rendererAppearance === 'full-page'`.
|
|
25
|
+
*/
|
|
26
|
+
const isContentModeSupported = ({
|
|
27
|
+
allowTableResizing,
|
|
28
|
+
rendererAppearance
|
|
29
|
+
}) => {
|
|
30
|
+
return !!allowTableResizing && (rendererAppearance === 'full-page' || rendererAppearance === 'full-width' || rendererAppearance === 'max');
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Determines whether a table should render in content mode.
|
|
35
|
+
*
|
|
36
|
+
* Content mode tables have no fixed column widths — the browser sizes columns to fit their
|
|
37
|
+
* content (table-layout: auto). A table is in content mode when:
|
|
38
|
+
*
|
|
39
|
+
* 1. The feature is supported (table resizing enabled, full-page appearance)
|
|
40
|
+
* 2. The table is at the top level of the document (not nested in another table or block node)
|
|
41
|
+
* 3. The table node exists
|
|
42
|
+
* 4. `table.attrs.width` is null (no explicit width set by the user)
|
|
43
|
+
* 5. No cells in the first row have `colwidth` set (table has not been column-resized)
|
|
44
|
+
* 6. The `platform_editor_table_fit_to_content_auto_convert` experiment is enabled
|
|
45
|
+
*
|
|
46
|
+
* This mirrors `isTableInContentMode()` from editor-plugin-table's `tableMode.ts`.
|
|
47
|
+
*
|
|
48
|
+
* SSR-safe: `expValEquals` returns false on the server (FeatureGates not initialised),
|
|
49
|
+
* so content mode is never active during SSR — no hydration mismatch.
|
|
50
|
+
*/
|
|
51
|
+
export const isTableInContentMode = ({
|
|
52
|
+
tableNode,
|
|
53
|
+
allowTableResizing,
|
|
54
|
+
rendererAppearance,
|
|
55
|
+
isTableNested
|
|
56
|
+
}) => {
|
|
57
|
+
if (!expValEqualsNoExposure('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true)) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
if (!tableNode) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
return !isTableNested && isContentModeSupported({
|
|
64
|
+
allowTableResizing,
|
|
65
|
+
rendererAppearance
|
|
66
|
+
}) && tableNode.attrs.width === null && !hasColWidths(tableNode) && tableNode.attrs.layout === 'align-start';
|
|
67
|
+
};
|
|
@@ -4,6 +4,8 @@ import { Colgroup, colWidthSum } from './colgroup';
|
|
|
4
4
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
5
5
|
import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
|
+
import { isTableInContentMode } from './content-mode';
|
|
7
9
|
export const Table = /*#__PURE__*/React.memo(({
|
|
8
10
|
innerRef,
|
|
9
11
|
isNumberColumnEnabled,
|
|
@@ -45,6 +47,12 @@ export const Table = /*#__PURE__*/React.memo(({
|
|
|
45
47
|
}
|
|
46
48
|
const tableLayout = tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.layout;
|
|
47
49
|
const tableDisplayMode = tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.displayMode;
|
|
50
|
+
const isContentMode = isTableInContentMode({
|
|
51
|
+
tableNode,
|
|
52
|
+
allowTableResizing,
|
|
53
|
+
rendererAppearance,
|
|
54
|
+
isTableNested: isInsideOfBlockNode || isInsideOfTable
|
|
55
|
+
}) && expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true);
|
|
48
56
|
return /*#__PURE__*/React.createElement("table", _extends({}, fg('platform_renderer_isPresentational') && {
|
|
49
57
|
role: isPresentational ? 'presentation' : undefined
|
|
50
58
|
}, {
|
|
@@ -53,6 +61,7 @@ export const Table = /*#__PURE__*/React.memo(({
|
|
|
53
61
|
"data-table-width": tableWidth,
|
|
54
62
|
"data-layout": tableLayout,
|
|
55
63
|
"data-table-display-mode": tableDisplayMode,
|
|
64
|
+
"data-initial-width-mode": isContentMode ? 'content' : undefined,
|
|
56
65
|
ref: innerRef,
|
|
57
66
|
style: {
|
|
58
67
|
marginTop: fixTableSSRResizing ? '0px' : ''
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { useIntl } from 'react-intl
|
|
4
|
+
import { useIntl } from 'react-intl';
|
|
5
5
|
import { TableSharedCssClassName, tableMarginTop } from '@atlaskit/editor-common/styles';
|
|
6
6
|
import { tableMessages } from '@atlaskit/editor-common/messages';
|
|
7
7
|
import { WidthConsumer, overflowShadow } from '@atlaskit/editor-common/ui';
|
|
@@ -20,6 +20,7 @@ import { isCommentAppearance, isFullPageAppearance, isFullWidthAppearance, isFul
|
|
|
20
20
|
import { TableStickyScrollbar } from './TableStickyScrollbar';
|
|
21
21
|
import { TableProcessorWithContainerStyles } from './tableNew';
|
|
22
22
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
23
|
+
import { isTableInContentMode } from './table/content-mode';
|
|
23
24
|
export const isTableResizingEnabled = appearance => isFullWidthOrFullPageAppearance(appearance) || isCommentAppearance(appearance);
|
|
24
25
|
export const isStickyScrollbarEnabled = appearance => isFullWidthOrFullPageAppearance(appearance) && editorExperiment('platform_renderer_table_sticky_scrollbar', true, {
|
|
25
26
|
exposure: true
|
|
@@ -461,15 +462,27 @@ export class TableContainer extends React.Component {
|
|
|
461
462
|
// instead of 760 that was set on tableNode when the table had been published.
|
|
462
463
|
finalTableContainerWidth = ((tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.layout) === 'align-start' || (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.layout) === 'center') && tableNode !== null && tableNode !== void 0 && tableNode.attrs.width ? fixTableSSRResizing ? `calc(${tableWidthCSS})` : tableWidth : 'inherit';
|
|
463
464
|
}
|
|
465
|
+
const isContentModeTable = isTableInContentMode({
|
|
466
|
+
tableNode,
|
|
467
|
+
allowTableResizing,
|
|
468
|
+
rendererAppearance,
|
|
469
|
+
isTableNested: isInsideOfBlockNode || isInsideOfTable
|
|
470
|
+
}) && expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true);
|
|
464
471
|
let style;
|
|
465
472
|
if (fixTableSSRResizing) {
|
|
466
473
|
style = {
|
|
474
|
+
...(isContentModeTable && {
|
|
475
|
+
'--renderer-table-max-width': renderWidthCSS
|
|
476
|
+
}),
|
|
467
477
|
width: finalTableContainerWidth,
|
|
468
478
|
left: leftCSS ? `calc(${leftCSS})` : undefined,
|
|
469
479
|
marginLeft: shouldCalculateLeftForAlignment && leftCSS !== undefined ? `calc(-1 * (${leftCSS}))` : undefined
|
|
470
480
|
};
|
|
471
481
|
} else {
|
|
472
482
|
style = {
|
|
483
|
+
...(isContentModeTable && {
|
|
484
|
+
'--renderer-table-max-width': `${renderWidth}px`
|
|
485
|
+
}),
|
|
473
486
|
width: finalTableContainerWidth,
|
|
474
487
|
left: left,
|
|
475
488
|
marginLeft: shouldCalculateLeftForAlignment && left !== undefined ? -left : undefined
|
|
@@ -8,7 +8,7 @@ import { SortingIcon } from '@atlaskit/editor-common/table';
|
|
|
8
8
|
import { MODE, PLATFORM } from '../../analytics/events';
|
|
9
9
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
10
10
|
import { RendererCssClassName } from '../../consts';
|
|
11
|
-
import { useIntl } from 'react-intl
|
|
11
|
+
import { useIntl } from 'react-intl';
|
|
12
12
|
import { tableCellMessages } from '../../messages';
|
|
13
13
|
const IgnoreSorting = ['LABEL', 'INPUT'];
|
|
14
14
|
const nextStatusOrder = currentSortOrder => {
|
|
@@ -15,6 +15,7 @@ import { Table } from './table/table';
|
|
|
15
15
|
import { isCommentAppearance, isFullWidthOrFullPageAppearance, isFullWidthAppearance, isMaxWidthAppearance, isFullPageAppearance } from '../utils/appearance';
|
|
16
16
|
import { TableStickyScrollbar } from './TableStickyScrollbar';
|
|
17
17
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
18
|
+
import { isTableInContentMode } from './table/content-mode';
|
|
18
19
|
const stickyContainerBaseStyles = {
|
|
19
20
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
20
21
|
height: "var(--ds-space-250, 20px)",
|
|
@@ -421,7 +422,16 @@ export class TableContainer extends React.Component {
|
|
|
421
422
|
// instead of 760 that was set on tableNode when the table had been published.
|
|
422
423
|
finalTableContainerWidth = ((tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.layout) === 'align-start' || (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.layout) === 'center') && tableNode !== null && tableNode !== void 0 && tableNode.attrs.width ? `calc(${tableWidthCSS})` : 'inherit';
|
|
423
424
|
}
|
|
425
|
+
const isContentModeTable = isTableInContentMode({
|
|
426
|
+
tableNode,
|
|
427
|
+
allowTableResizing,
|
|
428
|
+
rendererAppearance,
|
|
429
|
+
isTableNested: isInsideOfBlockNode || isInsideOfTable
|
|
430
|
+
}) && expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true);
|
|
424
431
|
const style = {
|
|
432
|
+
...(isContentModeTable && {
|
|
433
|
+
'--renderer-table-max-width': renderWidthCSS
|
|
434
|
+
}),
|
|
425
435
|
width: finalTableContainerWidth,
|
|
426
436
|
left: leftCSS ? `calc(${leftCSS})` : undefined,
|
|
427
437
|
marginLeft: shouldCalculateLeftForAlignment && leftCSS !== undefined ? `calc(-1 * (${leftCSS}))` : undefined
|
package/dist/es2019/ui/Expand.js
CHANGED
|
@@ -13,7 +13,7 @@ import ChevronRightIcon from '@atlaskit/icon/core/chevron-right';
|
|
|
13
13
|
import Tooltip from '@atlaskit/tooltip';
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import _uniqueId from 'lodash/uniqueId';
|
|
16
|
-
import { injectIntl } from 'react-intl
|
|
16
|
+
import { injectIntl } from 'react-intl';
|
|
17
17
|
import { MODE, PLATFORM } from '../analytics/events';
|
|
18
18
|
import { ActiveHeaderIdConsumer } from './active-header-id-provider';
|
|
19
19
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
@@ -1766,6 +1766,10 @@ const tableSharedStyle = css({
|
|
|
1766
1766
|
'&[data-autosize="true"]': {
|
|
1767
1767
|
tableLayout: 'auto'
|
|
1768
1768
|
},
|
|
1769
|
+
'&[data-initial-width-mode="content"]': {
|
|
1770
|
+
tableLayout: 'auto',
|
|
1771
|
+
width: 'auto'
|
|
1772
|
+
},
|
|
1769
1773
|
'*': {
|
|
1770
1774
|
boxSizing: 'border-box'
|
|
1771
1775
|
},
|
|
@@ -1878,6 +1882,19 @@ const tableSharedStyle = css({
|
|
|
1878
1882
|
}
|
|
1879
1883
|
}
|
|
1880
1884
|
});
|
|
1885
|
+
const tableContentModeStyles = css({
|
|
1886
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
1887
|
+
[`.${RendererCssClassName.DOCUMENT} .${TableSharedCssClassName.TABLE_CONTAINER}:has(table[data-initial-width-mode="content"])`]: {
|
|
1888
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
1889
|
+
width: 'max-content !important',
|
|
1890
|
+
maxWidth: 'var(--renderer-table-max-width)'
|
|
1891
|
+
},
|
|
1892
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
1893
|
+
[`.${RendererCssClassName.DOCUMENT} table[data-initial-width-mode="content"] > colgroup > col`]: {
|
|
1894
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
1895
|
+
width: 'unset !important'
|
|
1896
|
+
}
|
|
1897
|
+
});
|
|
1881
1898
|
const tableRendererHeaderStylesForTableCellOnly = css({
|
|
1882
1899
|
[`.${TableSharedCssClassName.TABLE_CONTAINER} > table,
|
|
1883
1900
|
.${TableSharedCssClassName.TABLE_NODE_WRAPPER} > table,
|
|
@@ -2612,7 +2629,7 @@ export const RendererStyleContainer = props => {
|
|
|
2612
2629
|
// this should be placed after baseOtherStyles
|
|
2613
2630
|
expValEquals('platform_editor_render_bodied_extension_as_inline', 'isEnabled', true) && (expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? extensionAsInlineStyle : oldExtensionAsInlineStyle), inlineExtensionRendererMarginFix, allowNestedHeaderLinks && (expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? alignedHeadingAnchorStyle : alignedHeadingAnchorStyleDuplicateAnchor), mediaSingleSharedStyle,
|
|
2614
2631
|
// merge firstWrappedMediaStyles with mediaSingleSharedStyle when clean up platform_editor_fix_media_in_renderer
|
|
2615
|
-
fg('platform_editor_fix_media_in_renderer') && firstWrappedMediaStyles, tableSharedStyle, tableRendererHeaderStylesForTableCellOnly, fg('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, fg('platform_editor_nested_dnd_styles_changes') ? firstNodeWithNotMarginTopWithNestedDnD : firstNodeWithNotMarginTop, rendererTableStyles, isStickyScrollbarEnabled(appearance) && stickyScrollbarStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && allowNestedHeaderLinks && (expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks : rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinksDuplicateAnchor), rendererTableColumnStyles, stickyHeaderStyles, codeBlockAndLayoutStyles, columnLayoutSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveRendererStyles, isAdvancedLayoutsOn && layoutSectionForAdvancedLayoutsStyles, !useBlockRenderForCodeBlock && gridRenderForCodeBlockStyles, browser.safari && codeBlockInListSafariFixStyles, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, (appearance === 'full-width' || appearance === 'max' && (expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true))) && responsiveBreakoutWidthFullWidth, expValEquals('platform_editor_lovability_emoji_scaling', 'isEnabled', true) ? isCompactModeEnabled ? scaledDenseEmojiStyles : scaledEmojiStyles : isCompactModeEnabled ? denseStyles : undefined, editorExperiment('platform_synced_block', true) && syncBlockStyles, centerWrapperStyles, editorExperiment('platform_synced_block', true) && isInsideSyncBlock && fg('platform_synced_block_patch_9') ? syncBlockRendererStyles : null, expValEquals('platform_editor_hide_extension_renderer_support', 'isEnabled', true) && hideExtensionStyles],
|
|
2632
|
+
fg('platform_editor_fix_media_in_renderer') && firstWrappedMediaStyles, tableSharedStyle, expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && tableContentModeStyles, tableRendererHeaderStylesForTableCellOnly, fg('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, fg('platform_editor_nested_dnd_styles_changes') ? firstNodeWithNotMarginTopWithNestedDnD : firstNodeWithNotMarginTop, rendererTableStyles, isStickyScrollbarEnabled(appearance) && stickyScrollbarStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && allowNestedHeaderLinks && (expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks : rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinksDuplicateAnchor), rendererTableColumnStyles, stickyHeaderStyles, codeBlockAndLayoutStyles, columnLayoutSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveRendererStyles, isAdvancedLayoutsOn && layoutSectionForAdvancedLayoutsStyles, !useBlockRenderForCodeBlock && gridRenderForCodeBlockStyles, browser.safari && codeBlockInListSafariFixStyles, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, (appearance === 'full-width' || appearance === 'max' && (expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true))) && responsiveBreakoutWidthFullWidth, expValEquals('platform_editor_lovability_emoji_scaling', 'isEnabled', true) ? isCompactModeEnabled ? scaledDenseEmojiStyles : scaledEmojiStyles : isCompactModeEnabled ? denseStyles : undefined, editorExperiment('platform_synced_block', true) && syncBlockStyles, centerWrapperStyles, editorExperiment('platform_synced_block', true) && isInsideSyncBlock && fg('platform_synced_block_patch_9') ? syncBlockRendererStyles : null, expValEquals('platform_editor_hide_extension_renderer_support', 'isEnabled', true) && hideExtensionStyles],
|
|
2616
2633
|
"data-testid": testId
|
|
2617
2634
|
}, children);
|
|
2618
2635
|
};
|
|
@@ -57,7 +57,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
57
57
|
const TABLE_INFO_TIMEOUT = 10000;
|
|
58
58
|
const RENDER_EVENT_SAMPLE_RATE = 0.2;
|
|
59
59
|
const packageName = "@atlaskit/renderer";
|
|
60
|
-
const packageVersion = "
|
|
60
|
+
const packageVersion = "129.0.0";
|
|
61
61
|
const setAsQueryContainerStyles = css({
|
|
62
62
|
containerName: 'ak-renderer-wrapper',
|
|
63
63
|
containerType: 'inline-size'
|
|
@@ -8,7 +8,7 @@ import { useMemo, useCallback } from 'react';
|
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import { AnnotationMarkStates } from '@atlaskit/adf-schema';
|
|
10
10
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
|
-
import { useIntl } from 'react-intl
|
|
11
|
+
import { useIntl } from 'react-intl';
|
|
12
12
|
import { inlineCommentMessages } from '../../../messages';
|
|
13
13
|
import { useAnnotationManagerDispatch, useAnnotationManagerState } from '../contexts/AnnotationManagerContext';
|
|
14
14
|
const markStyles = css({
|
package/dist/esm/messages.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
2
2
|
// Entry file in package.json
|
|
3
3
|
|
|
4
|
-
import { defineMessages } from 'react-intl
|
|
4
|
+
import { defineMessages } from 'react-intl';
|
|
5
5
|
export var headingAnchorLinkMessages = defineMessages({
|
|
6
6
|
copyHeadingLinkToClipboard: {
|
|
7
7
|
id: 'fabric.editor.headingLink.copyAnchorLink',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useIntl } from 'react-intl
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
3
|
import CodeBidiWarning from '@atlaskit/code/bidi-warning';
|
|
4
4
|
import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
|
|
5
5
|
import codeBidiWarningDecorator from '@atlaskit/code/bidi-warning-decorator';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { injectIntl } from 'react-intl
|
|
3
|
+
import { injectIntl } from 'react-intl';
|
|
4
4
|
import AkCode from '@atlaskit/code/inline';
|
|
5
5
|
import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
export var isCodeMark = function isCodeMark(mark) {
|
|
@@ -6,7 +6,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
6
6
|
import { useState } from 'react';
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { jsx } from '@emotion/react';
|
|
9
|
-
import { injectIntl } from 'react-intl
|
|
9
|
+
import { injectIntl } from 'react-intl';
|
|
10
10
|
import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
11
11
|
import { CodeBlock as AkCodeBlock } from '@atlaskit/code';
|
|
12
12
|
import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
|
|
@@ -11,7 +11,7 @@ import Tooltip from '@atlaskit/tooltip';
|
|
|
11
11
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
12
12
|
import { jsx } from '@emotion/react';
|
|
13
13
|
import { useState } from 'react';
|
|
14
|
-
import { injectIntl } from 'react-intl
|
|
14
|
+
import { injectIntl } from 'react-intl';
|
|
15
15
|
import AnalyticsContext from '../../../../analytics/analyticsContext';
|
|
16
16
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../../../analytics/enums';
|
|
17
17
|
import { copyTextToClipboard } from '../../../utils/clipboard';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
|
-
import { injectIntl } from 'react-intl
|
|
7
|
+
import { injectIntl } from 'react-intl';
|
|
8
8
|
import TextWrapIcon from '@atlaskit/icon/core/text-wrap';
|
|
9
9
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
10
10
|
import { codeBlockButtonMessages } from '@atlaskit/editor-common/messages';
|
|
@@ -4,7 +4,7 @@ import React, { memo } from 'react';
|
|
|
4
4
|
import { DateSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
5
5
|
import { isPastDate, timestampToString, timestampToTaskContext } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
|
-
import { injectIntl } from 'react-intl
|
|
7
|
+
import { injectIntl } from 'react-intl';
|
|
8
8
|
import { useRendererContext } from '../../renderer-context';
|
|
9
9
|
import { useTaskItemsFormatContext } from '../../ui/TaskItemsFormatContext/TaskItemsFormatContext';
|
|
10
10
|
import { useInlineAnnotationProps } from '../../ui/annotations/element/useInlineAnnotationProps';
|
|
@@ -19,7 +19,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
19
19
|
import React from 'react';
|
|
20
20
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
21
21
|
import { css, jsx } from '@emotion/react';
|
|
22
|
-
import { injectIntl } from 'react-intl
|
|
22
|
+
import { injectIntl } from 'react-intl';
|
|
23
23
|
import LinkIcon from '@atlaskit/icon/core/link';
|
|
24
24
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
25
25
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -11,7 +11,7 @@ import { MediaInlineCard } from '@atlaskit/media-card';
|
|
|
11
11
|
import { MediaClientContext, getMediaClient } from '@atlaskit/media-client-react';
|
|
12
12
|
import { MediaInlineCardLoadingView } from '@atlaskit/media-ui';
|
|
13
13
|
import React, { useCallback, useEffect, useState, useContext } from 'react';
|
|
14
|
-
import { injectIntl } from 'react-intl
|
|
14
|
+
import { injectIntl } from 'react-intl';
|
|
15
15
|
import { getClipboardAttrs, mediaIdentifierMap } from '../../ui/MediaCard';
|
|
16
16
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
17
17
|
import { ErrorBoundary } from '../../ui/Renderer/ErrorBoundary';
|
|
@@ -8,7 +8,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
8
8
|
import { default as React, Fragment, useCallback, useContext, useMemo, useEffect } from 'react';
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
10
|
import { css, jsx } from '@emotion/react';
|
|
11
|
-
import { injectIntl } from 'react-intl
|
|
11
|
+
import { injectIntl } from 'react-intl';
|
|
12
12
|
import { MediaSingle as UIMediaSingle, WidthContext } from '@atlaskit/editor-common/ui';
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
14
|
import { akEditorFullWidthLayoutWidth, akEditorDefaultLayoutWidth, akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
2
|
+
/**
|
|
3
|
+
* Checks whether any cell in the first row of the table has a colwidth attribute set.
|
|
4
|
+
*
|
|
5
|
+
* This mirrors `hasTableColumnBeenResized` from editor-plugin-table's `colgroup.ts`.
|
|
6
|
+
*/
|
|
7
|
+
export var hasColWidths = function hasColWidths(tableNode) {
|
|
8
|
+
var firstRow = tableNode.content.firstChild;
|
|
9
|
+
if (!firstRow) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
for (var i = 0; i < firstRow.childCount; i++) {
|
|
13
|
+
if (firstRow.child(i).attrs.colwidth) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Mirrors `isContentModeSupported()` from editor-plugin-table's `tableMode.ts`.
|
|
21
|
+
*
|
|
22
|
+
* In the editor this checks `allowColumnResizing && allowTableResizing && isFullPageEditor`.
|
|
23
|
+
* In the renderer there is no separate `allowColumnResizing` flag — `allowTableResizing`
|
|
24
|
+
* covers both — and `isFullPageEditor` maps to `rendererAppearance === 'full-page'`.
|
|
25
|
+
*/
|
|
26
|
+
var isContentModeSupported = function isContentModeSupported(_ref) {
|
|
27
|
+
var allowTableResizing = _ref.allowTableResizing,
|
|
28
|
+
rendererAppearance = _ref.rendererAppearance;
|
|
29
|
+
return !!allowTableResizing && (rendererAppearance === 'full-page' || rendererAppearance === 'full-width' || rendererAppearance === 'max');
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Determines whether a table should render in content mode.
|
|
34
|
+
*
|
|
35
|
+
* Content mode tables have no fixed column widths — the browser sizes columns to fit their
|
|
36
|
+
* content (table-layout: auto). A table is in content mode when:
|
|
37
|
+
*
|
|
38
|
+
* 1. The feature is supported (table resizing enabled, full-page appearance)
|
|
39
|
+
* 2. The table is at the top level of the document (not nested in another table or block node)
|
|
40
|
+
* 3. The table node exists
|
|
41
|
+
* 4. `table.attrs.width` is null (no explicit width set by the user)
|
|
42
|
+
* 5. No cells in the first row have `colwidth` set (table has not been column-resized)
|
|
43
|
+
* 6. The `platform_editor_table_fit_to_content_auto_convert` experiment is enabled
|
|
44
|
+
*
|
|
45
|
+
* This mirrors `isTableInContentMode()` from editor-plugin-table's `tableMode.ts`.
|
|
46
|
+
*
|
|
47
|
+
* SSR-safe: `expValEquals` returns false on the server (FeatureGates not initialised),
|
|
48
|
+
* so content mode is never active during SSR — no hydration mismatch.
|
|
49
|
+
*/
|
|
50
|
+
export var isTableInContentMode = function isTableInContentMode(_ref2) {
|
|
51
|
+
var tableNode = _ref2.tableNode,
|
|
52
|
+
allowTableResizing = _ref2.allowTableResizing,
|
|
53
|
+
rendererAppearance = _ref2.rendererAppearance,
|
|
54
|
+
isTableNested = _ref2.isTableNested;
|
|
55
|
+
if (!expValEqualsNoExposure('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true)) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
if (!tableNode) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
return !isTableNested && isContentModeSupported({
|
|
62
|
+
allowTableResizing: allowTableResizing,
|
|
63
|
+
rendererAppearance: rendererAppearance
|
|
64
|
+
}) && tableNode.attrs.width === null && !hasColWidths(tableNode) && tableNode.attrs.layout === 'align-start';
|
|
65
|
+
};
|
|
@@ -4,6 +4,8 @@ import { Colgroup, colWidthSum } from './colgroup';
|
|
|
4
4
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
5
5
|
import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
|
+
import { isTableInContentMode } from './content-mode';
|
|
7
9
|
export var Table = /*#__PURE__*/React.memo(function (_ref) {
|
|
8
10
|
var _tableNode$attrs;
|
|
9
11
|
var innerRef = _ref.innerRef,
|
|
@@ -46,6 +48,12 @@ export var Table = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
46
48
|
}
|
|
47
49
|
var tableLayout = tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.layout;
|
|
48
50
|
var tableDisplayMode = tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.displayMode;
|
|
51
|
+
var isContentMode = isTableInContentMode({
|
|
52
|
+
tableNode: tableNode,
|
|
53
|
+
allowTableResizing: allowTableResizing,
|
|
54
|
+
rendererAppearance: rendererAppearance,
|
|
55
|
+
isTableNested: isInsideOfBlockNode || isInsideOfTable
|
|
56
|
+
}) && expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true);
|
|
49
57
|
return /*#__PURE__*/React.createElement("table", _extends({}, fg('platform_renderer_isPresentational') && {
|
|
50
58
|
role: isPresentational ? 'presentation' : undefined
|
|
51
59
|
}, {
|
|
@@ -54,6 +62,7 @@ export var Table = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
54
62
|
"data-table-width": tableWidth,
|
|
55
63
|
"data-layout": tableLayout,
|
|
56
64
|
"data-table-display-mode": tableDisplayMode,
|
|
65
|
+
"data-initial-width-mode": isContentMode ? 'content' : undefined,
|
|
57
66
|
ref: innerRef,
|
|
58
67
|
style: {
|
|
59
68
|
marginTop: fixTableSSRResizing ? '0px' : ''
|
|
@@ -6,13 +6,15 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
+
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; }
|
|
10
|
+
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) { _defineProperty(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; }
|
|
9
11
|
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; } } }; }
|
|
10
12
|
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; } }
|
|
11
13
|
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; }
|
|
12
14
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
13
15
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
16
|
import React from 'react';
|
|
15
|
-
import { useIntl } from 'react-intl
|
|
17
|
+
import { useIntl } from 'react-intl';
|
|
16
18
|
import { TableSharedCssClassName, tableMarginTop } from '@atlaskit/editor-common/styles';
|
|
17
19
|
import { tableMessages } from '@atlaskit/editor-common/messages';
|
|
18
20
|
import { WidthConsumer, overflowShadow } from '@atlaskit/editor-common/ui';
|
|
@@ -31,6 +33,7 @@ import { isCommentAppearance, isFullPageAppearance, isFullWidthAppearance, isFul
|
|
|
31
33
|
import { TableStickyScrollbar } from './TableStickyScrollbar';
|
|
32
34
|
import { TableProcessorWithContainerStyles } from './tableNew';
|
|
33
35
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
36
|
+
import { isTableInContentMode } from './table/content-mode';
|
|
34
37
|
export var isTableResizingEnabled = function isTableResizingEnabled(appearance) {
|
|
35
38
|
return isFullWidthOrFullPageAppearance(appearance) || isCommentAppearance(appearance);
|
|
36
39
|
};
|
|
@@ -511,19 +514,29 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
511
514
|
// instead of 760 that was set on tableNode when the table had been published.
|
|
512
515
|
finalTableContainerWidth = ((tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.layout) === 'align-start' || (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.layout) === 'center') && tableNode !== null && tableNode !== void 0 && tableNode.attrs.width ? fixTableSSRResizing ? "calc(".concat(tableWidthCSS, ")") : tableWidth : 'inherit';
|
|
513
516
|
}
|
|
517
|
+
var isContentModeTable = isTableInContentMode({
|
|
518
|
+
tableNode: tableNode,
|
|
519
|
+
allowTableResizing: allowTableResizing,
|
|
520
|
+
rendererAppearance: rendererAppearance,
|
|
521
|
+
isTableNested: isInsideOfBlockNode || isInsideOfTable
|
|
522
|
+
}) && expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true);
|
|
514
523
|
var style;
|
|
515
524
|
if (fixTableSSRResizing) {
|
|
516
|
-
style = {
|
|
525
|
+
style = _objectSpread(_objectSpread({}, isContentModeTable && {
|
|
526
|
+
'--renderer-table-max-width': renderWidthCSS
|
|
527
|
+
}), {}, {
|
|
517
528
|
width: finalTableContainerWidth,
|
|
518
529
|
left: leftCSS ? "calc(".concat(leftCSS, ")") : undefined,
|
|
519
530
|
marginLeft: shouldCalculateLeftForAlignment && leftCSS !== undefined ? "calc(-1 * (".concat(leftCSS, "))") : undefined
|
|
520
|
-
};
|
|
531
|
+
});
|
|
521
532
|
} else {
|
|
522
|
-
style = {
|
|
533
|
+
style = _objectSpread(_objectSpread({}, isContentModeTable && {
|
|
534
|
+
'--renderer-table-max-width': "".concat(renderWidth, "px")
|
|
535
|
+
}), {}, {
|
|
523
536
|
width: finalTableContainerWidth,
|
|
524
537
|
left: left,
|
|
525
538
|
marginLeft: shouldCalculateLeftForAlignment && left !== undefined ? -left : undefined
|
|
526
|
-
};
|
|
539
|
+
});
|
|
527
540
|
}
|
|
528
541
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
529
542
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -8,7 +8,7 @@ import { SortingIcon } from '@atlaskit/editor-common/table';
|
|
|
8
8
|
import { MODE, PLATFORM } from '../../analytics/events';
|
|
9
9
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
10
10
|
import { RendererCssClassName } from '../../consts';
|
|
11
|
-
import { useIntl } from 'react-intl
|
|
11
|
+
import { useIntl } from 'react-intl';
|
|
12
12
|
import { tableCellMessages } from '../../messages';
|
|
13
13
|
var IgnoreSorting = ['LABEL', 'INPUT'];
|
|
14
14
|
var nextStatusOrder = function nextStatusOrder(currentSortOrder) {
|
|
@@ -27,6 +27,7 @@ import { Table } from './table/table';
|
|
|
27
27
|
import { isCommentAppearance, isFullWidthOrFullPageAppearance, isFullWidthAppearance, isMaxWidthAppearance, isFullPageAppearance } from '../utils/appearance';
|
|
28
28
|
import { TableStickyScrollbar } from './TableStickyScrollbar';
|
|
29
29
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
30
|
+
import { isTableInContentMode } from './table/content-mode';
|
|
30
31
|
var stickyContainerBaseStyles = {
|
|
31
32
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
32
33
|
height: "var(--ds-space-250, 20px)",
|
|
@@ -471,11 +472,19 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
471
472
|
// instead of 760 that was set on tableNode when the table had been published.
|
|
472
473
|
finalTableContainerWidth = ((tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.layout) === 'align-start' || (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.layout) === 'center') && tableNode !== null && tableNode !== void 0 && tableNode.attrs.width ? "calc(".concat(tableWidthCSS, ")") : 'inherit';
|
|
473
474
|
}
|
|
474
|
-
var
|
|
475
|
+
var isContentModeTable = isTableInContentMode({
|
|
476
|
+
tableNode: tableNode,
|
|
477
|
+
allowTableResizing: allowTableResizing,
|
|
478
|
+
rendererAppearance: rendererAppearance,
|
|
479
|
+
isTableNested: isInsideOfBlockNode || isInsideOfTable
|
|
480
|
+
}) && expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true);
|
|
481
|
+
var style = _objectSpread(_objectSpread({}, isContentModeTable && {
|
|
482
|
+
'--renderer-table-max-width': renderWidthCSS
|
|
483
|
+
}), {}, {
|
|
475
484
|
width: finalTableContainerWidth,
|
|
476
485
|
left: leftCSS ? "calc(".concat(leftCSS, ")") : undefined,
|
|
477
486
|
marginLeft: shouldCalculateLeftForAlignment && leftCSS !== undefined ? "calc(-1 * (".concat(leftCSS, "))") : undefined
|
|
478
|
-
};
|
|
487
|
+
});
|
|
479
488
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
480
489
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
481
490
|
className: "".concat(TableSharedCssClassName.TABLE_CONTAINER, " ").concat(this.props.shadowClassNames || ''),
|
package/dist/esm/ui/Expand.js
CHANGED
|
@@ -14,7 +14,7 @@ import ChevronRightIcon from '@atlaskit/icon/core/chevron-right';
|
|
|
14
14
|
import Tooltip from '@atlaskit/tooltip';
|
|
15
15
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
16
|
import _uniqueId from 'lodash/uniqueId';
|
|
17
|
-
import { injectIntl } from 'react-intl
|
|
17
|
+
import { injectIntl } from 'react-intl';
|
|
18
18
|
import { MODE, PLATFORM } from '../analytics/events';
|
|
19
19
|
import { ActiveHeaderIdConsumer } from './active-header-id-provider';
|
|
20
20
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|