@atlaskit/renderer 124.2.0 → 124.4.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 +27 -0
- package/dist/cjs/react/nodes/table.js +0 -1
- package/dist/cjs/render-document.js +0 -2
- package/dist/cjs/ui/Renderer/RendererStyleContainer.js +29 -9
- package/dist/cjs/ui/Renderer/get-base-font-size.js +1 -3
- package/dist/cjs/ui/Renderer/index.js +2 -5
- package/dist/es2019/react/nodes/table.js +0 -1
- package/dist/es2019/render-document.js +0 -2
- package/dist/es2019/ui/Renderer/RendererStyleContainer.js +32 -10
- package/dist/es2019/ui/Renderer/get-base-font-size.js +2 -4
- package/dist/es2019/ui/Renderer/index.js +2 -5
- package/dist/esm/react/nodes/table.js +0 -1
- package/dist/esm/render-document.js +0 -2
- package/dist/esm/ui/Renderer/RendererStyleContainer.js +30 -10
- package/dist/esm/ui/Renderer/get-base-font-size.js +2 -4
- package/dist/esm/ui/Renderer/index.js +2 -5
- package/dist/types/index.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 124.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`2a9e8a0692fdc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2a9e8a0692fdc) -
|
|
8
|
+
[NO-ISSUE] Switch from using `cc_editor_ai_content_mode` param `baseFontSize` to having a proper
|
|
9
|
+
variable we can use for the sizing
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 124.3.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- [`1ca1552bd1837`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1ca1552bd1837) -
|
|
20
|
+
[EDITOR-2003] export RendererContentMode type from package
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- [`1e40e7f832859`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1e40e7f832859) -
|
|
25
|
+
[ux] Scale emojis in editor compact mode
|
|
26
|
+
- [`41015d65a8be4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/41015d65a8be4) -
|
|
27
|
+
[EDITOR-1992] Make table of contents text scale with dense mode
|
|
28
|
+
- Updated dependencies
|
|
29
|
+
|
|
3
30
|
## 124.2.0
|
|
4
31
|
|
|
5
32
|
### Minor Changes
|
|
@@ -714,7 +714,6 @@ var TableWithShadows = (0, _ui.overflowShadow)(TableProcessor, {
|
|
|
714
714
|
useShadowObserver: true
|
|
715
715
|
});
|
|
716
716
|
var TableWithWidth = function TableWithWidth(props) {
|
|
717
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
718
717
|
if ((0, _platformFeatureFlags.fg)('platform-ssr-table-resize')) {
|
|
719
718
|
var _props$columnWidths;
|
|
720
719
|
var colWidthsSum = ((_props$columnWidths = props.columnWidths) === null || _props$columnWidths === void 0 ? void 0 : _props$columnWidths.reduce(function (total, val) {
|
|
@@ -188,8 +188,6 @@ var renderDocument = exports.renderDocument = function renderDocument(doc, seria
|
|
|
188
188
|
var stat = {
|
|
189
189
|
sanitizeTime: 0
|
|
190
190
|
};
|
|
191
|
-
|
|
192
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
193
191
|
if ((0, _platformFeatureFlags.fg)('platform_editor_renderer_rm_usespecbasedvalidator')) {
|
|
194
192
|
useSpecBasedValidator = true;
|
|
195
193
|
}
|
|
@@ -26,6 +26,7 @@ var _table2 = require("@atlaskit/editor-common/table");
|
|
|
26
26
|
var _lightWeightCodeBlock = require("../../react/nodes/codeBlock/components/lightWeightCodeBlock");
|
|
27
27
|
var _ugcTokens = require("@atlaskit/editor-common/ugc-tokens");
|
|
28
28
|
var _getBaseFontSize = require("./get-base-font-size");
|
|
29
|
+
var _emoji = require("@atlaskit/editor-common/emoji");
|
|
29
30
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
30
31
|
var _css, _css8;
|
|
31
32
|
/* eslint-disable @atlaskit/ui-styling-standard/no-important-styles */
|
|
@@ -689,6 +690,12 @@ var codeMarkSharedStyles = (0, _react.css)({
|
|
|
689
690
|
whiteSpace: 'pre-wrap'
|
|
690
691
|
}
|
|
691
692
|
});
|
|
693
|
+
var extensionStyle = (0, _react.css)({
|
|
694
|
+
'.ak-renderer-extension *': {
|
|
695
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
696
|
+
fontSize: 'var(--ak-renderer-base-font-size)'
|
|
697
|
+
}
|
|
698
|
+
});
|
|
692
699
|
var shadowSharedStyle = (0, _react.css)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "& .".concat(_ui.shadowClassNames.RIGHT_SHADOW, "::before, .").concat(_ui.shadowClassNames.RIGHT_SHADOW, "::after, .").concat(_ui.shadowClassNames.LEFT_SHADOW, "::before, .").concat(_ui.shadowClassNames.LEFT_SHADOW, "::after"), {
|
|
693
700
|
display: 'none',
|
|
694
701
|
position: 'absolute',
|
|
@@ -1489,6 +1496,22 @@ var rendererAnnotationStylesCommentHeightFix = (0, _react.css)({
|
|
|
1489
1496
|
paddingTop: "var(--ds-space-025, 2px)"
|
|
1490
1497
|
}
|
|
1491
1498
|
});
|
|
1499
|
+
|
|
1500
|
+
// Calculate emoji size based on base font size
|
|
1501
|
+
// Default: 20px emoji at 16px base font
|
|
1502
|
+
// Scaled: 20px * (baseFontSize/16)
|
|
1503
|
+
// E.g., dense mode (13px base): 20px * (13/16) = 16.25px
|
|
1504
|
+
var denseEmojiStyles = (0, _react.css)((0, _defineProperty2.default)({}, ".".concat(_emoji.EmojiSharedCssClassName.EMOJI_IMAGE), {
|
|
1505
|
+
height: "calc(".concat(_emoji.defaultEmojiHeight, " * var(--ak-renderer-base-font-size) / ").concat(_editorSharedStyles.akEditorFullPageDefaultFontSize, ")"),
|
|
1506
|
+
width: "calc(".concat(_emoji.defaultEmojiHeight, " * var(--ak-renderer-base-font-size) / ").concat(_editorSharedStyles.akEditorFullPageDefaultFontSize, ")"),
|
|
1507
|
+
maxHeight: "calc(".concat(_emoji.defaultEmojiHeight, " * var(--ak-renderer-base-font-size) / ").concat(_editorSharedStyles.akEditorFullPageDefaultFontSize, ")"),
|
|
1508
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
1509
|
+
img: {
|
|
1510
|
+
width: '100%',
|
|
1511
|
+
height: '100%',
|
|
1512
|
+
objectFit: 'contain'
|
|
1513
|
+
}
|
|
1514
|
+
}));
|
|
1492
1515
|
var RendererStyleContainer = exports.RendererStyleContainer = function RendererStyleContainer(props) {
|
|
1493
1516
|
var onClick = props.onClick,
|
|
1494
1517
|
onMouseDown = props.onMouseDown,
|
|
@@ -1507,6 +1530,7 @@ var RendererStyleContainer = exports.RendererStyleContainer = function RendererS
|
|
|
1507
1530
|
var isPreviewPanelResponsivenessOn = (0, _experiments.editorExperiment)('platform_editor_preview_panel_responsiveness', true, {
|
|
1508
1531
|
exposure: true
|
|
1509
1532
|
});
|
|
1533
|
+
var baseFontSize = (0, _getBaseFontSize.getBaseFontSize)(appearance, contentMode);
|
|
1510
1534
|
return (
|
|
1511
1535
|
// eslint-disable-next-line @atlassian/a11y/click-events-have-key-events, @atlassian/a11y/interactive-element-not-keyboard-focusable, @atlassian/a11y/no-static-element-interactions
|
|
1512
1536
|
(0, _react.jsx)("div", {
|
|
@@ -1514,7 +1538,7 @@ var RendererStyleContainer = exports.RendererStyleContainer = function RendererS
|
|
|
1514
1538
|
onClick: onClick,
|
|
1515
1539
|
onMouseDown: onMouseDown,
|
|
1516
1540
|
style: {
|
|
1517
|
-
'--ak-renderer-base-font-size': "".concat(
|
|
1541
|
+
'--ak-renderer-base-font-size': "".concat(baseFontSize, "px"),
|
|
1518
1542
|
'--ak-renderer-editor-font-heading-h1': "".concat((0, _ugcTokens.editorUGCToken)('editor.font.heading.h1')),
|
|
1519
1543
|
'--ak-renderer-editor-font-heading-h2': "".concat((0, _ugcTokens.editorUGCToken)('editor.font.heading.h2')),
|
|
1520
1544
|
'--ak-renderer-editor-font-heading-h3': "".concat((0, _ugcTokens.editorUGCToken)('editor.font.heading.h3')),
|
|
@@ -1523,15 +1547,11 @@ var RendererStyleContainer = exports.RendererStyleContainer = function RendererS
|
|
|
1523
1547
|
'--ak-renderer-editor-font-heading-h6': "".concat((0, _ugcTokens.editorUGCToken)('editor.font.heading.h6')),
|
|
1524
1548
|
'--ak-renderer-editor-font-normal-text': "".concat((0, _ugcTokens.editorUGCToken)('editor.font.body'))
|
|
1525
1549
|
},
|
|
1526
|
-
css: [baseStyles, hideHeadingCopyLinkWrapperStyles, appearance === 'full-page' && isPreviewPanelResponsivenessOn && rendererFullPageStylesWithReducedPadding, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && rendererFullPageStyles, appearance === 'full-width' && rendererFullWidthStyles, appearance === 'full-width' && !(0, _table.isTableResizingEnabled)(appearance) && rendererFullWidthStylesForTableResizing, !(0, _platformFeatureFlags.fg)('aifc_create_enabled') && telepointerStyles, (0, _platformFeatureFlags.fg)('aifc_create_enabled') && rovoTelepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, (0, _platformFeatureFlags.fg)('platform_editor_typography_ugc') ? headingsSharedStylesWithEditorUGC : headingsSharedStyles, headingWithAlignmentStyles, ruleSharedStyles, (0, _platformFeatureFlags.fg)('platform_editor_typography_ugc') ? paragraphSharedStylesWithEditorUGC : paragraphSharedStyles, listsSharedStyles, _browser.browser.gecko && listsSharedStylesForGekko, indentationSharedStyles, (0, _platformFeatureFlags.fg)('platform_editor__renderer_indentation_text_margin') && indentationSharedStylesWithMarginFix, blockMarksSharedStyles, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles, (0, _expValEquals.expValEquals)('platform_editor_text_highlight_padding', 'isEnabled', true) &&
|
|
1550
|
+
css: [baseStyles, (0, _expValEquals.expValEquals)('cc_editor_ai_content_mode', 'variant', 'test') && (0, _platformFeatureFlags.fg)('platform_editor_content_mode_button_mvp') && denseEmojiStyles, hideHeadingCopyLinkWrapperStyles, appearance === 'full-page' && isPreviewPanelResponsivenessOn && rendererFullPageStylesWithReducedPadding, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && rendererFullPageStyles, appearance === 'full-width' && rendererFullWidthStyles, appearance === 'full-width' && !(0, _table.isTableResizingEnabled)(appearance) && rendererFullWidthStylesForTableResizing, !(0, _platformFeatureFlags.fg)('aifc_create_enabled') && telepointerStyles, (0, _platformFeatureFlags.fg)('aifc_create_enabled') && rovoTelepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, (0, _platformFeatureFlags.fg)('platform_editor_typography_ugc') ? headingsSharedStylesWithEditorUGC : headingsSharedStyles, headingWithAlignmentStyles, ruleSharedStyles, (0, _expValEquals.expValEquals)('cc_editor_ai_content_mode', 'variant', 'test') && (0, _platformFeatureFlags.fg)('platform_editor_content_mode_button_mvp') && extensionStyle, (0, _platformFeatureFlags.fg)('platform_editor_typography_ugc') ? paragraphSharedStylesWithEditorUGC : paragraphSharedStyles, listsSharedStyles, _browser.browser.gecko && listsSharedStylesForGekko, indentationSharedStyles, (0, _platformFeatureFlags.fg)('platform_editor__renderer_indentation_text_margin') && indentationSharedStylesWithMarginFix, blockMarksSharedStyles, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles, (0, _expValEquals.expValEquals)('platform_editor_text_highlight_padding', 'isEnabled', true) &&
|
|
1527
1551
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
1528
|
-
textHighlightPaddingStyles, tasksAndDecisionsStyles, smartCardStyles, smartCardStylesAvatarFix, (0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true) && headerSmartCardStyles, (0, _platformFeatureFlags.fg)('smartcard_avatar_margin_fix') && smartCardStylesAvatarMarginFix, smartCardStylesAvatarListZeroMarginTop,
|
|
1529
|
-
// eslint-disable-next-line @atlaskit/platform/
|
|
1530
|
-
(0, _platformFeatureFlags.fg)('editor_inline_comments_on_inline_nodes') &&
|
|
1531
|
-
// eslint-disable-next-line @atlaskit/platform/no-preconditioning, @atlaskit/platform/ensure-feature-flag-prefix
|
|
1532
|
-
(0, _platformFeatureFlags.fg)('editor_inline_comments_on_inline_nodes') &&
|
|
1533
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
1534
|
-
(0, _platformFeatureFlags.fg)('annotations_align_editor_and_renderer_styles') && rendererAnnotationStylesCommentHeightFix, baseOtherStyles, allowNestedHeaderLinks && alignedHeadingAnchorStyle, mediaSingleSharedStyle,
|
|
1552
|
+
textHighlightPaddingStyles, tasksAndDecisionsStyles, smartCardStyles, smartCardStylesAvatarFix, (0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true) && headerSmartCardStyles, (0, _platformFeatureFlags.fg)('smartcard_avatar_margin_fix') && smartCardStylesAvatarMarginFix, smartCardStylesAvatarListZeroMarginTop, (0, _platformFeatureFlags.fg)('editor_inline_comments_on_inline_nodes') && rendererAnnotationStyles,
|
|
1553
|
+
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
1554
|
+
(0, _platformFeatureFlags.fg)('editor_inline_comments_on_inline_nodes') && (0, _platformFeatureFlags.fg)('annotations_align_editor_and_renderer_styles') && rendererAnnotationStylesCommentHeightFix, baseOtherStyles, allowNestedHeaderLinks && alignedHeadingAnchorStyle, mediaSingleSharedStyle,
|
|
1535
1555
|
// merge firstWrappedMediaStyles with mediaSingleSharedStyle when clean up platform_editor_fix_media_in_renderer
|
|
1536
1556
|
(0, _platformFeatureFlags.fg)('platform_editor_fix_media_in_renderer') && firstWrappedMediaStyles, tableSharedStyle, tableRendererHeaderStylesForTableCellOnly, (0, _platformFeatureFlags.fg)('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, (0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') ? firstNodeWithNotMarginTopWithNestedDnD : firstNodeWithNotMarginTop, rendererTableStyles, (0, _table.isStickyScrollbarEnabled)(appearance) && stickyScrollbarStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && allowNestedHeaderLinks && rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks, (0, _platformFeatureFlags.fg)('platform_editor_tables_numbered_column_correction') ? rendererTableColumnStyles : rendererTableColumnStylesOld, stickyHeaderStyles, codeBlockAndLayoutStyles, columnLayoutSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveRendererStyles, isAdvancedLayoutsOn && layoutSectionForAdvancedLayoutsStyles, !useBlockRenderForCodeBlock && gridRenderForCodeBlockStyles, _browser.browser.safari && codeBlockInListSafariFixStyles, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, appearance === 'full-width' && responsiveBreakoutWidthFullWidth],
|
|
1537
1557
|
"data-testid": testId
|
|
@@ -5,13 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getBaseFontSize = void 0;
|
|
7
7
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
8
|
-
var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
|
|
9
8
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
10
9
|
var getBaseFontSize = exports.getBaseFontSize = function getBaseFontSize(appearance, contentMode) {
|
|
11
10
|
if ((0, _expValEquals.expValEquals)('cc_editor_ai_content_mode', 'variant', 'test')) {
|
|
12
11
|
if (contentMode === 'dense') {
|
|
13
|
-
|
|
14
|
-
return baseFontSize;
|
|
12
|
+
return _editorSharedStyles.akEditorFullPageDenseFontSize;
|
|
15
13
|
}
|
|
16
14
|
}
|
|
17
15
|
return appearance && appearance !== 'comment' ? _editorSharedStyles.akEditorFullPageDefaultFontSize : 14;
|
|
@@ -68,7 +68,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
68
68
|
// we want to calculate all the table widths (which causes reflows) after the renderer has finished loading to mitigate performance impact
|
|
69
69
|
var TABLE_WIDTH_INFO_TIMEOUT = 10000;
|
|
70
70
|
var packageName = "@atlaskit/renderer";
|
|
71
|
-
var packageVersion = "
|
|
71
|
+
var packageVersion = "124.3.0";
|
|
72
72
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
73
73
|
containerName: 'ak-renderer-wrapper',
|
|
74
74
|
containerType: 'inline-size'
|
|
@@ -692,7 +692,6 @@ var RendererWrapper = /*#__PURE__*/_react.default.memo(function (props) {
|
|
|
692
692
|
//
|
|
693
693
|
|
|
694
694
|
// allowRendererContainerStyles is not needed for comment container styling as container should always be set for comments
|
|
695
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
696
695
|
if (appearance === 'comment' && isTopLevelRenderer && (0, _platformFeatureFlags.fg)('platform-ssr-table-resize')) {
|
|
697
696
|
return (0, _react2.jsx)("div", {
|
|
698
697
|
css: setAsQueryContainerStyles
|
|
@@ -706,9 +705,7 @@ var RendererWrapper = /*#__PURE__*/_react.default.memo(function (props) {
|
|
|
706
705
|
return (appearance === 'full-page' || appearance === 'full-width') &&
|
|
707
706
|
// In case of having excerpt-include on page there are multiple renderers nested.
|
|
708
707
|
// Make sure only the root renderer is set to be query container.
|
|
709
|
-
isTopLevelRenderer && allowRendererContainerStyles &&
|
|
710
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
711
|
-
(0, _platformFeatureFlags.fg)('platform-ssr-table-resize') ? (0, _react2.jsx)("div", {
|
|
708
|
+
isTopLevelRenderer && allowRendererContainerStyles && (0, _platformFeatureFlags.fg)('platform-ssr-table-resize') ? (0, _react2.jsx)("div", {
|
|
712
709
|
css: setAsQueryContainerStyles
|
|
713
710
|
}, renderer) : renderer;
|
|
714
711
|
});
|
|
@@ -654,7 +654,6 @@ const TableWithShadows = overflowShadow(TableProcessor, {
|
|
|
654
654
|
useShadowObserver: true
|
|
655
655
|
});
|
|
656
656
|
const TableWithWidth = props => {
|
|
657
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
658
657
|
if (fg('platform-ssr-table-resize')) {
|
|
659
658
|
var _props$columnWidths;
|
|
660
659
|
const colWidthsSum = ((_props$columnWidths = props.columnWidths) === null || _props$columnWidths === void 0 ? void 0 : _props$columnWidths.reduce((total, val) => total + val, 0)) || 0;
|
|
@@ -152,8 +152,6 @@ export const renderDocument = (doc, serializer, schema = defaultSchema, adfStage
|
|
|
152
152
|
const stat = {
|
|
153
153
|
sanitizeTime: 0
|
|
154
154
|
};
|
|
155
|
-
|
|
156
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
157
155
|
if (fg('platform_editor_renderer_rm_usespecbasedvalidator')) {
|
|
158
156
|
useSpecBasedValidator = true;
|
|
159
157
|
}
|
|
@@ -13,7 +13,7 @@ import { FullPagePadding } from './style';
|
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
14
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
15
15
|
import { RendererCssClassName } from '../../consts';
|
|
16
|
-
import { akEditorBlockquoteBorderColor, akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorFullPageNarrowBreakout, akEditorGutterPaddingReduced, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorLineHeight, akEditorSelectedNodeClassName, akEditorShadowZIndex, akEditorStickyHeaderZIndex, akEditorTableBorder, akEditorTableCellMinWidth, akEditorTableNumberColumnWidth, akEditorTableToolbar, blockNodesVerticalMargin, gridMediumMaxWidth } from '@atlaskit/editor-shared-styles';
|
|
16
|
+
import { akEditorBlockquoteBorderColor, akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorFullPageNarrowBreakout, akEditorGutterPaddingReduced, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorLineHeight, akEditorSelectedNodeClassName, akEditorShadowZIndex, akEditorStickyHeaderZIndex, akEditorTableBorder, akEditorTableCellMinWidth, akEditorTableNumberColumnWidth, akEditorTableToolbar, blockNodesVerticalMargin, gridMediumMaxWidth, akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
|
|
17
17
|
import { INLINE_IMAGE_WRAPPER_CLASS_NAME } from '@atlaskit/editor-common/media-inline';
|
|
18
18
|
import { HeadingAnchorWrapperClassName } from '../../react/nodes/heading-anchor';
|
|
19
19
|
import { CodeBlockSharedCssClassName, DateSharedCssClassName, listItemCounterPadding, richMediaClassName, SmartCardSharedCssClassName, tableCellBorderWidth, tableCellMinWidth, tableCellPadding, tableMarginTop, TableSharedCssClassName, TaskDecisionSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
@@ -26,6 +26,7 @@ import { SORTABLE_COLUMN_ICON_CLASSNAME } from '@atlaskit/editor-common/table';
|
|
|
26
26
|
import { LightWeightCodeBlockCssClassName } from '../../react/nodes/codeBlock/components/lightWeightCodeBlock';
|
|
27
27
|
import { editorUGCToken } from '@atlaskit/editor-common/ugc-tokens';
|
|
28
28
|
import { getBaseFontSize } from './get-base-font-size';
|
|
29
|
+
import { defaultEmojiHeight, EmojiSharedCssClassName } from '@atlaskit/editor-common/emoji';
|
|
29
30
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
30
31
|
const wrappedMediaBreakoutPoint = 410;
|
|
31
32
|
const TELEPOINTER_ID = 'ai-streaming-telepointer';
|
|
@@ -796,6 +797,12 @@ const codeMarkSharedStyles = css({
|
|
|
796
797
|
whiteSpace: 'pre-wrap'
|
|
797
798
|
}
|
|
798
799
|
});
|
|
800
|
+
const extensionStyle = css({
|
|
801
|
+
'.ak-renderer-extension *': {
|
|
802
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
803
|
+
fontSize: 'var(--ak-renderer-base-font-size)'
|
|
804
|
+
}
|
|
805
|
+
});
|
|
799
806
|
const shadowSharedStyle = css({
|
|
800
807
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
801
808
|
[`& .${shadowClassNames.RIGHT_SHADOW}::before, .${shadowClassNames.RIGHT_SHADOW}::after, .${shadowClassNames.LEFT_SHADOW}::before, .${shadowClassNames.LEFT_SHADOW}::after`]: {
|
|
@@ -1891,6 +1898,24 @@ const rendererAnnotationStylesCommentHeightFix = css({
|
|
|
1891
1898
|
paddingTop: "var(--ds-space-025, 2px)"
|
|
1892
1899
|
}
|
|
1893
1900
|
});
|
|
1901
|
+
|
|
1902
|
+
// Calculate emoji size based on base font size
|
|
1903
|
+
// Default: 20px emoji at 16px base font
|
|
1904
|
+
// Scaled: 20px * (baseFontSize/16)
|
|
1905
|
+
// E.g., dense mode (13px base): 20px * (13/16) = 16.25px
|
|
1906
|
+
const denseEmojiStyles = css({
|
|
1907
|
+
[`.${EmojiSharedCssClassName.EMOJI_IMAGE}`]: {
|
|
1908
|
+
height: `calc(${defaultEmojiHeight} * var(--ak-renderer-base-font-size) / ${akEditorFullPageDefaultFontSize})`,
|
|
1909
|
+
width: `calc(${defaultEmojiHeight} * var(--ak-renderer-base-font-size) / ${akEditorFullPageDefaultFontSize})`,
|
|
1910
|
+
maxHeight: `calc(${defaultEmojiHeight} * var(--ak-renderer-base-font-size) / ${akEditorFullPageDefaultFontSize})`,
|
|
1911
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
1912
|
+
img: {
|
|
1913
|
+
width: '100%',
|
|
1914
|
+
height: '100%',
|
|
1915
|
+
objectFit: 'contain'
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
});
|
|
1894
1919
|
export const RendererStyleContainer = props => {
|
|
1895
1920
|
const {
|
|
1896
1921
|
onClick,
|
|
@@ -1911,6 +1936,7 @@ export const RendererStyleContainer = props => {
|
|
|
1911
1936
|
const isPreviewPanelResponsivenessOn = editorExperiment('platform_editor_preview_panel_responsiveness', true, {
|
|
1912
1937
|
exposure: true
|
|
1913
1938
|
});
|
|
1939
|
+
const baseFontSize = getBaseFontSize(appearance, contentMode);
|
|
1914
1940
|
return (
|
|
1915
1941
|
// eslint-disable-next-line @atlassian/a11y/click-events-have-key-events, @atlassian/a11y/interactive-element-not-keyboard-focusable, @atlassian/a11y/no-static-element-interactions
|
|
1916
1942
|
jsx("div", {
|
|
@@ -1918,7 +1944,7 @@ export const RendererStyleContainer = props => {
|
|
|
1918
1944
|
onClick: onClick,
|
|
1919
1945
|
onMouseDown: onMouseDown,
|
|
1920
1946
|
style: {
|
|
1921
|
-
'--ak-renderer-base-font-size': `${
|
|
1947
|
+
'--ak-renderer-base-font-size': `${baseFontSize}px`,
|
|
1922
1948
|
'--ak-renderer-editor-font-heading-h1': `${editorUGCToken('editor.font.heading.h1')}`,
|
|
1923
1949
|
'--ak-renderer-editor-font-heading-h2': `${editorUGCToken('editor.font.heading.h2')}`,
|
|
1924
1950
|
'--ak-renderer-editor-font-heading-h3': `${editorUGCToken('editor.font.heading.h3')}`,
|
|
@@ -1927,15 +1953,11 @@ export const RendererStyleContainer = props => {
|
|
|
1927
1953
|
'--ak-renderer-editor-font-heading-h6': `${editorUGCToken('editor.font.heading.h6')}`,
|
|
1928
1954
|
'--ak-renderer-editor-font-normal-text': `${editorUGCToken('editor.font.body')}`
|
|
1929
1955
|
},
|
|
1930
|
-
css: [baseStyles, hideHeadingCopyLinkWrapperStyles, appearance === 'full-page' && isPreviewPanelResponsivenessOn && rendererFullPageStylesWithReducedPadding, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && rendererFullPageStyles, appearance === 'full-width' && rendererFullWidthStyles, appearance === 'full-width' && !isTableResizingEnabled(appearance) && rendererFullWidthStylesForTableResizing, !fg('aifc_create_enabled') && telepointerStyles, fg('aifc_create_enabled') && rovoTelepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, fg('platform_editor_typography_ugc') ? headingsSharedStylesWithEditorUGC : headingsSharedStyles, headingWithAlignmentStyles, ruleSharedStyles, fg('platform_editor_typography_ugc') ? paragraphSharedStylesWithEditorUGC : paragraphSharedStyles, listsSharedStyles, browser.gecko && listsSharedStylesForGekko, indentationSharedStyles, fg('platform_editor__renderer_indentation_text_margin') && indentationSharedStylesWithMarginFix, blockMarksSharedStyles, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles, expValEquals('platform_editor_text_highlight_padding', 'isEnabled', true) &&
|
|
1956
|
+
css: [baseStyles, expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') && denseEmojiStyles, hideHeadingCopyLinkWrapperStyles, appearance === 'full-page' && isPreviewPanelResponsivenessOn && rendererFullPageStylesWithReducedPadding, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && rendererFullPageStyles, appearance === 'full-width' && rendererFullWidthStyles, appearance === 'full-width' && !isTableResizingEnabled(appearance) && rendererFullWidthStylesForTableResizing, !fg('aifc_create_enabled') && telepointerStyles, fg('aifc_create_enabled') && rovoTelepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, fg('platform_editor_typography_ugc') ? headingsSharedStylesWithEditorUGC : headingsSharedStyles, headingWithAlignmentStyles, ruleSharedStyles, expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') && extensionStyle, fg('platform_editor_typography_ugc') ? paragraphSharedStylesWithEditorUGC : paragraphSharedStyles, listsSharedStyles, browser.gecko && listsSharedStylesForGekko, indentationSharedStyles, fg('platform_editor__renderer_indentation_text_margin') && indentationSharedStylesWithMarginFix, blockMarksSharedStyles, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles, expValEquals('platform_editor_text_highlight_padding', 'isEnabled', true) &&
|
|
1931
1957
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
1932
|
-
textHighlightPaddingStyles, tasksAndDecisionsStyles, smartCardStyles, smartCardStylesAvatarFix, editorExperiment('platform_editor_preview_panel_linking_exp', true) && headerSmartCardStyles, fg('smartcard_avatar_margin_fix') && smartCardStylesAvatarMarginFix, smartCardStylesAvatarListZeroMarginTop,
|
|
1933
|
-
// eslint-disable-next-line @atlaskit/platform/
|
|
1934
|
-
fg('editor_inline_comments_on_inline_nodes') &&
|
|
1935
|
-
// eslint-disable-next-line @atlaskit/platform/no-preconditioning, @atlaskit/platform/ensure-feature-flag-prefix
|
|
1936
|
-
fg('editor_inline_comments_on_inline_nodes') &&
|
|
1937
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
1938
|
-
fg('annotations_align_editor_and_renderer_styles') && rendererAnnotationStylesCommentHeightFix, baseOtherStyles, allowNestedHeaderLinks && alignedHeadingAnchorStyle, mediaSingleSharedStyle,
|
|
1958
|
+
textHighlightPaddingStyles, tasksAndDecisionsStyles, smartCardStyles, smartCardStylesAvatarFix, editorExperiment('platform_editor_preview_panel_linking_exp', true) && headerSmartCardStyles, fg('smartcard_avatar_margin_fix') && smartCardStylesAvatarMarginFix, smartCardStylesAvatarListZeroMarginTop, fg('editor_inline_comments_on_inline_nodes') && rendererAnnotationStyles,
|
|
1959
|
+
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
1960
|
+
fg('editor_inline_comments_on_inline_nodes') && fg('annotations_align_editor_and_renderer_styles') && rendererAnnotationStylesCommentHeightFix, baseOtherStyles, allowNestedHeaderLinks && alignedHeadingAnchorStyle, mediaSingleSharedStyle,
|
|
1939
1961
|
// merge firstWrappedMediaStyles with mediaSingleSharedStyle when clean up platform_editor_fix_media_in_renderer
|
|
1940
1962
|
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 && rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks, fg('platform_editor_tables_numbered_column_correction') ? rendererTableColumnStyles : rendererTableColumnStylesOld, 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' && responsiveBreakoutWidthFullWidth],
|
|
1941
1963
|
"data-testid": testId
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
|
|
2
|
-
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
1
|
+
import { akEditorFullPageDefaultFontSize, akEditorFullPageDenseFontSize } from '@atlaskit/editor-shared-styles';
|
|
3
2
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
3
|
export const getBaseFontSize = (appearance, contentMode) => {
|
|
5
4
|
if (expValEquals('cc_editor_ai_content_mode', 'variant', 'test')) {
|
|
6
5
|
if (contentMode === 'dense') {
|
|
7
|
-
|
|
8
|
-
return baseFontSize;
|
|
6
|
+
return akEditorFullPageDenseFontSize;
|
|
9
7
|
}
|
|
10
8
|
}
|
|
11
9
|
return appearance && appearance !== 'comment' ? akEditorFullPageDefaultFontSize : 14;
|
|
@@ -54,7 +54,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
54
54
|
// we want to calculate all the table widths (which causes reflows) after the renderer has finished loading to mitigate performance impact
|
|
55
55
|
const TABLE_WIDTH_INFO_TIMEOUT = 10000;
|
|
56
56
|
const packageName = "@atlaskit/renderer";
|
|
57
|
-
const packageVersion = "
|
|
57
|
+
const packageVersion = "124.3.0";
|
|
58
58
|
const setAsQueryContainerStyles = css({
|
|
59
59
|
containerName: 'ak-renderer-wrapper',
|
|
60
60
|
containerType: 'inline-size'
|
|
@@ -676,7 +676,6 @@ const RendererWrapper = /*#__PURE__*/React.memo(props => {
|
|
|
676
676
|
//
|
|
677
677
|
|
|
678
678
|
// allowRendererContainerStyles is not needed for comment container styling as container should always be set for comments
|
|
679
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
680
679
|
if (appearance === 'comment' && isTopLevelRenderer && fg('platform-ssr-table-resize')) {
|
|
681
680
|
return jsx("div", {
|
|
682
681
|
css: setAsQueryContainerStyles
|
|
@@ -690,9 +689,7 @@ const RendererWrapper = /*#__PURE__*/React.memo(props => {
|
|
|
690
689
|
return (appearance === 'full-page' || appearance === 'full-width') &&
|
|
691
690
|
// In case of having excerpt-include on page there are multiple renderers nested.
|
|
692
691
|
// Make sure only the root renderer is set to be query container.
|
|
693
|
-
isTopLevelRenderer && allowRendererContainerStyles &&
|
|
694
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
695
|
-
fg('platform-ssr-table-resize') ? jsx("div", {
|
|
692
|
+
isTopLevelRenderer && allowRendererContainerStyles && fg('platform-ssr-table-resize') ? jsx("div", {
|
|
696
693
|
css: setAsQueryContainerStyles
|
|
697
694
|
}, renderer) : renderer;
|
|
698
695
|
});
|
|
@@ -709,7 +709,6 @@ var TableWithShadows = overflowShadow(TableProcessor, {
|
|
|
709
709
|
useShadowObserver: true
|
|
710
710
|
});
|
|
711
711
|
var TableWithWidth = function TableWithWidth(props) {
|
|
712
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
713
712
|
if (fg('platform-ssr-table-resize')) {
|
|
714
713
|
var _props$columnWidths;
|
|
715
714
|
var colWidthsSum = ((_props$columnWidths = props.columnWidths) === null || _props$columnWidths === void 0 ? void 0 : _props$columnWidths.reduce(function (total, val) {
|
|
@@ -181,8 +181,6 @@ export var renderDocument = function renderDocument(doc, serializer) {
|
|
|
181
181
|
var stat = {
|
|
182
182
|
sanitizeTime: 0
|
|
183
183
|
};
|
|
184
|
-
|
|
185
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
186
184
|
if (fg('platform_editor_renderer_rm_usespecbasedvalidator')) {
|
|
187
185
|
useSpecBasedValidator = true;
|
|
188
186
|
}
|
|
@@ -15,7 +15,7 @@ import { FullPagePadding } from './style';
|
|
|
15
15
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
16
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
17
17
|
import { RendererCssClassName } from '../../consts';
|
|
18
|
-
import { akEditorBlockquoteBorderColor, akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorFullPageNarrowBreakout, akEditorGutterPaddingReduced, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorLineHeight, akEditorSelectedNodeClassName, akEditorShadowZIndex, akEditorStickyHeaderZIndex, akEditorTableBorder, akEditorTableCellMinWidth, akEditorTableNumberColumnWidth, akEditorTableToolbar, blockNodesVerticalMargin, gridMediumMaxWidth } from '@atlaskit/editor-shared-styles';
|
|
18
|
+
import { akEditorBlockquoteBorderColor, akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorFullPageNarrowBreakout, akEditorGutterPaddingReduced, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorLineHeight, akEditorSelectedNodeClassName, akEditorShadowZIndex, akEditorStickyHeaderZIndex, akEditorTableBorder, akEditorTableCellMinWidth, akEditorTableNumberColumnWidth, akEditorTableToolbar, blockNodesVerticalMargin, gridMediumMaxWidth, akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
|
|
19
19
|
import { INLINE_IMAGE_WRAPPER_CLASS_NAME } from '@atlaskit/editor-common/media-inline';
|
|
20
20
|
import { HeadingAnchorWrapperClassName } from '../../react/nodes/heading-anchor';
|
|
21
21
|
import { CodeBlockSharedCssClassName, DateSharedCssClassName, listItemCounterPadding, richMediaClassName, SmartCardSharedCssClassName, tableCellBorderWidth, tableCellMinWidth, tableCellPadding, tableMarginTop, TableSharedCssClassName, TaskDecisionSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
@@ -28,6 +28,7 @@ import { SORTABLE_COLUMN_ICON_CLASSNAME } from '@atlaskit/editor-common/table';
|
|
|
28
28
|
import { LightWeightCodeBlockCssClassName } from '../../react/nodes/codeBlock/components/lightWeightCodeBlock';
|
|
29
29
|
import { editorUGCToken } from '@atlaskit/editor-common/ugc-tokens';
|
|
30
30
|
import { getBaseFontSize } from './get-base-font-size';
|
|
31
|
+
import { defaultEmojiHeight, EmojiSharedCssClassName } from '@atlaskit/editor-common/emoji';
|
|
31
32
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
32
33
|
var wrappedMediaBreakoutPoint = 410;
|
|
33
34
|
var TELEPOINTER_ID = 'ai-streaming-telepointer';
|
|
@@ -682,6 +683,12 @@ var codeMarkSharedStyles = css({
|
|
|
682
683
|
whiteSpace: 'pre-wrap'
|
|
683
684
|
}
|
|
684
685
|
});
|
|
686
|
+
var extensionStyle = css({
|
|
687
|
+
'.ak-renderer-extension *': {
|
|
688
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
689
|
+
fontSize: 'var(--ak-renderer-base-font-size)'
|
|
690
|
+
}
|
|
691
|
+
});
|
|
685
692
|
var shadowSharedStyle = css(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "& .".concat(shadowClassNames.RIGHT_SHADOW, "::before, .").concat(shadowClassNames.RIGHT_SHADOW, "::after, .").concat(shadowClassNames.LEFT_SHADOW, "::before, .").concat(shadowClassNames.LEFT_SHADOW, "::after"), {
|
|
686
693
|
display: 'none',
|
|
687
694
|
position: 'absolute',
|
|
@@ -1482,6 +1489,22 @@ var rendererAnnotationStylesCommentHeightFix = css({
|
|
|
1482
1489
|
paddingTop: "var(--ds-space-025, 2px)"
|
|
1483
1490
|
}
|
|
1484
1491
|
});
|
|
1492
|
+
|
|
1493
|
+
// Calculate emoji size based on base font size
|
|
1494
|
+
// Default: 20px emoji at 16px base font
|
|
1495
|
+
// Scaled: 20px * (baseFontSize/16)
|
|
1496
|
+
// E.g., dense mode (13px base): 20px * (13/16) = 16.25px
|
|
1497
|
+
var denseEmojiStyles = css(_defineProperty({}, ".".concat(EmojiSharedCssClassName.EMOJI_IMAGE), {
|
|
1498
|
+
height: "calc(".concat(defaultEmojiHeight, " * var(--ak-renderer-base-font-size) / ").concat(akEditorFullPageDefaultFontSize, ")"),
|
|
1499
|
+
width: "calc(".concat(defaultEmojiHeight, " * var(--ak-renderer-base-font-size) / ").concat(akEditorFullPageDefaultFontSize, ")"),
|
|
1500
|
+
maxHeight: "calc(".concat(defaultEmojiHeight, " * var(--ak-renderer-base-font-size) / ").concat(akEditorFullPageDefaultFontSize, ")"),
|
|
1501
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
1502
|
+
img: {
|
|
1503
|
+
width: '100%',
|
|
1504
|
+
height: '100%',
|
|
1505
|
+
objectFit: 'contain'
|
|
1506
|
+
}
|
|
1507
|
+
}));
|
|
1485
1508
|
export var RendererStyleContainer = function RendererStyleContainer(props) {
|
|
1486
1509
|
var onClick = props.onClick,
|
|
1487
1510
|
onMouseDown = props.onMouseDown,
|
|
@@ -1500,6 +1523,7 @@ export var RendererStyleContainer = function RendererStyleContainer(props) {
|
|
|
1500
1523
|
var isPreviewPanelResponsivenessOn = editorExperiment('platform_editor_preview_panel_responsiveness', true, {
|
|
1501
1524
|
exposure: true
|
|
1502
1525
|
});
|
|
1526
|
+
var baseFontSize = getBaseFontSize(appearance, contentMode);
|
|
1503
1527
|
return (
|
|
1504
1528
|
// eslint-disable-next-line @atlassian/a11y/click-events-have-key-events, @atlassian/a11y/interactive-element-not-keyboard-focusable, @atlassian/a11y/no-static-element-interactions
|
|
1505
1529
|
jsx("div", {
|
|
@@ -1507,7 +1531,7 @@ export var RendererStyleContainer = function RendererStyleContainer(props) {
|
|
|
1507
1531
|
onClick: onClick,
|
|
1508
1532
|
onMouseDown: onMouseDown,
|
|
1509
1533
|
style: {
|
|
1510
|
-
'--ak-renderer-base-font-size': "".concat(
|
|
1534
|
+
'--ak-renderer-base-font-size': "".concat(baseFontSize, "px"),
|
|
1511
1535
|
'--ak-renderer-editor-font-heading-h1': "".concat(editorUGCToken('editor.font.heading.h1')),
|
|
1512
1536
|
'--ak-renderer-editor-font-heading-h2': "".concat(editorUGCToken('editor.font.heading.h2')),
|
|
1513
1537
|
'--ak-renderer-editor-font-heading-h3': "".concat(editorUGCToken('editor.font.heading.h3')),
|
|
@@ -1516,15 +1540,11 @@ export var RendererStyleContainer = function RendererStyleContainer(props) {
|
|
|
1516
1540
|
'--ak-renderer-editor-font-heading-h6': "".concat(editorUGCToken('editor.font.heading.h6')),
|
|
1517
1541
|
'--ak-renderer-editor-font-normal-text': "".concat(editorUGCToken('editor.font.body'))
|
|
1518
1542
|
},
|
|
1519
|
-
css: [baseStyles, hideHeadingCopyLinkWrapperStyles, appearance === 'full-page' && isPreviewPanelResponsivenessOn && rendererFullPageStylesWithReducedPadding, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && rendererFullPageStyles, appearance === 'full-width' && rendererFullWidthStyles, appearance === 'full-width' && !isTableResizingEnabled(appearance) && rendererFullWidthStylesForTableResizing, !fg('aifc_create_enabled') && telepointerStyles, fg('aifc_create_enabled') && rovoTelepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, fg('platform_editor_typography_ugc') ? headingsSharedStylesWithEditorUGC : headingsSharedStyles, headingWithAlignmentStyles, ruleSharedStyles, fg('platform_editor_typography_ugc') ? paragraphSharedStylesWithEditorUGC : paragraphSharedStyles, listsSharedStyles, browser.gecko && listsSharedStylesForGekko, indentationSharedStyles, fg('platform_editor__renderer_indentation_text_margin') && indentationSharedStylesWithMarginFix, blockMarksSharedStyles, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles, expValEquals('platform_editor_text_highlight_padding', 'isEnabled', true) &&
|
|
1543
|
+
css: [baseStyles, expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') && denseEmojiStyles, hideHeadingCopyLinkWrapperStyles, appearance === 'full-page' && isPreviewPanelResponsivenessOn && rendererFullPageStylesWithReducedPadding, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && rendererFullPageStyles, appearance === 'full-width' && rendererFullWidthStyles, appearance === 'full-width' && !isTableResizingEnabled(appearance) && rendererFullWidthStylesForTableResizing, !fg('aifc_create_enabled') && telepointerStyles, fg('aifc_create_enabled') && rovoTelepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, fg('platform_editor_typography_ugc') ? headingsSharedStylesWithEditorUGC : headingsSharedStyles, headingWithAlignmentStyles, ruleSharedStyles, expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') && extensionStyle, fg('platform_editor_typography_ugc') ? paragraphSharedStylesWithEditorUGC : paragraphSharedStyles, listsSharedStyles, browser.gecko && listsSharedStylesForGekko, indentationSharedStyles, fg('platform_editor__renderer_indentation_text_margin') && indentationSharedStylesWithMarginFix, blockMarksSharedStyles, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles, expValEquals('platform_editor_text_highlight_padding', 'isEnabled', true) &&
|
|
1520
1544
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
1521
|
-
textHighlightPaddingStyles, tasksAndDecisionsStyles, smartCardStyles, smartCardStylesAvatarFix, editorExperiment('platform_editor_preview_panel_linking_exp', true) && headerSmartCardStyles, fg('smartcard_avatar_margin_fix') && smartCardStylesAvatarMarginFix, smartCardStylesAvatarListZeroMarginTop,
|
|
1522
|
-
// eslint-disable-next-line @atlaskit/platform/
|
|
1523
|
-
fg('editor_inline_comments_on_inline_nodes') &&
|
|
1524
|
-
// eslint-disable-next-line @atlaskit/platform/no-preconditioning, @atlaskit/platform/ensure-feature-flag-prefix
|
|
1525
|
-
fg('editor_inline_comments_on_inline_nodes') &&
|
|
1526
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
1527
|
-
fg('annotations_align_editor_and_renderer_styles') && rendererAnnotationStylesCommentHeightFix, baseOtherStyles, allowNestedHeaderLinks && alignedHeadingAnchorStyle, mediaSingleSharedStyle,
|
|
1545
|
+
textHighlightPaddingStyles, tasksAndDecisionsStyles, smartCardStyles, smartCardStylesAvatarFix, editorExperiment('platform_editor_preview_panel_linking_exp', true) && headerSmartCardStyles, fg('smartcard_avatar_margin_fix') && smartCardStylesAvatarMarginFix, smartCardStylesAvatarListZeroMarginTop, fg('editor_inline_comments_on_inline_nodes') && rendererAnnotationStyles,
|
|
1546
|
+
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
1547
|
+
fg('editor_inline_comments_on_inline_nodes') && fg('annotations_align_editor_and_renderer_styles') && rendererAnnotationStylesCommentHeightFix, baseOtherStyles, allowNestedHeaderLinks && alignedHeadingAnchorStyle, mediaSingleSharedStyle,
|
|
1528
1548
|
// merge firstWrappedMediaStyles with mediaSingleSharedStyle when clean up platform_editor_fix_media_in_renderer
|
|
1529
1549
|
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 && rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks, fg('platform_editor_tables_numbered_column_correction') ? rendererTableColumnStyles : rendererTableColumnStylesOld, 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' && responsiveBreakoutWidthFullWidth],
|
|
1530
1550
|
"data-testid": testId
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
|
|
2
|
-
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
1
|
+
import { akEditorFullPageDefaultFontSize, akEditorFullPageDenseFontSize } from '@atlaskit/editor-shared-styles';
|
|
3
2
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
3
|
export var getBaseFontSize = function getBaseFontSize(appearance, contentMode) {
|
|
5
4
|
if (expValEquals('cc_editor_ai_content_mode', 'variant', 'test')) {
|
|
6
5
|
if (contentMode === 'dense') {
|
|
7
|
-
|
|
8
|
-
return baseFontSize;
|
|
6
|
+
return akEditorFullPageDenseFontSize;
|
|
9
7
|
}
|
|
10
8
|
}
|
|
11
9
|
return appearance && appearance !== 'comment' ? akEditorFullPageDefaultFontSize : 14;
|
|
@@ -59,7 +59,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
59
59
|
// we want to calculate all the table widths (which causes reflows) after the renderer has finished loading to mitigate performance impact
|
|
60
60
|
var TABLE_WIDTH_INFO_TIMEOUT = 10000;
|
|
61
61
|
var packageName = "@atlaskit/renderer";
|
|
62
|
-
var packageVersion = "
|
|
62
|
+
var packageVersion = "124.3.0";
|
|
63
63
|
var setAsQueryContainerStyles = css({
|
|
64
64
|
containerName: 'ak-renderer-wrapper',
|
|
65
65
|
containerType: 'inline-size'
|
|
@@ -683,7 +683,6 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
|
683
683
|
//
|
|
684
684
|
|
|
685
685
|
// allowRendererContainerStyles is not needed for comment container styling as container should always be set for comments
|
|
686
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
687
686
|
if (appearance === 'comment' && isTopLevelRenderer && fg('platform-ssr-table-resize')) {
|
|
688
687
|
return jsx("div", {
|
|
689
688
|
css: setAsQueryContainerStyles
|
|
@@ -697,9 +696,7 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
|
697
696
|
return (appearance === 'full-page' || appearance === 'full-width') &&
|
|
698
697
|
// In case of having excerpt-include on page there are multiple renderers nested.
|
|
699
698
|
// Make sure only the root renderer is set to be query container.
|
|
700
|
-
isTopLevelRenderer && allowRendererContainerStyles &&
|
|
701
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
702
|
-
fg('platform-ssr-table-resize') ? jsx("div", {
|
|
699
|
+
isTopLevelRenderer && allowRendererContainerStyles && fg('platform-ssr-table-resize') ? jsx("div", {
|
|
703
700
|
css: setAsQueryContainerStyles
|
|
704
701
|
}, renderer) : renderer;
|
|
705
702
|
});
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { nodeToReact as defaultNodeComponents } from './react/nodes';
|
|
|
6
6
|
export { AnnotationsWrapper } from './ui/annotations';
|
|
7
7
|
export { ValidationContextProvider } from './ui/Renderer/ValidationContext';
|
|
8
8
|
export type { Serializer } from './serializer';
|
|
9
|
-
export type { HeadingAnchorLinksProps, RendererAppearance, StickyHeaderProps, NodeComponentsProps, } from './ui/Renderer/types';
|
|
9
|
+
export type { HeadingAnchorLinksProps, RendererAppearance, RendererContentMode, StickyHeaderProps, NodeComponentsProps, } from './ui/Renderer/types';
|
|
10
10
|
export type { RendererProps } from './ui/renderer-props';
|
|
11
11
|
export type { RendererContext, NodeProps, ExtensionViewportSize } from './react/types';
|
|
12
12
|
export { ADFEncoder } from './utils';
|
|
@@ -6,7 +6,7 @@ export { nodeToReact as defaultNodeComponents } from './react/nodes';
|
|
|
6
6
|
export { AnnotationsWrapper } from './ui/annotations';
|
|
7
7
|
export { ValidationContextProvider } from './ui/Renderer/ValidationContext';
|
|
8
8
|
export type { Serializer } from './serializer';
|
|
9
|
-
export type { HeadingAnchorLinksProps, RendererAppearance, StickyHeaderProps, NodeComponentsProps, } from './ui/Renderer/types';
|
|
9
|
+
export type { HeadingAnchorLinksProps, RendererAppearance, RendererContentMode, StickyHeaderProps, NodeComponentsProps, } from './ui/Renderer/types';
|
|
10
10
|
export type { RendererProps } from './ui/renderer-props';
|
|
11
11
|
export type { RendererContext, NodeProps, ExtensionViewportSize } from './react/types';
|
|
12
12
|
export { ADFEncoder } from './utils';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "124.
|
|
3
|
+
"version": "124.4.0",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@atlaskit/editor-json-transformer": "^8.30.0",
|
|
36
36
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
37
37
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
38
|
-
"@atlaskit/editor-shared-styles": "^3.
|
|
38
|
+
"@atlaskit/editor-shared-styles": "^3.7.0",
|
|
39
39
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
40
40
|
"@atlaskit/emoji": "^69.5.0",
|
|
41
41
|
"@atlaskit/feature-gate-js-client": "^5.5.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@atlaskit/status": "^3.0.0",
|
|
58
58
|
"@atlaskit/task-decision": "^19.2.0",
|
|
59
59
|
"@atlaskit/theme": "^21.0.0",
|
|
60
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
60
|
+
"@atlaskit/tmp-editor-statsig": "^13.10.0",
|
|
61
61
|
"@atlaskit/tokens": "^6.4.0",
|
|
62
62
|
"@atlaskit/tooltip": "^20.5.0",
|
|
63
63
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
@@ -173,6 +173,9 @@
|
|
|
173
173
|
"platform_editor_fix_media_in_renderer": {
|
|
174
174
|
"type": "boolean"
|
|
175
175
|
},
|
|
176
|
+
"platform_editor_content_mode_button_mvp": {
|
|
177
|
+
"type": "boolean"
|
|
178
|
+
},
|
|
176
179
|
"platform_editor_tables_numbered_column_correction": {
|
|
177
180
|
"type": "boolean"
|
|
178
181
|
},
|