@atlaskit/renderer 126.5.0 → 126.5.2
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 +13 -0
- package/dist/cjs/react/nodes/heading.js +28 -25
- package/dist/cjs/ui/Renderer/RendererStyleContainer.js +59 -42
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/react/nodes/heading.js +28 -25
- package/dist/es2019/ui/Renderer/RendererStyleContainer.js +62 -38
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/react/nodes/heading.js +28 -25
- package/dist/esm/ui/Renderer/RendererStyleContainer.js +59 -42
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 126.5.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 126.5.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`1c91357f0c2e8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1c91357f0c2e8) -
|
|
14
|
+
Confcloud-83420: Fixed edge cases, unskipped tests
|
|
15
|
+
|
|
3
16
|
## 126.5.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
@@ -22,6 +22,7 @@ var _react2 = require("@emotion/react");
|
|
|
22
22
|
|
|
23
23
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
24
24
|
|
|
25
|
+
var RENDERER_HEADING_WRAPPER = 'renderer-heading-wrapper';
|
|
25
26
|
var getCurrentUrlWithHash = function getCurrentUrlWithHash() {
|
|
26
27
|
var hash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
27
28
|
var url = new URL(window.location.href);
|
|
@@ -38,8 +39,11 @@ function hasRightAlignmentMark(marks) {
|
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
41
|
var wrapperStyles = (0, _react2.css)({
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
// Important: do NOT use flex here.
|
|
43
|
+
// With flex + baseline alignment, the anchor aligns to the *first line* of a multi-line heading,
|
|
44
|
+
// which visually places it at the top-right. We want the anchor to sit immediately after the
|
|
45
|
+
// last character of the heading (i.e. after the final wrapped line), so we use normal inline flow.
|
|
46
|
+
display: 'block'
|
|
43
47
|
});
|
|
44
48
|
function WrappedHeadingAnchor(_ref) {
|
|
45
49
|
var enableNestedHeaderLinks = _ref.enableNestedHeaderLinks,
|
|
@@ -149,30 +153,29 @@ function HeadingWithWrapper(props) {
|
|
|
149
153
|
mouseEntered.current = true;
|
|
150
154
|
}
|
|
151
155
|
};
|
|
152
|
-
return (
|
|
156
|
+
return (0, _react2.jsx)("div", {
|
|
153
157
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
);
|
|
158
|
+
className: RENDERER_HEADING_WRAPPER,
|
|
159
|
+
"data-testid": RENDERER_HEADING_WRAPPER,
|
|
160
|
+
"data-level": props.level,
|
|
161
|
+
css: wrapperStyles
|
|
162
|
+
}, showAnchorLink && headingId && isRightAligned && (0, _react2.jsx)(WrappedHeadingAnchor, {
|
|
163
|
+
level: props.level,
|
|
164
|
+
enableNestedHeaderLinks: enableNestedHeaderLinks,
|
|
165
|
+
headingId: headingId,
|
|
166
|
+
hideFromScreenReader: false
|
|
167
|
+
}), (0, _react2.jsx)(HX, {
|
|
168
|
+
id: headingIdToUse,
|
|
169
|
+
"data-local-id": localId,
|
|
170
|
+
"data-renderer-start-pos": dataAttributes['data-renderer-start-pos'],
|
|
171
|
+
"data-as-inline": asInline,
|
|
172
|
+
onMouseEnter: mouseEnterHandler
|
|
173
|
+
}, props.children), showAnchorLink && headingId && !isRightAligned && (0, _react2.jsx)(WrappedHeadingAnchor, {
|
|
174
|
+
level: props.level,
|
|
175
|
+
enableNestedHeaderLinks: enableNestedHeaderLinks,
|
|
176
|
+
headingId: headingId,
|
|
177
|
+
hideFromScreenReader: false
|
|
178
|
+
}));
|
|
176
179
|
}
|
|
177
180
|
|
|
178
181
|
/**
|
|
@@ -29,7 +29,7 @@ var _getBaseFontSize = require("./get-base-font-size");
|
|
|
29
29
|
var _emoji = require("@atlaskit/editor-common/emoji");
|
|
30
30
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
31
31
|
var _syncBlock = require("@atlaskit/editor-common/sync-block");
|
|
32
|
-
var
|
|
32
|
+
var _css8;
|
|
33
33
|
/* eslint-disable @atlaskit/ui-styling-standard/no-important-styles, @atlaskit/ui-styling-standard/no-unsafe-selectors */
|
|
34
34
|
/* eslint-disable @atlaskit/ui-styling-standard/no-imported-style-values */
|
|
35
35
|
/* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values */
|
|
@@ -384,7 +384,7 @@ var blockquoteSharedStyles = (0, _react.css)({
|
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
386
|
});
|
|
387
|
-
var
|
|
387
|
+
var headingsSharedStyles = (0, _react.css)({
|
|
388
388
|
'& h1': {
|
|
389
389
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
390
390
|
font: "var(--ak-renderer-editor-font-heading-h1)",
|
|
@@ -451,6 +451,43 @@ var headingsSharedStylesWithEditorUGC = (0, _react.css)({
|
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
453
|
});
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* When the copy-link a11y fix is enabled, the heading copy-link button is a sibling of the heading
|
|
457
|
+
* text within `.renderer-heading-wrapper`. To ensure the button sits immediately after the last
|
|
458
|
+
* rendered character (including when the heading wraps), the heading itself needs to participate in
|
|
459
|
+
* inline layout.
|
|
460
|
+
*
|
|
461
|
+
* Since inline elements don't support vertical margins in normal flow, we migrate the UGC heading
|
|
462
|
+
* `marginTop` values (from `headingsSharedStyles`) onto the wrapper.
|
|
463
|
+
*/
|
|
464
|
+
var headingWrapperInlineFlowStyles = (0, _react.css)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({
|
|
465
|
+
// Ensure heading and copy-link button participate in inline flow so the button sits after the final wrapped line of text.
|
|
466
|
+
'& .renderer-heading-wrapper > h1, & .renderer-heading-wrapper > h2, & .renderer-heading-wrapper > h3, & .renderer-heading-wrapper > h4, & .renderer-heading-wrapper > h5, & .renderer-heading-wrapper > h6': {
|
|
467
|
+
display: 'inline'
|
|
468
|
+
}
|
|
469
|
+
}, "& .renderer-heading-wrapper > .".concat(_headingAnchor.HeadingAnchorWrapperClassName), {
|
|
470
|
+
display: 'inline',
|
|
471
|
+
verticalAlign: 'baseline'
|
|
472
|
+
}), '& .renderer-heading-wrapper[data-level="1"]', {
|
|
473
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
474
|
+
marginTop: '1.45833em'
|
|
475
|
+
}), '& .renderer-heading-wrapper[data-level="2"]', {
|
|
476
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
477
|
+
marginTop: '1.4em'
|
|
478
|
+
}), '& .renderer-heading-wrapper[data-level="3"]', {
|
|
479
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
480
|
+
marginTop: '1.31249em'
|
|
481
|
+
}), '& .renderer-heading-wrapper[data-level="4"]', {
|
|
482
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
483
|
+
marginTop: '1.25em'
|
|
484
|
+
}), '& .renderer-heading-wrapper[data-level="5"]', {
|
|
485
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
486
|
+
marginTop: '1.45833em'
|
|
487
|
+
}), '& .renderer-heading-wrapper[data-level="6"]', {
|
|
488
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
489
|
+
marginTop: '1.59091em'
|
|
490
|
+
}));
|
|
454
491
|
var headingWithAlignmentStylesDuplicateAnchor = (0, _react.css)({
|
|
455
492
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
456
493
|
'.fabric-editor-block-mark.fabric-editor-alignment:not(:first-child)': {
|
|
@@ -495,42 +532,21 @@ var headingWithAlignmentStylesDuplicateAnchor = (0, _react.css)({
|
|
|
495
532
|
}
|
|
496
533
|
});
|
|
497
534
|
var headingWithAlignmentStyles = (0, _react.css)({
|
|
498
|
-
//
|
|
499
|
-
'.fabric-editor-block-mark.
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
},
|
|
506
|
-
h2: {
|
|
507
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
508
|
-
marginTop: '1.8em'
|
|
509
|
-
},
|
|
510
|
-
h3: {
|
|
511
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
512
|
-
marginTop: '2em'
|
|
513
|
-
},
|
|
514
|
-
h4: {
|
|
515
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
516
|
-
marginTop: '1.357em'
|
|
517
|
-
},
|
|
518
|
-
h5: {
|
|
519
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
520
|
-
marginTop: '1.667em'
|
|
521
|
-
},
|
|
522
|
-
h6: {
|
|
523
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
524
|
-
marginTop: '1.455em'
|
|
525
|
-
}
|
|
526
|
-
}
|
|
535
|
+
// Center alignment for heading wrapper - flex container needs justify-content instead of text-align
|
|
536
|
+
'.fabric-editor-block-mark[data-align="center"] > .renderer-heading-wrapper': {
|
|
537
|
+
justifyContent: 'center'
|
|
538
|
+
},
|
|
539
|
+
// Right/end alignment for heading wrapper - flex container needs justify-content instead of text-align
|
|
540
|
+
'.fabric-editor-block-mark[data-align="end"] > .renderer-heading-wrapper': {
|
|
541
|
+
justifyContent: 'flex-end'
|
|
527
542
|
},
|
|
528
543
|
// Set marginTop: 0 if alignment block is next to a gap cursor or widget that is first child
|
|
529
544
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
530
545
|
'.ProseMirror-gapcursor:first-child + .fabric-editor-block-mark.fabric-editor-alignment, .ProseMirror-widget:first-child + .fabric-editor-block-mark.fabric-editor-alignment, .ProseMirror-widget:first-child + .ProseMirror-widget:nth-child(2) + .fabric-editor-block-mark.fabric-editor-alignment': {
|
|
546
|
+
// With inline headings, apply marginTop to the wrapper (not the h1-h6).
|
|
531
547
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
532
|
-
'> .renderer-heading-wrapper:first-child
|
|
533
|
-
marginTop:
|
|
548
|
+
'> .renderer-heading-wrapper:first-child': {
|
|
549
|
+
marginTop: 0
|
|
534
550
|
}
|
|
535
551
|
}
|
|
536
552
|
});
|
|
@@ -590,13 +606,13 @@ var paragraphSharedStyleScaledMargin = (0, _react.css)({
|
|
|
590
606
|
letterSpacing: '-0.005em'
|
|
591
607
|
}
|
|
592
608
|
});
|
|
593
|
-
var listsSharedStyles = (0, _react.css)((
|
|
609
|
+
var listsSharedStyles = (0, _react.css)((_css8 = {
|
|
594
610
|
/* =============== INDENTATION SPACING ========= */
|
|
595
611
|
'ul, ol': {
|
|
596
612
|
boxSizing: 'border-box',
|
|
597
613
|
paddingLeft: "var(--ed--list--item-counter--padding, ".concat(_styles.listItemCounterPadding, "px)")
|
|
598
614
|
}
|
|
599
|
-
}, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(
|
|
615
|
+
}, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_css8, "".concat(_adfSchema.orderedListSelector, ", ").concat(_adfSchema.bulletListSelector), {
|
|
600
616
|
/*
|
|
601
617
|
Ensures list item content adheres to the list's margin instead
|
|
602
618
|
of filling the entire block row. This is important to allow
|
|
@@ -628,7 +644,7 @@ var listsSharedStyles = (0, _react.css)((_css7 = {
|
|
|
628
644
|
listStyleType: 'lower-alpha'
|
|
629
645
|
}), 'ol[data-indent-level="3"], ol[data-indent-level="6"]', {
|
|
630
646
|
listStyleType: 'lower-roman'
|
|
631
|
-
}), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(
|
|
647
|
+
}), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_css8, 'ul[data-indent-level="1"], ul[data-indent-level="4"]', {
|
|
632
648
|
listStyleType: 'disc'
|
|
633
649
|
}), 'ul[data-indent-level="2"], ul[data-indent-level="5"]', {
|
|
634
650
|
listStyleType: 'circle'
|
|
@@ -1506,11 +1522,12 @@ var rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinksDuplicateAnchor =
|
|
|
1506
1522
|
}))))));
|
|
1507
1523
|
var rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks = (0, _react.css)((0, _defineProperty2.default)({}, ".".concat(_consts.RendererCssClassName.DOCUMENT, " .").concat(_styles.TableSharedCssClassName.TABLE_CONTAINER), (0, _defineProperty2.default)({}, ".".concat(_styles.TableSharedCssClassName.TABLE_NODE_WRAPPER, " > table, .").concat(_styles.TableSharedCssClassName.TABLE_STICKY_WRAPPER, " > table"), (0, _defineProperty2.default)({}, ".".concat(_consts.RendererCssClassName.SORTABLE_COLUMN_WRAPPER), (0, _defineProperty2.default)({}, ".".concat(_consts.RendererCssClassName.SORTABLE_COLUMN), (0, _defineProperty2.default)((0, _defineProperty2.default)({}, ".".concat(_headingAnchor.HeadingAnchorWrapperClassName), {
|
|
1508
1524
|
position: 'unset'
|
|
1509
|
-
}), '> .renderer-heading-wrapper
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1525
|
+
}), '> .renderer-heading-wrapper', {
|
|
1526
|
+
// Reserve space for the sortable-column icon so the heading+anchor wrapper never overlaps it.
|
|
1527
|
+
// Use padding (instead of margin on the heading) so we don't create a gap between the heading
|
|
1528
|
+
// text and the copy-link anchor button
|
|
1529
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
1530
|
+
paddingRight: '30px'
|
|
1514
1531
|
}))))));
|
|
1515
1532
|
|
|
1516
1533
|
// @ts-expect-error - throw TS error when use !import in position.
|
|
@@ -1876,7 +1893,7 @@ var RendererStyleContainer = exports.RendererStyleContainer = function RendererS
|
|
|
1876
1893
|
'--ak-renderer-editor-font-heading-h6': "".concat((0, _ugcTokens.editorUGCToken)('editor.font.heading.h6')),
|
|
1877
1894
|
'--ak-renderer-editor-font-normal-text': "".concat((0, _ugcTokens.editorUGCToken)('editor.font.body'))
|
|
1878
1895
|
},
|
|
1879
|
-
css: [baseStyles, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? headingAnchorStyles : headingAnchorStylesDuplicateAnchor, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? hideHeadingCopyLinkWrapperStyles : hideHeadingCopyLinkWrapperStylesDuplicateAnchor, appearance === 'full-page' && isPreviewPanelResponsivenessOn && rendererFullPageStylesWithReducedPadding, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && rendererFullPageStyles, appearance === 'full-width' && rendererFullWidthStyles, (appearance === 'full-width' || appearance === 'max' && ((0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true))) && !(0, _table.isTableResizingEnabled)(appearance) && rendererFullWidthStylesForTableResizing, appearance === 'max' && ((0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true)) && rendererMaxWidthStyles, rovoTelepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles,
|
|
1896
|
+
css: [baseStyles, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? headingAnchorStyles : headingAnchorStylesDuplicateAnchor, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? hideHeadingCopyLinkWrapperStyles : hideHeadingCopyLinkWrapperStylesDuplicateAnchor, appearance === 'full-page' && isPreviewPanelResponsivenessOn && rendererFullPageStylesWithReducedPadding, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && rendererFullPageStyles, appearance === 'full-width' && rendererFullWidthStyles, (appearance === 'full-width' || appearance === 'max' && ((0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true))) && !(0, _table.isTableResizingEnabled)(appearance) && rendererFullWidthStylesForTableResizing, appearance === 'max' && ((0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true)) && rendererMaxWidthStyles, rovoTelepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) && headingWrapperInlineFlowStyles, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? headingWithAlignmentStyles : headingWithAlignmentStylesDuplicateAnchor, ruleSharedStyles, contentMode === 'compact' && isCompactModeSupported && extensionStyle, (0, _platformFeatureFlags.fg)('platform_editor_typography_ugc') ? isCompactModeSupported ? paragraphStylesUGCScaledMargin : paragraphSharedStylesWithEditorUGC : isCompactModeSupported ? paragraphSharedStyleScaledMargin : paragraphSharedStyles, listsSharedStyles, browser.gecko && listsSharedStylesForGekko, indentationSharedStyles, (0, _platformFeatureFlags.fg)('platform_editor__renderer_indentation_text_margin') && indentationSharedStylesWithMarginFix, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? blockMarksSharedStyles : blockMarksSharedStylesDuplicateAnchor, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles, (0, _expValEquals.expValEquals)('platform_editor_text_highlight_padding', 'isEnabled', true) &&
|
|
1880
1897
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
1881
1898
|
textHighlightPaddingStyles, tasksAndDecisionsStyles, smartCardStyles, smartCardStylesAvatarFix, (0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true) && headerSmartCardStyles, smartCardStylesAvatarMarginFix, smartCardStylesAvatarListZeroMarginTop, (0, _platformFeatureFlags.fg)('editor_inline_comments_on_inline_nodes') && rendererAnnotationStyles,
|
|
1882
1899
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
@@ -70,7 +70,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
70
70
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
71
71
|
var RENDER_EVENT_SAMPLE_RATE = 0.2;
|
|
72
72
|
var packageName = "@atlaskit/renderer";
|
|
73
|
-
var packageVersion = "126.
|
|
73
|
+
var packageVersion = "126.5.1";
|
|
74
74
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
75
75
|
containerName: 'ak-renderer-wrapper',
|
|
76
76
|
containerType: 'inline-size'
|
|
@@ -13,6 +13,7 @@ import { copyTextToClipboard } from '../utils/clipboard';
|
|
|
13
13
|
import HeadingAnchor from './heading-anchor';
|
|
14
14
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
15
15
|
import { css, jsx } from '@emotion/react';
|
|
16
|
+
const RENDERER_HEADING_WRAPPER = 'renderer-heading-wrapper';
|
|
16
17
|
const getCurrentUrlWithHash = (hash = '') => {
|
|
17
18
|
const url = new URL(window.location.href);
|
|
18
19
|
url.search = ''; // clear any query params so that the page will correctly scroll to the anchor
|
|
@@ -26,8 +27,11 @@ function hasRightAlignmentMark(marks) {
|
|
|
26
27
|
return marks.some(mark => mark.type.name === 'alignment' && mark.attrs.align === 'end');
|
|
27
28
|
}
|
|
28
29
|
const wrapperStyles = css({
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
// Important: do NOT use flex here.
|
|
31
|
+
// With flex + baseline alignment, the anchor aligns to the *first line* of a multi-line heading,
|
|
32
|
+
// which visually places it at the top-right. We want the anchor to sit immediately after the
|
|
33
|
+
// last character of the heading (i.e. after the final wrapped line), so we use normal inline flow.
|
|
34
|
+
display: 'block'
|
|
31
35
|
});
|
|
32
36
|
function WrappedHeadingAnchor({
|
|
33
37
|
enableNestedHeaderLinks,
|
|
@@ -141,30 +145,29 @@ function HeadingWithWrapper(props) {
|
|
|
141
145
|
mouseEntered.current = true;
|
|
142
146
|
}
|
|
143
147
|
};
|
|
144
|
-
return (
|
|
148
|
+
return jsx("div", {
|
|
145
149
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
);
|
|
150
|
+
className: RENDERER_HEADING_WRAPPER,
|
|
151
|
+
"data-testid": RENDERER_HEADING_WRAPPER,
|
|
152
|
+
"data-level": props.level,
|
|
153
|
+
css: wrapperStyles
|
|
154
|
+
}, showAnchorLink && headingId && isRightAligned && jsx(WrappedHeadingAnchor, {
|
|
155
|
+
level: props.level,
|
|
156
|
+
enableNestedHeaderLinks: enableNestedHeaderLinks,
|
|
157
|
+
headingId: headingId,
|
|
158
|
+
hideFromScreenReader: false
|
|
159
|
+
}), jsx(HX, {
|
|
160
|
+
id: headingIdToUse,
|
|
161
|
+
"data-local-id": localId,
|
|
162
|
+
"data-renderer-start-pos": dataAttributes['data-renderer-start-pos'],
|
|
163
|
+
"data-as-inline": asInline,
|
|
164
|
+
onMouseEnter: mouseEnterHandler
|
|
165
|
+
}, props.children), showAnchorLink && headingId && !isRightAligned && jsx(WrappedHeadingAnchor, {
|
|
166
|
+
level: props.level,
|
|
167
|
+
enableNestedHeaderLinks: enableNestedHeaderLinks,
|
|
168
|
+
headingId: headingId,
|
|
169
|
+
hideFromScreenReader: false
|
|
170
|
+
}));
|
|
168
171
|
}
|
|
169
172
|
|
|
170
173
|
/**
|
|
@@ -481,7 +481,7 @@ const blockquoteSharedStyles = css({
|
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
});
|
|
484
|
-
const
|
|
484
|
+
const headingsSharedStyles = css({
|
|
485
485
|
'& h1': {
|
|
486
486
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
487
487
|
font: `var(--ak-renderer-editor-font-heading-h1)`,
|
|
@@ -548,6 +548,50 @@ const headingsSharedStylesWithEditorUGC = css({
|
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
550
|
});
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* When the copy-link a11y fix is enabled, the heading copy-link button is a sibling of the heading
|
|
554
|
+
* text within `.renderer-heading-wrapper`. To ensure the button sits immediately after the last
|
|
555
|
+
* rendered character (including when the heading wraps), the heading itself needs to participate in
|
|
556
|
+
* inline layout.
|
|
557
|
+
*
|
|
558
|
+
* Since inline elements don't support vertical margins in normal flow, we migrate the UGC heading
|
|
559
|
+
* `marginTop` values (from `headingsSharedStyles`) onto the wrapper.
|
|
560
|
+
*/
|
|
561
|
+
const headingWrapperInlineFlowStyles = css({
|
|
562
|
+
// Ensure heading and copy-link button participate in inline flow so the button sits after the final wrapped line of text.
|
|
563
|
+
'& .renderer-heading-wrapper > h1, & .renderer-heading-wrapper > h2, & .renderer-heading-wrapper > h3, & .renderer-heading-wrapper > h4, & .renderer-heading-wrapper > h5, & .renderer-heading-wrapper > h6': {
|
|
564
|
+
display: 'inline'
|
|
565
|
+
},
|
|
566
|
+
[`& .renderer-heading-wrapper > .${HeadingAnchorWrapperClassName}`]: {
|
|
567
|
+
display: 'inline',
|
|
568
|
+
verticalAlign: 'baseline'
|
|
569
|
+
},
|
|
570
|
+
'& .renderer-heading-wrapper[data-level="1"]': {
|
|
571
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
572
|
+
marginTop: '1.45833em'
|
|
573
|
+
},
|
|
574
|
+
'& .renderer-heading-wrapper[data-level="2"]': {
|
|
575
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
576
|
+
marginTop: '1.4em'
|
|
577
|
+
},
|
|
578
|
+
'& .renderer-heading-wrapper[data-level="3"]': {
|
|
579
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
580
|
+
marginTop: '1.31249em'
|
|
581
|
+
},
|
|
582
|
+
'& .renderer-heading-wrapper[data-level="4"]': {
|
|
583
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
584
|
+
marginTop: '1.25em'
|
|
585
|
+
},
|
|
586
|
+
'& .renderer-heading-wrapper[data-level="5"]': {
|
|
587
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
588
|
+
marginTop: '1.45833em'
|
|
589
|
+
},
|
|
590
|
+
'& .renderer-heading-wrapper[data-level="6"]': {
|
|
591
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
592
|
+
marginTop: '1.59091em'
|
|
593
|
+
}
|
|
594
|
+
});
|
|
551
595
|
const headingWithAlignmentStylesDuplicateAnchor = css({
|
|
552
596
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
553
597
|
'.fabric-editor-block-mark.fabric-editor-alignment:not(:first-child)': {
|
|
@@ -592,42 +636,21 @@ const headingWithAlignmentStylesDuplicateAnchor = css({
|
|
|
592
636
|
}
|
|
593
637
|
});
|
|
594
638
|
const headingWithAlignmentStyles = css({
|
|
595
|
-
//
|
|
596
|
-
'.fabric-editor-block-mark.
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
},
|
|
603
|
-
h2: {
|
|
604
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
605
|
-
marginTop: '1.8em'
|
|
606
|
-
},
|
|
607
|
-
h3: {
|
|
608
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
609
|
-
marginTop: '2em'
|
|
610
|
-
},
|
|
611
|
-
h4: {
|
|
612
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
613
|
-
marginTop: '1.357em'
|
|
614
|
-
},
|
|
615
|
-
h5: {
|
|
616
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
617
|
-
marginTop: '1.667em'
|
|
618
|
-
},
|
|
619
|
-
h6: {
|
|
620
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
621
|
-
marginTop: '1.455em'
|
|
622
|
-
}
|
|
623
|
-
}
|
|
639
|
+
// Center alignment for heading wrapper - flex container needs justify-content instead of text-align
|
|
640
|
+
'.fabric-editor-block-mark[data-align="center"] > .renderer-heading-wrapper': {
|
|
641
|
+
justifyContent: 'center'
|
|
642
|
+
},
|
|
643
|
+
// Right/end alignment for heading wrapper - flex container needs justify-content instead of text-align
|
|
644
|
+
'.fabric-editor-block-mark[data-align="end"] > .renderer-heading-wrapper': {
|
|
645
|
+
justifyContent: 'flex-end'
|
|
624
646
|
},
|
|
625
647
|
// Set marginTop: 0 if alignment block is next to a gap cursor or widget that is first child
|
|
626
648
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
627
649
|
'.ProseMirror-gapcursor:first-child + .fabric-editor-block-mark.fabric-editor-alignment, .ProseMirror-widget:first-child + .fabric-editor-block-mark.fabric-editor-alignment, .ProseMirror-widget:first-child + .ProseMirror-widget:nth-child(2) + .fabric-editor-block-mark.fabric-editor-alignment': {
|
|
650
|
+
// With inline headings, apply marginTop to the wrapper (not the h1-h6).
|
|
628
651
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
629
|
-
'> .renderer-heading-wrapper:first-child
|
|
630
|
-
marginTop:
|
|
652
|
+
'> .renderer-heading-wrapper:first-child': {
|
|
653
|
+
marginTop: 0
|
|
631
654
|
}
|
|
632
655
|
}
|
|
633
656
|
});
|
|
@@ -1951,11 +1974,12 @@ const rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks = css({
|
|
|
1951
1974
|
[`.${HeadingAnchorWrapperClassName}`]: {
|
|
1952
1975
|
position: 'unset'
|
|
1953
1976
|
},
|
|
1954
|
-
'> .renderer-heading-wrapper
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1977
|
+
'> .renderer-heading-wrapper': {
|
|
1978
|
+
// Reserve space for the sortable-column icon so the heading+anchor wrapper never overlaps it.
|
|
1979
|
+
// Use padding (instead of margin on the heading) so we don't create a gap between the heading
|
|
1980
|
+
// text and the copy-link anchor button
|
|
1981
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
1982
|
+
paddingRight: '30px'
|
|
1959
1983
|
}
|
|
1960
1984
|
}
|
|
1961
1985
|
}
|
|
@@ -2387,7 +2411,7 @@ export const RendererStyleContainer = props => {
|
|
|
2387
2411
|
'--ak-renderer-editor-font-heading-h6': `${editorUGCToken('editor.font.heading.h6')}`,
|
|
2388
2412
|
'--ak-renderer-editor-font-normal-text': `${editorUGCToken('editor.font.body')}`
|
|
2389
2413
|
},
|
|
2390
|
-
css: [baseStyles, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? headingAnchorStyles : headingAnchorStylesDuplicateAnchor, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? hideHeadingCopyLinkWrapperStyles : hideHeadingCopyLinkWrapperStylesDuplicateAnchor, appearance === 'full-page' && isPreviewPanelResponsivenessOn && rendererFullPageStylesWithReducedPadding, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && rendererFullPageStyles, appearance === 'full-width' && rendererFullWidthStyles, (appearance === 'full-width' || appearance === 'max' && (expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true))) && !isTableResizingEnabled(appearance) && rendererFullWidthStylesForTableResizing, appearance === 'max' && (expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true)) && rendererMaxWidthStyles, rovoTelepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles,
|
|
2414
|
+
css: [baseStyles, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? headingAnchorStyles : headingAnchorStylesDuplicateAnchor, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? hideHeadingCopyLinkWrapperStyles : hideHeadingCopyLinkWrapperStylesDuplicateAnchor, appearance === 'full-page' && isPreviewPanelResponsivenessOn && rendererFullPageStylesWithReducedPadding, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && rendererFullPageStyles, appearance === 'full-width' && rendererFullWidthStyles, (appearance === 'full-width' || appearance === 'max' && (expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true))) && !isTableResizingEnabled(appearance) && rendererFullWidthStylesForTableResizing, appearance === 'max' && (expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true)) && rendererMaxWidthStyles, rovoTelepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) && headingWrapperInlineFlowStyles, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? headingWithAlignmentStyles : headingWithAlignmentStylesDuplicateAnchor, ruleSharedStyles, contentMode === 'compact' && isCompactModeSupported && extensionStyle, fg('platform_editor_typography_ugc') ? isCompactModeSupported ? paragraphStylesUGCScaledMargin : paragraphSharedStylesWithEditorUGC : isCompactModeSupported ? paragraphSharedStyleScaledMargin : paragraphSharedStyles, listsSharedStyles, browser.gecko && listsSharedStylesForGekko, indentationSharedStyles, fg('platform_editor__renderer_indentation_text_margin') && indentationSharedStylesWithMarginFix, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? blockMarksSharedStyles : blockMarksSharedStylesDuplicateAnchor, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles, expValEquals('platform_editor_text_highlight_padding', 'isEnabled', true) &&
|
|
2391
2415
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
2392
2416
|
textHighlightPaddingStyles, tasksAndDecisionsStyles, smartCardStyles, smartCardStylesAvatarFix, editorExperiment('platform_editor_preview_panel_linking_exp', true) && headerSmartCardStyles, smartCardStylesAvatarMarginFix, smartCardStylesAvatarListZeroMarginTop, fg('editor_inline_comments_on_inline_nodes') && rendererAnnotationStyles,
|
|
2393
2417
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
@@ -56,7 +56,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
56
56
|
const TABLE_INFO_TIMEOUT = 10000;
|
|
57
57
|
const RENDER_EVENT_SAMPLE_RATE = 0.2;
|
|
58
58
|
const packageName = "@atlaskit/renderer";
|
|
59
|
-
const packageVersion = "126.
|
|
59
|
+
const packageVersion = "126.5.1";
|
|
60
60
|
const setAsQueryContainerStyles = css({
|
|
61
61
|
containerName: 'ak-renderer-wrapper',
|
|
62
62
|
containerType: 'inline-size'
|
|
@@ -13,6 +13,7 @@ import { copyTextToClipboard } from '../utils/clipboard';
|
|
|
13
13
|
import HeadingAnchor from './heading-anchor';
|
|
14
14
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
15
15
|
import { css, jsx } from '@emotion/react';
|
|
16
|
+
var RENDERER_HEADING_WRAPPER = 'renderer-heading-wrapper';
|
|
16
17
|
var getCurrentUrlWithHash = function getCurrentUrlWithHash() {
|
|
17
18
|
var hash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
18
19
|
var url = new URL(window.location.href);
|
|
@@ -29,8 +30,11 @@ function hasRightAlignmentMark(marks) {
|
|
|
29
30
|
});
|
|
30
31
|
}
|
|
31
32
|
var wrapperStyles = css({
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
// Important: do NOT use flex here.
|
|
34
|
+
// With flex + baseline alignment, the anchor aligns to the *first line* of a multi-line heading,
|
|
35
|
+
// which visually places it at the top-right. We want the anchor to sit immediately after the
|
|
36
|
+
// last character of the heading (i.e. after the final wrapped line), so we use normal inline flow.
|
|
37
|
+
display: 'block'
|
|
34
38
|
});
|
|
35
39
|
function WrappedHeadingAnchor(_ref) {
|
|
36
40
|
var enableNestedHeaderLinks = _ref.enableNestedHeaderLinks,
|
|
@@ -140,30 +144,29 @@ function HeadingWithWrapper(props) {
|
|
|
140
144
|
mouseEntered.current = true;
|
|
141
145
|
}
|
|
142
146
|
};
|
|
143
|
-
return (
|
|
147
|
+
return jsx("div", {
|
|
144
148
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
);
|
|
149
|
+
className: RENDERER_HEADING_WRAPPER,
|
|
150
|
+
"data-testid": RENDERER_HEADING_WRAPPER,
|
|
151
|
+
"data-level": props.level,
|
|
152
|
+
css: wrapperStyles
|
|
153
|
+
}, showAnchorLink && headingId && isRightAligned && jsx(WrappedHeadingAnchor, {
|
|
154
|
+
level: props.level,
|
|
155
|
+
enableNestedHeaderLinks: enableNestedHeaderLinks,
|
|
156
|
+
headingId: headingId,
|
|
157
|
+
hideFromScreenReader: false
|
|
158
|
+
}), jsx(HX, {
|
|
159
|
+
id: headingIdToUse,
|
|
160
|
+
"data-local-id": localId,
|
|
161
|
+
"data-renderer-start-pos": dataAttributes['data-renderer-start-pos'],
|
|
162
|
+
"data-as-inline": asInline,
|
|
163
|
+
onMouseEnter: mouseEnterHandler
|
|
164
|
+
}, props.children), showAnchorLink && headingId && !isRightAligned && jsx(WrappedHeadingAnchor, {
|
|
165
|
+
level: props.level,
|
|
166
|
+
enableNestedHeaderLinks: enableNestedHeaderLinks,
|
|
167
|
+
headingId: headingId,
|
|
168
|
+
hideFromScreenReader: false
|
|
169
|
+
}));
|
|
167
170
|
}
|
|
168
171
|
|
|
169
172
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
var
|
|
2
|
+
var _css8;
|
|
3
3
|
/* eslint-disable @atlaskit/ui-styling-standard/no-important-styles, @atlaskit/ui-styling-standard/no-unsafe-selectors */
|
|
4
4
|
/* eslint-disable @atlaskit/ui-styling-standard/no-imported-style-values */
|
|
5
5
|
/* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values */
|
|
@@ -377,7 +377,7 @@ var blockquoteSharedStyles = css({
|
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
379
|
});
|
|
380
|
-
var
|
|
380
|
+
var headingsSharedStyles = css({
|
|
381
381
|
'& h1': {
|
|
382
382
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
383
383
|
font: "var(--ak-renderer-editor-font-heading-h1)",
|
|
@@ -444,6 +444,43 @@ var headingsSharedStylesWithEditorUGC = css({
|
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
446
|
});
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* When the copy-link a11y fix is enabled, the heading copy-link button is a sibling of the heading
|
|
450
|
+
* text within `.renderer-heading-wrapper`. To ensure the button sits immediately after the last
|
|
451
|
+
* rendered character (including when the heading wraps), the heading itself needs to participate in
|
|
452
|
+
* inline layout.
|
|
453
|
+
*
|
|
454
|
+
* Since inline elements don't support vertical margins in normal flow, we migrate the UGC heading
|
|
455
|
+
* `marginTop` values (from `headingsSharedStyles`) onto the wrapper.
|
|
456
|
+
*/
|
|
457
|
+
var headingWrapperInlineFlowStyles = css(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
458
|
+
// Ensure heading and copy-link button participate in inline flow so the button sits after the final wrapped line of text.
|
|
459
|
+
'& .renderer-heading-wrapper > h1, & .renderer-heading-wrapper > h2, & .renderer-heading-wrapper > h3, & .renderer-heading-wrapper > h4, & .renderer-heading-wrapper > h5, & .renderer-heading-wrapper > h6': {
|
|
460
|
+
display: 'inline'
|
|
461
|
+
}
|
|
462
|
+
}, "& .renderer-heading-wrapper > .".concat(HeadingAnchorWrapperClassName), {
|
|
463
|
+
display: 'inline',
|
|
464
|
+
verticalAlign: 'baseline'
|
|
465
|
+
}), '& .renderer-heading-wrapper[data-level="1"]', {
|
|
466
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
467
|
+
marginTop: '1.45833em'
|
|
468
|
+
}), '& .renderer-heading-wrapper[data-level="2"]', {
|
|
469
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
470
|
+
marginTop: '1.4em'
|
|
471
|
+
}), '& .renderer-heading-wrapper[data-level="3"]', {
|
|
472
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
473
|
+
marginTop: '1.31249em'
|
|
474
|
+
}), '& .renderer-heading-wrapper[data-level="4"]', {
|
|
475
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
476
|
+
marginTop: '1.25em'
|
|
477
|
+
}), '& .renderer-heading-wrapper[data-level="5"]', {
|
|
478
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
479
|
+
marginTop: '1.45833em'
|
|
480
|
+
}), '& .renderer-heading-wrapper[data-level="6"]', {
|
|
481
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
482
|
+
marginTop: '1.59091em'
|
|
483
|
+
}));
|
|
447
484
|
var headingWithAlignmentStylesDuplicateAnchor = css({
|
|
448
485
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
449
486
|
'.fabric-editor-block-mark.fabric-editor-alignment:not(:first-child)': {
|
|
@@ -488,42 +525,21 @@ var headingWithAlignmentStylesDuplicateAnchor = css({
|
|
|
488
525
|
}
|
|
489
526
|
});
|
|
490
527
|
var headingWithAlignmentStyles = css({
|
|
491
|
-
//
|
|
492
|
-
'.fabric-editor-block-mark.
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
},
|
|
499
|
-
h2: {
|
|
500
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
501
|
-
marginTop: '1.8em'
|
|
502
|
-
},
|
|
503
|
-
h3: {
|
|
504
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
505
|
-
marginTop: '2em'
|
|
506
|
-
},
|
|
507
|
-
h4: {
|
|
508
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
509
|
-
marginTop: '1.357em'
|
|
510
|
-
},
|
|
511
|
-
h5: {
|
|
512
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
513
|
-
marginTop: '1.667em'
|
|
514
|
-
},
|
|
515
|
-
h6: {
|
|
516
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
517
|
-
marginTop: '1.455em'
|
|
518
|
-
}
|
|
519
|
-
}
|
|
528
|
+
// Center alignment for heading wrapper - flex container needs justify-content instead of text-align
|
|
529
|
+
'.fabric-editor-block-mark[data-align="center"] > .renderer-heading-wrapper': {
|
|
530
|
+
justifyContent: 'center'
|
|
531
|
+
},
|
|
532
|
+
// Right/end alignment for heading wrapper - flex container needs justify-content instead of text-align
|
|
533
|
+
'.fabric-editor-block-mark[data-align="end"] > .renderer-heading-wrapper': {
|
|
534
|
+
justifyContent: 'flex-end'
|
|
520
535
|
},
|
|
521
536
|
// Set marginTop: 0 if alignment block is next to a gap cursor or widget that is first child
|
|
522
537
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
523
538
|
'.ProseMirror-gapcursor:first-child + .fabric-editor-block-mark.fabric-editor-alignment, .ProseMirror-widget:first-child + .fabric-editor-block-mark.fabric-editor-alignment, .ProseMirror-widget:first-child + .ProseMirror-widget:nth-child(2) + .fabric-editor-block-mark.fabric-editor-alignment': {
|
|
539
|
+
// With inline headings, apply marginTop to the wrapper (not the h1-h6).
|
|
524
540
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
525
|
-
'> .renderer-heading-wrapper:first-child
|
|
526
|
-
marginTop:
|
|
541
|
+
'> .renderer-heading-wrapper:first-child': {
|
|
542
|
+
marginTop: 0
|
|
527
543
|
}
|
|
528
544
|
}
|
|
529
545
|
});
|
|
@@ -583,13 +599,13 @@ var paragraphSharedStyleScaledMargin = css({
|
|
|
583
599
|
letterSpacing: '-0.005em'
|
|
584
600
|
}
|
|
585
601
|
});
|
|
586
|
-
var listsSharedStyles = css((
|
|
602
|
+
var listsSharedStyles = css((_css8 = {
|
|
587
603
|
/* =============== INDENTATION SPACING ========= */
|
|
588
604
|
'ul, ol': {
|
|
589
605
|
boxSizing: 'border-box',
|
|
590
606
|
paddingLeft: "var(--ed--list--item-counter--padding, ".concat(listItemCounterPadding, "px)")
|
|
591
607
|
}
|
|
592
|
-
}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(
|
|
608
|
+
}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_css8, "".concat(orderedListSelector, ", ").concat(bulletListSelector), {
|
|
593
609
|
/*
|
|
594
610
|
Ensures list item content adheres to the list's margin instead
|
|
595
611
|
of filling the entire block row. This is important to allow
|
|
@@ -621,7 +637,7 @@ var listsSharedStyles = css((_css7 = {
|
|
|
621
637
|
listStyleType: 'lower-alpha'
|
|
622
638
|
}), 'ol[data-indent-level="3"], ol[data-indent-level="6"]', {
|
|
623
639
|
listStyleType: 'lower-roman'
|
|
624
|
-
}), _defineProperty(_defineProperty(_defineProperty(
|
|
640
|
+
}), _defineProperty(_defineProperty(_defineProperty(_css8, 'ul[data-indent-level="1"], ul[data-indent-level="4"]', {
|
|
625
641
|
listStyleType: 'disc'
|
|
626
642
|
}), 'ul[data-indent-level="2"], ul[data-indent-level="5"]', {
|
|
627
643
|
listStyleType: 'circle'
|
|
@@ -1499,11 +1515,12 @@ var rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinksDuplicateAnchor =
|
|
|
1499
1515
|
}))))));
|
|
1500
1516
|
var rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks = css(_defineProperty({}, ".".concat(RendererCssClassName.DOCUMENT, " .").concat(TableSharedCssClassName.TABLE_CONTAINER), _defineProperty({}, ".".concat(TableSharedCssClassName.TABLE_NODE_WRAPPER, " > table, .").concat(TableSharedCssClassName.TABLE_STICKY_WRAPPER, " > table"), _defineProperty({}, ".".concat(RendererCssClassName.SORTABLE_COLUMN_WRAPPER), _defineProperty({}, ".".concat(RendererCssClassName.SORTABLE_COLUMN), _defineProperty(_defineProperty({}, ".".concat(HeadingAnchorWrapperClassName), {
|
|
1501
1517
|
position: 'unset'
|
|
1502
|
-
}), '> .renderer-heading-wrapper
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1518
|
+
}), '> .renderer-heading-wrapper', {
|
|
1519
|
+
// Reserve space for the sortable-column icon so the heading+anchor wrapper never overlaps it.
|
|
1520
|
+
// Use padding (instead of margin on the heading) so we don't create a gap between the heading
|
|
1521
|
+
// text and the copy-link anchor button
|
|
1522
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
1523
|
+
paddingRight: '30px'
|
|
1507
1524
|
}))))));
|
|
1508
1525
|
|
|
1509
1526
|
// @ts-expect-error - throw TS error when use !import in position.
|
|
@@ -1869,7 +1886,7 @@ export var RendererStyleContainer = function RendererStyleContainer(props) {
|
|
|
1869
1886
|
'--ak-renderer-editor-font-heading-h6': "".concat(editorUGCToken('editor.font.heading.h6')),
|
|
1870
1887
|
'--ak-renderer-editor-font-normal-text': "".concat(editorUGCToken('editor.font.body'))
|
|
1871
1888
|
},
|
|
1872
|
-
css: [baseStyles, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? headingAnchorStyles : headingAnchorStylesDuplicateAnchor, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? hideHeadingCopyLinkWrapperStyles : hideHeadingCopyLinkWrapperStylesDuplicateAnchor, appearance === 'full-page' && isPreviewPanelResponsivenessOn && rendererFullPageStylesWithReducedPadding, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && rendererFullPageStyles, appearance === 'full-width' && rendererFullWidthStyles, (appearance === 'full-width' || appearance === 'max' && (expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true))) && !isTableResizingEnabled(appearance) && rendererFullWidthStylesForTableResizing, appearance === 'max' && (expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true)) && rendererMaxWidthStyles, rovoTelepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles,
|
|
1889
|
+
css: [baseStyles, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? headingAnchorStyles : headingAnchorStylesDuplicateAnchor, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? hideHeadingCopyLinkWrapperStyles : hideHeadingCopyLinkWrapperStylesDuplicateAnchor, appearance === 'full-page' && isPreviewPanelResponsivenessOn && rendererFullPageStylesWithReducedPadding, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && rendererFullPageStyles, appearance === 'full-width' && rendererFullWidthStyles, (appearance === 'full-width' || appearance === 'max' && (expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true))) && !isTableResizingEnabled(appearance) && rendererFullWidthStylesForTableResizing, appearance === 'max' && (expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true)) && rendererMaxWidthStyles, rovoTelepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) && headingWrapperInlineFlowStyles, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? headingWithAlignmentStyles : headingWithAlignmentStylesDuplicateAnchor, ruleSharedStyles, contentMode === 'compact' && isCompactModeSupported && extensionStyle, fg('platform_editor_typography_ugc') ? isCompactModeSupported ? paragraphStylesUGCScaledMargin : paragraphSharedStylesWithEditorUGC : isCompactModeSupported ? paragraphSharedStyleScaledMargin : paragraphSharedStyles, listsSharedStyles, browser.gecko && listsSharedStylesForGekko, indentationSharedStyles, fg('platform_editor__renderer_indentation_text_margin') && indentationSharedStylesWithMarginFix, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? blockMarksSharedStyles : blockMarksSharedStylesDuplicateAnchor, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles, expValEquals('platform_editor_text_highlight_padding', 'isEnabled', true) &&
|
|
1873
1890
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
1874
1891
|
textHighlightPaddingStyles, tasksAndDecisionsStyles, smartCardStyles, smartCardStylesAvatarFix, editorExperiment('platform_editor_preview_panel_linking_exp', true) && headerSmartCardStyles, smartCardStylesAvatarMarginFix, smartCardStylesAvatarListZeroMarginTop, fg('editor_inline_comments_on_inline_nodes') && rendererAnnotationStyles,
|
|
1875
1892
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
@@ -61,7 +61,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
61
61
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
62
62
|
var RENDER_EVENT_SAMPLE_RATE = 0.2;
|
|
63
63
|
var packageName = "@atlaskit/renderer";
|
|
64
|
-
var packageVersion = "126.
|
|
64
|
+
var packageVersion = "126.5.1";
|
|
65
65
|
var setAsQueryContainerStyles = css({
|
|
66
66
|
containerName: 'ak-renderer-wrapper',
|
|
67
67
|
containerType: 'inline-size'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "126.5.
|
|
3
|
+
"version": "126.5.2",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"@atlaskit/status": "^3.1.0",
|
|
58
58
|
"@atlaskit/task-decision": "^19.2.0",
|
|
59
59
|
"@atlaskit/theme": "^21.0.0",
|
|
60
|
-
"@atlaskit/tmp-editor-statsig": "^17.
|
|
61
|
-
"@atlaskit/tokens": "^
|
|
60
|
+
"@atlaskit/tmp-editor-statsig": "^17.10.0",
|
|
61
|
+
"@atlaskit/tokens": "^11.0.0",
|
|
62
62
|
"@atlaskit/tooltip": "^20.14.0",
|
|
63
63
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
64
64
|
"@babel/runtime": "^7.0.0",
|