@atlaskit/renderer 114.11.1 → 114.12.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 +20 -0
- package/afm-cc/tsconfig.json +3 -0
- package/dist/cjs/react/marks/alignment.js +3 -15
- package/dist/cjs/react/nodes/blockCard.js +24 -8
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockContainer.js +3 -10
- package/dist/cjs/react/nodes/codeBlock/components/lightWeightCodeBlock.js +8 -53
- package/dist/cjs/react/nodes/layoutColumn.js +3 -11
- package/dist/cjs/react/nodes/media/index.js +28 -58
- package/dist/cjs/react/nodes/panel.js +2 -26
- package/dist/cjs/react/nodes/table/colgroup.js +5 -2
- package/dist/cjs/react/nodes/table/sticky.js +3 -57
- package/dist/cjs/react/nodes/table/table.js +6 -1
- package/dist/cjs/react/nodes/table.js +51 -23
- package/dist/cjs/react/nodes/tableNew.js +550 -0
- package/dist/cjs/ui/Expand.js +12 -62
- package/dist/cjs/ui/Renderer/RendererStyleContainer.js +19 -42
- package/dist/cjs/ui/Renderer/breakout-ssr.js +22 -22
- package/dist/cjs/ui/Renderer/index.js +4 -2
- package/dist/cjs/ui/Renderer/style.js +2 -208
- package/dist/cjs/ui/annotations/draft/component.js +2 -17
- package/dist/cjs/ui/annotations/element/mark.js +12 -61
- package/dist/es2019/react/marks/alignment.js +2 -17
- package/dist/es2019/react/nodes/blockCard.js +24 -8
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockContainer.js +2 -39
- package/dist/es2019/react/nodes/codeBlock/components/lightWeightCodeBlock.js +5 -50
- package/dist/es2019/react/nodes/layoutColumn.js +4 -12
- package/dist/es2019/react/nodes/media/index.js +3 -36
- package/dist/es2019/react/nodes/panel.js +2 -41
- package/dist/es2019/react/nodes/table/colgroup.js +5 -2
- package/dist/es2019/react/nodes/table/sticky.js +3 -70
- package/dist/es2019/react/nodes/table/table.js +6 -1
- package/dist/es2019/react/nodes/table.js +50 -22
- package/dist/es2019/react/nodes/tableNew.js +501 -0
- package/dist/es2019/ui/Expand.js +11 -67
- package/dist/es2019/ui/Renderer/RendererStyleContainer.js +20 -43
- package/dist/es2019/ui/Renderer/breakout-ssr.js +22 -22
- package/dist/es2019/ui/Renderer/index.js +4 -2
- package/dist/es2019/ui/Renderer/style.js +1 -889
- package/dist/es2019/ui/annotations/draft/component.js +2 -15
- package/dist/es2019/ui/annotations/element/mark.js +9 -71
- package/dist/esm/react/marks/alignment.js +2 -16
- package/dist/esm/react/nodes/blockCard.js +24 -8
- package/dist/esm/react/nodes/codeBlock/components/codeBlockContainer.js +2 -11
- package/dist/esm/react/nodes/codeBlock/components/lightWeightCodeBlock.js +7 -52
- package/dist/esm/react/nodes/layoutColumn.js +4 -12
- package/dist/esm/react/nodes/media/index.js +28 -58
- package/dist/esm/react/nodes/panel.js +3 -27
- package/dist/esm/react/nodes/table/colgroup.js +5 -2
- package/dist/esm/react/nodes/table/sticky.js +3 -57
- package/dist/esm/react/nodes/table/table.js +6 -1
- package/dist/esm/react/nodes/table.js +51 -21
- package/dist/esm/react/nodes/tableNew.js +544 -0
- package/dist/esm/ui/Expand.js +12 -62
- package/dist/esm/ui/Renderer/RendererStyleContainer.js +20 -43
- package/dist/esm/ui/Renderer/breakout-ssr.js +22 -22
- package/dist/esm/ui/Renderer/index.js +4 -2
- package/dist/esm/ui/Renderer/style.js +1 -203
- package/dist/esm/ui/annotations/draft/component.js +2 -17
- package/dist/esm/ui/annotations/element/mark.js +9 -56
- package/dist/types/react/nodes/codeBlock/components/lightWeightCodeBlock.d.ts +1 -1
- package/dist/types/react/nodes/table.d.ts +35 -254
- package/dist/types/react/nodes/tableNew.d.ts +83 -0
- package/dist/types/ui/Renderer/breakout-ssr.d.ts +1 -2
- package/dist/types/ui/Renderer/style.d.ts +0 -11
- package/dist/types/ui/annotations/element/mark.d.ts +30 -6
- package/dist/types-ts4.5/react/nodes/codeBlock/components/lightWeightCodeBlock.d.ts +1 -1
- package/dist/types-ts4.5/react/nodes/table.d.ts +35 -254
- package/dist/types-ts4.5/react/nodes/tableNew.d.ts +83 -0
- package/dist/types-ts4.5/ui/Renderer/breakout-ssr.d.ts +1 -2
- package/dist/types-ts4.5/ui/Renderer/style.d.ts +0 -11
- package/dist/types-ts4.5/ui/annotations/element/mark.d.ts +30 -6
- package/package.json +14 -7
|
@@ -10,7 +10,7 @@ var _css, _css3;
|
|
|
10
10
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
11
11
|
import { css, jsx } from '@emotion/react';
|
|
12
12
|
import { B300, B400, B500, N20, N200, N30A, N40A, N60A, N800, R50, R500, Y300, Y75 } from '@atlaskit/theme/colors';
|
|
13
|
-
import { FullPagePadding
|
|
13
|
+
import { FullPagePadding } from './style';
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import { RendererCssClassName } from '../../consts';
|
|
16
16
|
import { akEditorBlockquoteBorderColor, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorLineHeight, akEditorSelectedNodeClassName, akEditorShadowZIndex, akEditorStickyHeaderZIndex, akEditorTableBorder, akEditorTableCellMinWidth, akEditorTableNumberColumnWidth, akEditorTableToolbar, blockNodesVerticalMargin, gridMediumMaxWidth } from '@atlaskit/editor-shared-styles';
|
|
@@ -1349,58 +1349,35 @@ export var RendererStyleContainer = function RendererStyleContainer(props) {
|
|
|
1349
1349
|
appearance = props.appearance,
|
|
1350
1350
|
allowNestedHeaderLinks = props.allowNestedHeaderLinks,
|
|
1351
1351
|
allowColumnSorting = props.allowColumnSorting,
|
|
1352
|
-
allowAnnotations = props.allowAnnotations,
|
|
1353
|
-
allowTableResizing = props.allowTableResizing,
|
|
1354
1352
|
useBlockRenderForCodeBlock = props.useBlockRenderForCodeBlock,
|
|
1355
1353
|
children = props.children,
|
|
1356
1354
|
innerRef = props.innerRef,
|
|
1357
1355
|
testId = props.testId;
|
|
1358
1356
|
var isAdvancedLayoutsOn = editorExperiment('advanced_layouts', true);
|
|
1359
|
-
if (fg('platform_editor_emotion_refactor_renderer')) {
|
|
1360
|
-
return (
|
|
1361
|
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions, @atlassian/a11y/interactive-element-not-keyboard-focusable
|
|
1362
|
-
jsx("div", {
|
|
1363
|
-
ref: innerRef,
|
|
1364
|
-
onClick: onClick,
|
|
1365
|
-
onMouseDown: onMouseDown,
|
|
1366
|
-
style: {
|
|
1367
|
-
'--ak-renderer-base-font-size': "".concat(getBaseFontSize(appearance), "px"),
|
|
1368
|
-
'--ak-renderer-editor-font-heading-h1': "".concat(editorUGCToken('editor.font.heading.h1')),
|
|
1369
|
-
'--ak-renderer-editor-font-heading-h2': "".concat(editorUGCToken('editor.font.heading.h2')),
|
|
1370
|
-
'--ak-renderer-editor-font-heading-h3': "".concat(editorUGCToken('editor.font.heading.h3')),
|
|
1371
|
-
'--ak-renderer-editor-font-heading-h4': "".concat(editorUGCToken('editor.font.heading.h4')),
|
|
1372
|
-
'--ak-renderer-editor-font-heading-h5': "".concat(editorUGCToken('editor.font.heading.h5')),
|
|
1373
|
-
'--ak-renderer-editor-font-heading-h6': "".concat(editorUGCToken('editor.font.heading.h6')),
|
|
1374
|
-
'--ak-renderer-editor-font-normal-text': "".concat(editorUGCToken('editor.font.body'))
|
|
1375
|
-
},
|
|
1376
|
-
css: [baseStyles, appearance === 'full-page' && rendererFullPageStyles, appearance === 'full-width' && rendererFullWidthStyles, !isTableResizingEnabled(appearance) && rendererFullWidthStylesForTableResizing, telepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, fg('platform_editor_typography_ugc') ? headingsSharedStylesWithEditorUGC : headingsSharedStyles, headingWithAlignmentStyles, ruleSharedStyles, fg('platform_editor_typography_ugc') ? paragraphSharedStylesWithEditorUGC : paragraphSharedStyles, listsSharedStyles, browser.gecko && listsSharedStylesForGekko, indentationSharedStyles, blockMarksSharedStyles, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles, tasksAndDecisionsStyles, smartCardStyles, fg('platform-linking-visual-refresh-v1') && smartCardStylesAvatarFix,
|
|
1377
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
1378
|
-
fg('editor_inline_comments_on_inline_nodes') && rendererAnnotationStyles,
|
|
1379
|
-
// eslint-disable-next-line @atlaskit/platform/no-preconditioning, @atlaskit/platform/ensure-feature-flag-prefix
|
|
1380
|
-
fg('editor_inline_comments_on_inline_nodes') &&
|
|
1381
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
1382
|
-
fg('annotations_align_editor_and_renderer_styles') && rendererAnnotationStylesCommentHeightFix, baseOtherStyles, allowNestedHeaderLinks && alignedHeadingAnchorStyle, mediaSingleSharedStyle, tableSharedStyle, tableRendererHeaderStylesForTableCellOnly, 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],
|
|
1383
|
-
"data-testid": testId
|
|
1384
|
-
}, children)
|
|
1385
|
-
);
|
|
1386
|
-
}
|
|
1387
1357
|
return (
|
|
1388
1358
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions, @atlassian/a11y/interactive-element-not-keyboard-focusable
|
|
1389
1359
|
jsx("div", {
|
|
1390
1360
|
ref: innerRef,
|
|
1391
1361
|
onClick: onClick,
|
|
1392
|
-
onMouseDown: onMouseDown
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
}
|
|
1362
|
+
onMouseDown: onMouseDown,
|
|
1363
|
+
style: {
|
|
1364
|
+
'--ak-renderer-base-font-size': "".concat(getBaseFontSize(appearance), "px"),
|
|
1365
|
+
'--ak-renderer-editor-font-heading-h1': "".concat(editorUGCToken('editor.font.heading.h1')),
|
|
1366
|
+
'--ak-renderer-editor-font-heading-h2': "".concat(editorUGCToken('editor.font.heading.h2')),
|
|
1367
|
+
'--ak-renderer-editor-font-heading-h3': "".concat(editorUGCToken('editor.font.heading.h3')),
|
|
1368
|
+
'--ak-renderer-editor-font-heading-h4': "".concat(editorUGCToken('editor.font.heading.h4')),
|
|
1369
|
+
'--ak-renderer-editor-font-heading-h5': "".concat(editorUGCToken('editor.font.heading.h5')),
|
|
1370
|
+
'--ak-renderer-editor-font-heading-h6': "".concat(editorUGCToken('editor.font.heading.h6')),
|
|
1371
|
+
'--ak-renderer-editor-font-normal-text': "".concat(editorUGCToken('editor.font.body'))
|
|
1372
|
+
},
|
|
1373
|
+
css: [baseStyles, appearance === 'full-page' && rendererFullPageStyles, appearance === 'full-width' && rendererFullWidthStyles, appearance === 'full-width' && !isTableResizingEnabled(appearance) && rendererFullWidthStylesForTableResizing, telepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, fg('platform_editor_typography_ugc') ? headingsSharedStylesWithEditorUGC : headingsSharedStyles, headingWithAlignmentStyles, ruleSharedStyles, fg('platform_editor_typography_ugc') ? paragraphSharedStylesWithEditorUGC : paragraphSharedStyles, listsSharedStyles, browser.gecko && listsSharedStylesForGekko, indentationSharedStyles, blockMarksSharedStyles, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles, tasksAndDecisionsStyles, smartCardStyles, fg('platform-linking-visual-refresh-v1') && smartCardStylesAvatarFix,
|
|
1374
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
1375
|
+
fg('editor_inline_comments_on_inline_nodes') && rendererAnnotationStyles,
|
|
1376
|
+
// eslint-disable-next-line @atlaskit/platform/no-preconditioning, @atlaskit/platform/ensure-feature-flag-prefix
|
|
1377
|
+
fg('editor_inline_comments_on_inline_nodes') &&
|
|
1378
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
1379
|
+
fg('annotations_align_editor_and_renderer_styles') && rendererAnnotationStylesCommentHeightFix, baseOtherStyles, allowNestedHeaderLinks && alignedHeadingAnchorStyle, mediaSingleSharedStyle, tableSharedStyle, tableRendererHeaderStylesForTableCellOnly, 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],
|
|
1403
1380
|
"data-testid": testId
|
|
1404
|
-
},
|
|
1381
|
+
}, children)
|
|
1405
1382
|
);
|
|
1406
1383
|
};
|
|
@@ -5,7 +5,6 @@ import { FullPagePadding } from './style';
|
|
|
5
5
|
/**
|
|
6
6
|
* Inline Script that updates breakout node width on client side,
|
|
7
7
|
* before main JavaScript bundle is ready.
|
|
8
|
-
*
|
|
9
8
|
* More info: https://product-fabric.atlassian.net/wiki/spaces/E/pages/1216218119/Renderer+SSR+for+Breakout+Nodes
|
|
10
9
|
*/
|
|
11
10
|
export function BreakoutSSRInlineScript(_ref) {
|
|
@@ -25,26 +24,25 @@ export function BreakoutSSRInlineScript(_ref) {
|
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
26
|
var id = Math.floor(Math.random() * (9999999999 - 9999 + 1)) + 9999;
|
|
28
|
-
var context = createBreakoutInlineScript(id);
|
|
29
27
|
return /*#__PURE__*/React.createElement("script", {
|
|
30
28
|
"data-breakout-script-id": id
|
|
31
29
|
// To investigate if we can replace this.
|
|
32
30
|
// eslint-disable-next-line react/no-danger
|
|
33
31
|
,
|
|
34
32
|
dangerouslySetInnerHTML: {
|
|
35
|
-
__html:
|
|
33
|
+
__html: fg('platform-ssr-table-resize') ? createBreakoutInlineScript(id, true) : createBreakoutInlineScript(id)
|
|
36
34
|
},
|
|
37
35
|
"data-testid": "breakout-ssr-inline-script"
|
|
38
36
|
});
|
|
39
37
|
}
|
|
40
|
-
export function createBreakoutInlineScript(id) {
|
|
41
|
-
return "\n\t (function(window){\n\t\tif(typeof window !== 'undefined' && window.__RENDERER_BYPASS_BREAKOUT_SSR__) {\n\t\t\treturn;\n\t\t}\n ".concat(breakoutInlineScriptContext, ";\n (").concat(applyBreakoutAfterSSR.toString(), ")(\"").concat(id, "\", breakoutConsts, ").concat(
|
|
38
|
+
export function createBreakoutInlineScript(id, optionalFlagArg) {
|
|
39
|
+
return "\n\t (function(window){\n\t\tif(typeof window !== 'undefined' && window.__RENDERER_BYPASS_BREAKOUT_SSR__) {\n\t\t\treturn;\n\t\t}\n ".concat(breakoutInlineScriptContext, ";\n (").concat(applyBreakoutAfterSSR.toString(), ")(\"").concat(id, "\", breakoutConsts, ").concat(optionalFlagArg !== null && optionalFlagArg !== void 0 ? optionalFlagArg : false, ");\n })(window);\n");
|
|
42
40
|
}
|
|
43
41
|
export var breakoutInlineScriptContext = "\n var breakoutConsts = ".concat(JSON.stringify(breakoutConsts), ";\n breakoutConsts.mapBreakpointToLayoutMaxWidth = ").concat(breakoutConsts.mapBreakpointToLayoutMaxWidth.toString(), ";\n breakoutConsts.getBreakpoint = ").concat(breakoutConsts.getBreakpoint.toString(), ";\n breakoutConsts.calcBreakoutWidth = ").concat(breakoutConsts.calcBreakoutWidth.toString(), ";\n breakoutConsts.calcBreakoutWithCustomWidth = ").concat(breakoutConsts.calcBreakoutWithCustomWidth.toString(), ";\n breakoutConsts.calcLineLength = ").concat(breakoutConsts.calcLineLength.toString(), ";\n breakoutConsts.calcWideWidth = ").concat(breakoutConsts.calcWideWidth.toString(), ";\n breakoutConsts.FullPagePadding = ").concat(FullPagePadding.toString(), ";\n");
|
|
44
42
|
|
|
45
43
|
// Ignored via go/ees005
|
|
46
44
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
47
|
-
function applyBreakoutAfterSSR(id, breakoutConsts,
|
|
45
|
+
function applyBreakoutAfterSSR(id, breakoutConsts, isFeatureFlagEnabled) {
|
|
48
46
|
var MEDIA_NODE_TYPE = 'mediaSingle';
|
|
49
47
|
var WIDE_LAYOUT_MODES = ['full-width', 'wide', 'custom'];
|
|
50
48
|
function findUp(element, condition) {
|
|
@@ -58,7 +56,7 @@ function applyBreakoutAfterSSR(id, breakoutConsts, shouldFixTableResizing) {
|
|
|
58
56
|
element = element.parentElement;
|
|
59
57
|
}
|
|
60
58
|
}
|
|
61
|
-
var renderer = findUp(document.querySelector(
|
|
59
|
+
var renderer = findUp(document.querySelector("[data-breakout-script-id=\"".concat(id, "\"]")), function (elem) {
|
|
62
60
|
var _elem$parentElement;
|
|
63
61
|
return !!((_elem$parentElement = elem.parentElement) !== null && _elem$parentElement !== void 0 && _elem$parentElement.classList.contains('ak-renderer-wrapper'));
|
|
64
62
|
});
|
|
@@ -70,7 +68,23 @@ function applyBreakoutAfterSSR(id, breakoutConsts, shouldFixTableResizing) {
|
|
|
70
68
|
if (item.target.nodeType !== Node.ELEMENT_NODE) {
|
|
71
69
|
return;
|
|
72
70
|
}
|
|
71
|
+
if (
|
|
72
|
+
/**
|
|
73
|
+
* The mutation observer is only called once per added node.
|
|
74
|
+
* The above condition only deals with direct children of <div class="ak-renderer-document" />
|
|
75
|
+
* When it is initially called on the direct children, not all the sub children have loaded.
|
|
76
|
+
* So nested media elements which are not immediately loaded as sub children are not available in the above conditional.
|
|
77
|
+
* Thus adding this conditional to deal with all media elements directly.
|
|
78
|
+
*/
|
|
79
|
+
// Ignored via go/ees005
|
|
80
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
81
|
+
item.target.dataset.nodeType === MEDIA_NODE_TYPE) {
|
|
82
|
+
// Ignored via go/ees005
|
|
83
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
84
|
+
applyMediaBreakout(item.target);
|
|
85
|
+
}
|
|
73
86
|
|
|
87
|
+
// Remove with feature gate 'platform-ssr-table-resize'
|
|
74
88
|
// Ignored via go/ees005
|
|
75
89
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
76
90
|
if (item.target.classList.contains('ak-renderer-document')) {
|
|
@@ -90,7 +104,7 @@ function applyBreakoutAfterSSR(id, breakoutConsts, shouldFixTableResizing) {
|
|
|
90
104
|
}
|
|
91
105
|
|
|
92
106
|
// When flag is on we are using CSS to calculate the table width thus don't need logic below to set the width and left.
|
|
93
|
-
if (!
|
|
107
|
+
if (!isFeatureFlagEnabled) {
|
|
94
108
|
if (node.classList.contains('pm-table-container') && mode === 'custom') {
|
|
95
109
|
// Ignored via go/ees005
|
|
96
110
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -129,20 +143,6 @@ function applyBreakoutAfterSSR(id, breakoutConsts, shouldFixTableResizing) {
|
|
|
129
143
|
}
|
|
130
144
|
}
|
|
131
145
|
});
|
|
132
|
-
} else if (
|
|
133
|
-
/**
|
|
134
|
-
* The mutation observer is only called once per added node.
|
|
135
|
-
* The above condition only deals with direct children of <div class="ak-renderer-document" />
|
|
136
|
-
* When it is initially called on the direct children, not all the sub children have loaded.
|
|
137
|
-
* So nested media elements which are not immediately loaded as sub children are not available in the above conditional.
|
|
138
|
-
* Thus adding this conditional to deal with all media elements directly.
|
|
139
|
-
*/
|
|
140
|
-
// Ignored via go/ees005
|
|
141
|
-
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
142
|
-
item.target.dataset.nodeType === MEDIA_NODE_TYPE) {
|
|
143
|
-
// Ignored via go/ees005
|
|
144
|
-
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
145
|
-
applyMediaBreakout(item.target);
|
|
146
146
|
}
|
|
147
147
|
});
|
|
148
148
|
});
|
|
@@ -49,7 +49,7 @@ import { removeEmptySpaceAroundContent } from './rendererHelper';
|
|
|
49
49
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
50
50
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
51
51
|
var packageName = "@atlaskit/renderer";
|
|
52
|
-
var packageVersion = "114.
|
|
52
|
+
var packageVersion = "114.12.0";
|
|
53
53
|
var setAsQueryContainerStyles = css({
|
|
54
54
|
containerName: 'ak-renderer-wrapper',
|
|
55
55
|
containerType: 'inline-size',
|
|
@@ -438,6 +438,7 @@ export var RendererFunctionalComponent = function RendererFunctionalComponent(pr
|
|
|
438
438
|
}, jsx(UnsupportedBlock, null));
|
|
439
439
|
}
|
|
440
440
|
};
|
|
441
|
+
var RendererFunctionalComponentMemoized = /*#__PURE__*/React.memo(RendererFunctionalComponent);
|
|
441
442
|
export function Renderer(props) {
|
|
442
443
|
var _React$useContext = React.useContext(AnnotationsPositionContext),
|
|
443
444
|
startPos = _React$useContext.startPos;
|
|
@@ -445,7 +446,8 @@ export function Renderer(props) {
|
|
|
445
446
|
isTopLevelRenderer = _useRendererContext.isTopLevelRenderer;
|
|
446
447
|
var _ref = useContext(ValidationContext) || {},
|
|
447
448
|
skipValidation = _ref.skipValidation;
|
|
448
|
-
|
|
449
|
+
var RendererComponent = fg('cc_perf_reduce_rerenders') ? RendererFunctionalComponentMemoized : RendererFunctionalComponent;
|
|
450
|
+
return jsx(RendererComponent
|
|
449
451
|
// Ignored via go/ees005
|
|
450
452
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
451
453
|
, _extends({}, props, {
|
|
@@ -1,204 +1,2 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
3
|
-
/* eslint-disable @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation */
|
|
4
|
-
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
5
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
|
-
import { css } from '@emotion/react';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
-
// Ignored via go/ees005
|
|
10
|
-
// eslint-disable-next-line import/no-namespace
|
|
11
|
-
import * as colors from '@atlaskit/theme/colors';
|
|
12
|
-
import { N60A, Y300, Y75, N40A } from '@atlaskit/theme/colors';
|
|
13
|
-
import { getGlobalTheme } from '@atlaskit/tokens';
|
|
14
|
-
import { mediaInlineImageStyles } from '@atlaskit/editor-common/media-inline';
|
|
15
|
-
import { tableSharedStyle, columnLayoutSharedStyle, columnLayoutResponsiveSharedStyle, columnLayoutResponsiveRendererStyles, blockquoteSharedStyles, headingsSharedStyles, ruleSharedStyles, whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, mediaSingleSharedStyle, TableSharedCssClassName, tableMarginTop, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, richMediaClassName, tasksAndDecisionsStyles, getSmartCardSharedStyles, smartCardSharedStyles, tableCellPadding, textColorStyles, backgroundColorStyles, codeBlockInListSafariFix, SmartCardSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
16
|
-
import { shadowClassNames, shadowObserverClassNames } from '@atlaskit/editor-common/ui';
|
|
17
|
-
import { browser } from '@atlaskit/editor-common/browser';
|
|
18
|
-
import { editorFontSize, blockNodesVerticalMargin, akEditorTableToolbar, akEditorTableBorder, akEditorTableNumberColumnWidth, gridMediumMaxWidth, akEditorFullWidthLayoutWidth, akEditorStickyHeaderZIndex, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
19
|
-
import { RendererCssClassName } from '../../consts';
|
|
20
|
-
import { HeadingAnchorWrapperClassName } from '../../react/nodes/heading-anchor';
|
|
21
|
-
import { getLightWeightCodeBlockStylesForRootRendererStyleSheet } from '../../react/nodes/codeBlock/components/lightWeightCodeBlock';
|
|
22
|
-
import { isTableResizingEnabled, isStickyScrollbarEnabled } from '../../react/nodes/table';
|
|
23
|
-
import { SORTABLE_COLUMN_ICON_CLASSNAME } from '@atlaskit/editor-common/table';
|
|
24
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
25
1
|
export var FullPagePadding = 32;
|
|
26
|
-
var
|
|
27
|
-
export var TELEPOINTER_ID = 'ai-streaming-telepointer';
|
|
28
|
-
var telepointerStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t#", " {\n\t\tdisplay: inline-block;\n\t\tposition: relative;\n\t\twidth: 1.5px;\n\t\theight: 25px;\n\t\tbackground-color: ", ";\n\t\tmargin-left: ", ";\n\n\t\t&::after {\n\t\t\tcontent: 'AI';\n\t\t\tposition: absolute;\n\t\t\tdisplay: block;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\tfont-size: 10px;\n\t\t\tfont-weight: ", ";\n\t\t\twidth: 12.5px;\n\t\t\theight: 13px;\n\t\t\tpadding-top: 1px;\n\t\t\tpadding-left: 1.5px;\n\t\t\tline-height: initial;\n\t\t\tborder-radius: 0px 2px 2px 0px;\n\t\t\tcolor: ", ";\n\t\t\tbackground-color: ", ";\n\t\t}\n\t}\n"])), TELEPOINTER_ID, "var(--ds-background-brand-bold, #0C66E4)", "var(--ds-space-025, 2px)", "var(--ds-font-weight-bold, 700)", "var(--ds-text-inverse, white)", "var(--ds-background-brand-bold, #0C66E4)");
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* **DEPRECATED**
|
|
32
|
-
*
|
|
33
|
-
* Originally defined in `@atlaskit/theme/typography`, but moved here as it has since been deleted in favor of typography tokens.
|
|
34
|
-
* This should be removed as part of editor token work. More info:
|
|
35
|
-
* https://atlassian.slack.com/archives/C075G5D7ZP1/p1733449725865539?thread_ts=1732159801.409789&cid=C075G5D7ZP1
|
|
36
|
-
* */
|
|
37
|
-
var headingSizesImport = {
|
|
38
|
-
h900: {
|
|
39
|
-
size: 35,
|
|
40
|
-
lineHeight: 40
|
|
41
|
-
},
|
|
42
|
-
h800: {
|
|
43
|
-
size: 29,
|
|
44
|
-
lineHeight: 32
|
|
45
|
-
},
|
|
46
|
-
h700: {
|
|
47
|
-
size: 24,
|
|
48
|
-
lineHeight: 28
|
|
49
|
-
},
|
|
50
|
-
h600: {
|
|
51
|
-
size: 20,
|
|
52
|
-
lineHeight: 24
|
|
53
|
-
},
|
|
54
|
-
h500: {
|
|
55
|
-
size: 16,
|
|
56
|
-
lineHeight: 20
|
|
57
|
-
},
|
|
58
|
-
h400: {
|
|
59
|
-
size: 14,
|
|
60
|
-
lineHeight: 16
|
|
61
|
-
},
|
|
62
|
-
h300: {
|
|
63
|
-
size: 12,
|
|
64
|
-
lineHeight: 16
|
|
65
|
-
},
|
|
66
|
-
h200: {
|
|
67
|
-
size: 12,
|
|
68
|
-
lineHeight: 16
|
|
69
|
-
},
|
|
70
|
-
h100: {
|
|
71
|
-
size: 11,
|
|
72
|
-
lineHeight: 16
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
var getLineHeight = function getLineHeight(fontCode) {
|
|
76
|
-
return headingSizesImport[fontCode].lineHeight / headingSizesImport[fontCode].size;
|
|
77
|
-
};
|
|
78
|
-
var headingSizes = {
|
|
79
|
-
h1: {
|
|
80
|
-
lineHeight: getLineHeight('h700')
|
|
81
|
-
},
|
|
82
|
-
h2: {
|
|
83
|
-
lineHeight: getLineHeight('h600')
|
|
84
|
-
},
|
|
85
|
-
h3: {
|
|
86
|
-
lineHeight: getLineHeight('h500')
|
|
87
|
-
},
|
|
88
|
-
h4: {
|
|
89
|
-
lineHeight: getLineHeight('h400')
|
|
90
|
-
},
|
|
91
|
-
h5: {
|
|
92
|
-
lineHeight: getLineHeight('h300')
|
|
93
|
-
},
|
|
94
|
-
h6: {
|
|
95
|
-
lineHeight: getLineHeight('h100')
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
var headingAnchorStyle = function headingAnchorStyle(headingTag) {
|
|
99
|
-
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\t/**\n * The copy link button doesn't reserve space in the DOM so that\n * the text alignment isn't impacted by the button/icon's space.\n */\n\t.", " {\n\t\tposition: absolute;\n\t\theight: ", "em;\n\n\t\tmargin-left: ", ";\n\n\t\tbutton {\n\t\t\tpadding-left: 0;\n\t\t\tpadding-right: 0;\n\t\t}\n\t}\n\n\t/**\n * Applies hover effects to the heading anchor link button\n * to fade in when the user rolls over the heading.\n *\n * The link is persistent on mobile, so we use feature detection\n * to enable hover effects for systems that support it (desktop).\n *\n * @see https://caniuse.com/mdn-css_at-rules_media_hover\n */\n\t@media (hover: hover) and (pointer: fine) {\n\t\t.", " {\n\t\t\t> button {\n\t\t\t\topacity: 0;\n\t\t\t\ttransform: translate(-8px, 0px);\n\t\t\t\ttransition:\n\t\t\t\t\topacity 0.2s ease 0s,\n\t\t\t\t\ttransform 0.2s ease 0s;\n\t\t\t}\n\t\t}\n\n\t\t&:hover {\n\t\t\t.", " > button {\n\t\t\t\topacity: 1;\n\t\t\t\ttransform: none !important;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n * Adds the visibility of the button when in focus through keyboard navigation.\n */\n\t.", " {\n\t\tbutton:focus {\n\t\t\topacity: 1;\n\t\t\ttransform: none !important;\n\t\t}\n\t}\n"])), HeadingAnchorWrapperClassName, headingSizes[headingTag].lineHeight, "var(--ds-space-075, 6px)", HeadingAnchorWrapperClassName, HeadingAnchorWrapperClassName, HeadingAnchorWrapperClassName);
|
|
100
|
-
};
|
|
101
|
-
var alignedHeadingAnchorStyle = function alignedHeadingAnchorStyle(_ref) {
|
|
102
|
-
var allowNestedHeaderLinks = _ref.allowNestedHeaderLinks;
|
|
103
|
-
if (!allowNestedHeaderLinks) {
|
|
104
|
-
return '';
|
|
105
|
-
}
|
|
106
|
-
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\t\t.fabric-editor-block-mark[data-align] > {\n\t\t\th1,\n\t\t\th2,\n\t\t\th3,\n\t\t\th4,\n\t\t\th5,\n\t\t\th6 {\n\t\t\t\tposition: relative;\n\t\t\t}\n\t\t}\n\n\t\t/**\n * For right-alignment we flip the link to be before the heading\n * text so that the text is flush up against the edge of the editor's\n * container edge.\n */\n\t\t.fabric-editor-block-mark:not([data-align='center'])[data-align] {\n\t\t\t.", " {\n\t\t\t\tmargin: 0 ", " 0 0;\n\t\t\t\t// If the anchor is right aligned then the left side of the heading\n\t\t\t\t// is aligned with the left side of the anchor.\n\t\t\t\t// In order to align as expected we transform it the width of the element (plus our expected 6px)\n\t\t\t\t// to the left\n\t\t\t\ttransform: translateX(calc(-100% - ", "));\n\t\t\t}\n\n\t\t\t@media (hover: hover) and (pointer: fine) {\n\t\t\t\t.", " > button {\n\t\t\t\t\ttransform: translate(8px, 0px);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t"])), HeadingAnchorWrapperClassName, "var(--ds-space-075, 6px)", "var(--ds-space-075, 6px)", HeadingAnchorWrapperClassName);
|
|
107
|
-
};
|
|
108
|
-
var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
|
|
109
|
-
var allowColumnSorting = _ref2.allowColumnSorting,
|
|
110
|
-
allowNestedHeaderLinks = _ref2.allowNestedHeaderLinks;
|
|
111
|
-
if (!allowColumnSorting) {
|
|
112
|
-
return '';
|
|
113
|
-
}
|
|
114
|
-
var headingsCss = '';
|
|
115
|
-
if (allowNestedHeaderLinks) {
|
|
116
|
-
headingsCss = "\n /**\n * When the sort button is enabled we want the heading's copy link button\n * to reserve space so that it can prematurely wrap to avoid the button\n * being displayed underneath the sort button (hidden or obscured).\n *\n * The two buttons fight each other since the sort button is displayed\n * on hover of the <th /> and the copy link button is displayed on hover\n * of the heading.\n *\n * Note that this can break the WYSIWYG experience in the case where\n * a heading fills the width of the table cell and the only thing which\n * wraps is the copy link button. This is hopefully a rare fringe case.\n */\n .".concat(HeadingAnchorWrapperClassName, " {\n position: unset;\n }\n > {\n h1, h2, h3, h4, h5, h6 {\n margin-right: 30px;\n }\n }\n ");
|
|
117
|
-
}
|
|
118
|
-
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n\t\t.", " {\n\t\t\tpadding: 0;\n\n\t\t\t.", " {\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tpadding: ", "px;\n\t\t\t\tborder-width: 1.5px;\n\t\t\t\tborder-style: solid;\n\t\t\t\tborder-color: transparent;\n\n\t\t\t\t> *:first-child {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t> .ProseMirror-gapcursor:first-child + *,\n\t\t\t\t> style:first-child + .ProseMirror-gapcursor + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t> .ProseMirror-gapcursor:first-child + span + *,\n\t\t\t\t> style:first-child + .ProseMirror-gapcursor + span + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t@supports selector(:focus-visible) {\n\t\t\t\t\t&:focus {\n\t\t\t\t\t\toutline: unset;\n\t\t\t\t\t}\n\t\t\t\t\t&:focus-visible {\n\t\t\t\t\t\tborder-color: ", ";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t", "\n\t\t\t}\n\n\t\t\t", "\n\t\t}\n\t"])), RendererCssClassName.SORTABLE_COLUMN_WRAPPER, RendererCssClassName.SORTABLE_COLUMN, tableCellPadding, "var(--ds-border-focused, ".concat(colors.B300, ")"), headingsCss, css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n\t\t\t\t// New styles\n\t\t\t\t> .", "\n\t\t\t\t\t> .", " {\n\t\t\t\t\tmargin: 0;\n\n\t\t\t\t\t.", " {\n\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\ttransition: opacity 0.2s ease-in-out;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t> .", "\n\t\t\t\t\t> .", " {\n\t\t\t\t\t.", " {\n\t\t\t\t\t\topacity: 0;\n\t\t\t\t\t\t&:focus {\n\t\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t&:hover:not(\n\t\t\t\t\t\t:has(\n\t\t\t\t\t\t\t\t.", "\n\t\t\t\t\t\t\t\t\t.", ":hover\n\t\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t\t> .", "\n\t\t\t\t\t> .", " {\n\t\t\t\t\t.", " {\n\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"])), RendererCssClassName.SORTABLE_COLUMN, RendererCssClassName.SORTABLE_COLUMN_ICON_WRAPPER, SORTABLE_COLUMN_ICON_CLASSNAME, RendererCssClassName.SORTABLE_COLUMN, RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, SORTABLE_COLUMN_ICON_CLASSNAME, RendererCssClassName.SORTABLE_COLUMN_WRAPPER, RendererCssClassName.SORTABLE_COLUMN, RendererCssClassName.SORTABLE_COLUMN, RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, SORTABLE_COLUMN_ICON_CLASSNAME));
|
|
119
|
-
};
|
|
120
|
-
var fullPageStyles = function fullPageStyles(_ref3, _ref4) {
|
|
121
|
-
var appearance = _ref3.appearance;
|
|
122
|
-
var theme = _ref4.theme;
|
|
123
|
-
if (appearance !== 'full-page') {
|
|
124
|
-
return '';
|
|
125
|
-
}
|
|
126
|
-
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n\t\tmax-width: ", ";\n\t\tmargin: 0 auto;\n\t\tpadding: 0 ", "px;\n\t"])), theme && theme.layoutMaxWidth ? "".concat(theme.layoutMaxWidth, "px") : 'none', appearance === 'full-page' ? FullPagePadding : 0);
|
|
127
|
-
};
|
|
128
|
-
var fullWidthStyles = function fullWidthStyles(_ref5) {
|
|
129
|
-
var appearance = _ref5.appearance;
|
|
130
|
-
if (appearance !== 'full-width') {
|
|
131
|
-
return '';
|
|
132
|
-
}
|
|
133
|
-
return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n\t\tmax-width: ", "px;\n\t\tmargin: 0 auto;\n\n\t\t/* don't override if the breakout mark has width attribute defined */\n\t\t.fabric-editor-breakout-mark:not([data-has-width='true']),\n\t\t.ak-renderer-extension {\n\t\t\twidth: 100% !important;\n\t\t}\n\n\t\t", "\n\t"])), akEditorFullWidthLayoutWidth, isTableResizingEnabled(appearance) ? '' : "\n .pm-table-container {\n width: 100% !important;\n }\n ");
|
|
134
|
-
};
|
|
135
|
-
var breakoutWidthStyle = function breakoutWidthStyle() {
|
|
136
|
-
return css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n\t\t*:not([data-mark-type='fragment']) .", " {\n\t\t\t// Ignored via go/ees007\n\t\t\t// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format\n\t\t\t// TODO - improve inline style logic on table container so important styles aren't required here\n\t\t\twidth: 100% !important;\n\t\t\tleft: 0 !important;\n\t\t}\n\n\t\t[data-mark-type='fragment'] * .", " {\n\t\t\t// Ignored via go/ees007\n\t\t\t// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format\n\t\t\t// TODO - improve inline style logic on table container so important styles aren't required here\n\t\t\twidth: 100% !important;\n\t\t\tleft: 0 !important;\n\t\t}\n\t"])), TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_CONTAINER);
|
|
137
|
-
};
|
|
138
|
-
var getShadowOverrides = function getShadowOverrides() {
|
|
139
|
-
return css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n\t\t/** Shadow overrides */\n\t\t&.", "::after, &.", "::before {\n\t\t\twidth: ", "px;\n\t\t\tbackground: linear-gradient(\n\t\t\t\t\tto left,\n\t\t\t\t\ttransparent 0,\n\t\t\t\t\t", " 140%\n\t\t\t\t),\n\t\t\t\tlinear-gradient(\n\t\t\t\t\tto right,\n\t\t\t\t\t", " 0px,\n\t\t\t\t\ttransparent 1px\n\t\t\t\t);\n\t\t}\n\n\t\t&.", "::after {\n\t\t\tbackground: linear-gradient(\n\t\t\t\t\tto right,\n\t\t\t\t\ttransparent 0,\n\t\t\t\t\t", " 140%\n\t\t\t\t),\n\t\t\t\tlinear-gradient(\n\t\t\t\t\tto left,\n\t\t\t\t\t", " 0px,\n\t\t\t\t\ttransparent 1px\n\t\t\t\t);\n\t\t\tright: 0px;\n\t\t}\n\t"])), shadowClassNames.RIGHT_SHADOW, shadowClassNames.LEFT_SHADOW, tableShadowWidth, "var(--ds-shadow-overflow-spread, ".concat(N40A, ")"), "var(--ds-shadow-overflow-perimeter, transparent)", shadowClassNames.RIGHT_SHADOW, "var(--ds-shadow-overflow-spread, ".concat(N40A, ")"), "var(--ds-shadow-overflow-perimeter, transparent)");
|
|
140
|
-
};
|
|
141
|
-
function getAnnotationStyles(_ref6) {
|
|
142
|
-
var allowAnnotations = _ref6.allowAnnotations;
|
|
143
|
-
if (!fg('editor_inline_comments_on_inline_nodes')) {
|
|
144
|
-
return '';
|
|
145
|
-
}
|
|
146
|
-
if (fg('annotations_align_editor_and_renderer_styles')) {
|
|
147
|
-
return css({
|
|
148
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
149
|
-
'& [data-annotation-draft-mark][data-annotation-inline-node]': {
|
|
150
|
-
borderBottom: '2px solid transparent',
|
|
151
|
-
cursor: 'pointer',
|
|
152
|
-
padding: '1px 0 2px',
|
|
153
|
-
background: "var(--ds-background-accent-yellow-subtler, ".concat(Y75, ")"),
|
|
154
|
-
borderBottomColor: "var(--ds-border-accent-yellow, ".concat(Y300, ")"),
|
|
155
|
-
boxShadow: "var(--ds-shadow-overlay, ".concat("1px 2px 3px ".concat(N60A, ", -1px 2px 3px ").concat(N60A), ")")
|
|
156
|
-
},
|
|
157
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
158
|
-
'& [data-annotation-draft-mark][data-annotation-inline-node][data-inline-card]': {
|
|
159
|
-
padding: '5px 0 3px 0'
|
|
160
|
-
},
|
|
161
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
162
|
-
'& [data-annotation-draft-mark][data-annotation-inline-node].date-lozenger-container': {
|
|
163
|
-
paddingTop: "var(--ds-space-025, 2px)"
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
return css({
|
|
168
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
169
|
-
"& [data-mark-type='annotation'][data-mark-annotation-state='active'] [data-annotation-mark], & [data-annotation-draft-mark][data-annotation-inline-node]": {
|
|
170
|
-
background: "var(--ds-background-accent-yellow-subtler, ".concat(Y75, ")"),
|
|
171
|
-
borderBottom: "2px solid ".concat("var(--ds-border-accent-yellow, ".concat(Y300, ")")),
|
|
172
|
-
boxShadow: "var(--ds-shadow-overlay, ".concat("1px 2px 3px ".concat(N60A, ", -1px 2px 3px ").concat(N60A), ")"),
|
|
173
|
-
cursor: 'pointer',
|
|
174
|
-
padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-025, 2px)")
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
var tableRowHeight = 44;
|
|
179
|
-
var stickyScrollbarStyles = "\n\tposition: relative;\n\tflex-direction: column;\n\n\t> .".concat(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_CONTAINER, " {\n\t width: 100%;\n\t display: block;\n\t visibility: hidden;\n\t overflow-x: auto;\n\t position: sticky;\n\t bottom: ", "var(--ds-space-0, 0px)", ";\n\t z-index: 1;\n\t}\n\n\t> .").concat(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM, ",\n\t> .").concat(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP, " {\n\t position: absolute;\n\t width: 100%;\n\t height: 1px;\n\t margin-top: -1px;\n\t // need this to avoid sentinel being focused via keyboard\n\t // this still allows it to be detected by intersection observer\n\t visibility: hidden;\n\t }\n\t > .").concat(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP, " {\n\t top: ").concat(tableRowHeight * 3, "px;\n\t }\n\t > .").concat(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM, " {\n\t bottom: ", "var(--ds-space-250, 20px)", "; // MAX_BROWSER_SCROLLBAR_HEIGHT = 20;\n\t }\n ");
|
|
180
|
-
|
|
181
|
-
// Ignored via go/ees005
|
|
182
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
183
|
-
export var rendererStyles = function rendererStyles(wrapperProps) {
|
|
184
|
-
return function (theme) {
|
|
185
|
-
var _getGlobalTheme = getGlobalTheme(),
|
|
186
|
-
typography = _getGlobalTheme.typography;
|
|
187
|
-
// This is required to be compatible with styled-components prop structure.
|
|
188
|
-
var themeProps = {
|
|
189
|
-
theme: theme
|
|
190
|
-
};
|
|
191
|
-
var useBlockRenderForCodeBlock = wrapperProps.useBlockRenderForCodeBlock,
|
|
192
|
-
appearance = wrapperProps.appearance;
|
|
193
|
-
var isAdvancedLayoutsOn = editorExperiment('advanced_layouts', true);
|
|
194
|
-
|
|
195
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/design-system/no-css-tagged-template-expression
|
|
196
|
-
return css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n\t\tfont-size: ", "px;\n\t\tline-height: 1.5rem;\n\t\tcolor: ", ";\n\n\t\t.", "::after {\n\t\t\t// we add a clearfix after ak-renderer-document in order to\n\t\t\t// contain internal floats (such as media images that are \"wrap-left\")\n\t\t\t// to just the renderer (and not spill outside of it)\n\t\t\tcontent: '';\n\t\t\tvisibility: hidden;\n\t\t\tdisplay: block;\n\t\t\theight: 0;\n\t\t\tclear: both;\n\t\t}\n\n\t\t", "\n\t\t", "\n\n .", " {\n\t\t\t", "\n\t\t}\n\n\t\t& h1 {\n\t\t\t", "\n\t\t}\n\n\t\t& h2 {\n\t\t\t", "\n\t\t}\n\n\t\t& h3 {\n\t\t\t", "\n\t\t}\n\n\t\t& h4 {\n\t\t\t", "\n\t\t}\n\n\t\t& h5 {\n\t\t\t", "\n\t\t}\n\n\t\t& h6 {\n\t\t\t", "\n\t\t}\n\n\t\t& span.akActionMark {\n\t\t\tcolor: ", ";\n\t\t\ttext-decoration: none;\n\n\t\t\t&:hover {\n\t\t\t\tcolor: ", ";\n\t\t\t\ttext-decoration: underline;\n\t\t\t}\n\n\t\t\t&:active {\n\t\t\t\tcolor: ", ";\n\t\t\t}\n\t\t}\n\n\t\t& span.akActionMark {\n\t\t\tcursor: pointer;\n\t\t}\n\n\t\t& span[data-placeholder] {\n\t\t\tcolor: ", ";\n\t\t}\n\n\t\t", "\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", "\n\t\t", "\n\n\t\t& .UnknownBlock {\n\t\t\tfont-family: ", ";\n\t\t\tfont-size: ", ";\n\t\t\tfont-weight: ", ";\n\t\t\twhite-space: pre-wrap;\n\t\t\tword-wrap: break-word;\n\t\t}\n\n\t\t& span.date-node {\n\t\t\tbackground: ", ";\n\t\t\tborder-radius: ", ";\n\t\t\tcolor: ", ";\n\t\t\tpadding: ", " ", ";\n\t\t\tmargin: 0 1px;\n\t\t\ttransition: background 0.3s;\n\t\t}\n\n\t\t& span.date-node-highlighted {\n\t\t\tbackground: ", ";\n\t\t\tcolor: ", ";\n\t\t}\n\n\t\t& .renderer-image {\n\t\t\tmax-width: 100%;\n\t\t\tdisplay: block;\n\t\t\tmargin: ", " 0;\n\t\t}\n\n\t\t.", ".rich-media-wrapped + .", ":not(.rich-media-wrapped) {\n\t\t\tclear: both;\n\t\t}\n\n\t\t& .code-block,\n\t\t& blockquote,\n\t\t& hr,\n\t\t& > div > div:not(.rich-media-wrapped),\n\t\t.", ".rich-media-wrapped + .rich-media-wrapped + *:not(.rich-media-wrapped),\n\t\t.", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n\t\t.", ".image-align-start,\n\t\t\t.", ".image-center,\n\t\t\t.", ".image-align-end {\n\t\t\tclear: both;\n\t\t}\n\n\t\t& .rich-media-wrapped {\n\t\t\t& + h1,\n\t\t\t& + h2,\n\t\t\t& + h3,\n\t\t\t& + h4,\n\t\t\t& + h5,\n\t\t\t& + h6 {\n\t\t\t\tmargin-top: ", ";\n\t\t\t}\n\t\t}\n\n\t\t", "\n\t\t/* plugin styles */\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n\t\t\tmargin-left: 0;\n\t\t\tmargin-right: 0;\n\t\t}\n\n\t\t/* Breakout for tables and extensions */\n\t\t.", " > {\n\t\t\t", "\n\n\t\t\t* .", " {\n\t\t\t\toverflow-x: auto;\n\t\t\t}\n\n\t\t\t& .", ":first-child {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\t.", " {\n\t\t\t\tmargin-top: ", ";\n\t\t\t}\n\n\t\t\t.", " {\n\t\t\t\tmargin-left: 50%;\n\t\t\t\ttransform: translateX(-50%);\n\t\t\t}\n\n\t\t\t.", " {\n\t\t\t\toverflow-x: auto;\n\t\t\t}\n\n\t\t\t.", " .", " {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\t\t}\n\n\t\t", "\n\n\t\t.", " .", " {\n\t\t\tz-index: 0;\n\t\t\ttransition: all 0.1s linear;\n\t\t\tdisplay: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n\t\t\t/** Shadow overrides */\n\t\t\t&.", "::after, &.", "::before {\n\t\t\t\ttop: ", "px;\n\t\t\t\theight: calc(100% - ", "px);\n\t\t\t\tz-index: ", ";\n\t\t\t}\n\n\t\t\t", "\n\n\t\t\t", "\n\n\t\t\t&\n .", ",\n &\n .", " {\n\t\t\t\theight: calc(100% - ", "px);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * A hack for making all the <th /> heights equal in case some have shorter\n\t\t\t * content than others.\n\t\t\t *\n\t\t\t * This is done to make sort buttons fill entire <th />.\n\t\t\t*/\n\t\t\t", " {\n\t\t\t\theight: 1px; /* will be ignored */\n\t\t\t\t", ";\n\t\t\t\tmargin-left: 0;\n\t\t\t\tmargin-right: 0;\n\t\t\t}\n\n\t\t\t", " {\n\t\t\t\theight: 100%;\n\n\t\t\t\ttd,\n\t\t\t\tth {\n\t\t\t\t\tposition: relative;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttable[data-number-column='true'] {\n\t\t\t\t.", " {\n\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\tborder-right: 1px solid\n\t\t\t\t\t\t", ";\n\t\t\t\t\twidth: ", "px;\n\t\t\t\t\ttext-align: center;\n\t\t\t\t\tcolor: ", ";\n\t\t\t\t\tfont-size: ", ";\n\t\t\t\t}\n\n\t\t\t\t.fixed .", " {\n\t\t\t\t\tborder-right: 0px none;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttr[data-header-row].fixed {\n\t\t\tposition: fixed !important;\n\t\t\tdisplay: flex;\n\t\t\toverflow: hidden;\n\t\t\tz-index: ", ";\n\n\t\t\tborder-right: 1px solid ", ";\n\t\t\tborder-bottom: 1px solid ", ";\n\n\t\t\t/* this is to compensate for the table border */\n\t\t\ttransform: translateX(-1px);\n\t\t}\n\n\t\t.sticky > th {\n\t\t\tz-index: ", ";\n\t\t\tposition: sticky !important;\n\t\t\ttop: 0;\n\t\t}\n\n\t\t/* Make the number column header sticky */\n\t\t.sticky > td {\n\t\t\tposition: sticky !important;\n\t\t\ttop: 0;\n\t\t}\n\n\t\t/* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n\t\t.sticky th,\n\t\t.sticky td {\n\t\t\tbox-shadow:\n\t\t\t\t0px 1px ", ",\n\t\t\t\t0px -0.5px ", ",\n\t\t\t\tinset -1px 0px ", ",\n\t\t\t\t0px -1px ", ";\n\t\t}\n\n\t\t/* this will remove jumpiness caused in Chrome for sticky headers */\n\t\t.fixed + tr {\n\t\t\tmin-height: 0px;\n\t\t}\n\n\t\t/*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n\t\t& .code-block {\n\t\t\tmax-width: 100%;\n\t\t\t/* -ms- properties are necessary until MS supports the latest version of the grid spec */\n\t\t\t/* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n\t\t\tdisplay: block;\n\t\t\t/* stylelint-enable */\n\n\t\t\tposition: relative;\n\t\t\tborder-radius: ", ";\n\n\t\t\t/*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n\t\t\tword-wrap: normal;\n\t\t}\n\n\t\t& .MediaGroup,\n\t\t& .code-block {\n\t\t\tmargin-top: ", ";\n\n\t\t\t&:first-child {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\t\t}\n\n\t\t", "\n\n\t\t", "\n\n ", ";\n\t\t", ";\n\t\t& [data-layout-section] {\n\t\t\tmargin-top: ", ";\n\t\t\t& > div + div {\n\t\t\t\tmargin-left: ", ";\n\t\t\t}\n\n\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t& > div + div {\n\t\t\t\t\tmargin-left: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t& .MediaGroup,\n\t\t\t& .code-block {\n\t\t\t\tmargin-top: ", ";\n\n\t\t\t\t&:first-child {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t& li {\n\t\t\t> .code-block {\n\t\t\t\tmargin: ", " 0 0 0;\n\t\t\t}\n\t\t\t> .code-block:first-child {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\n\t\t\t> div:last-of-type.code-block {\n\t\t\t\tmargin-bottom: ", ";\n\t\t\t}\n\t\t}\n\n\t\t&:not([data-node-type='decisionList']) > li,\n // This prevents https://product-fabric.atlassian.net/browse/ED-20924\n &:not(.", ") > li {\n\t\t\t", "\n\t\t}\n\t"])), editorFontSize(themeProps), "var(--ds-text, ".concat(colors.N800, ")"), RendererCssClassName.DOCUMENT, fullPageStyles(wrapperProps, themeProps), fullWidthStyles(wrapperProps), RendererCssClassName.DOCUMENT, mediaInlineImageStyles, headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), "var(--ds-link, ".concat(colors.B400, ")"), "var(--ds-link, ".concat(colors.B300, ")"), "var(--ds-link-pressed, ".concat(colors.B500, ")"), "var(--ds-text-subtlest, ".concat(colors.N200, ")"), telepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles(typography), ruleSharedStyles(), paragraphSharedStyles(typography), listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, codeMarkSharedStyles(), shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles(), tasksAndDecisionsStyles, fg('platform-linking-visual-refresh-v1') ? getSmartCardSharedStyles() : smartCardSharedStyles, getAnnotationStyles(wrapperProps), "var(--ds-font-family-body, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)", relativeFontSizeToBase16(14), "var(--ds-font-weight-regular, 400)", "var(--ds-background-neutral, ".concat(colors.N30A, ")"), "var(--ds-border-radius-100, 3px)", "var(--ds-text, ".concat(colors.N800, ")"), "var(--ds-space-025, 2px)", "var(--ds-space-050, 4px)", "var(--ds-background-danger, ".concat(colors.R50, ")"), "var(--ds-text-danger, ".concat(colors.R500, ")"), "var(--ds-space-300, 24px)", richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, "var(--ds-space-100, 8px)", alignedHeadingAnchorStyle(wrapperProps), mediaSingleSharedStyle, RendererCssClassName.DOCUMENT, breakoutWidthStyle(), RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, RendererCssClassName.EXTENSION, RendererCssClassName.DOCUMENT, RendererCssClassName.EXTENSION, blockNodesVerticalMargin, RendererCssClassName.EXTENSION_CENTER_ALIGN, TableSharedCssClassName.TABLE_NODE_WRAPPER, shadowObserverClassNames.SHADOW_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, tableSharedStyle(), RendererCssClassName.DOCUMENT, TableSharedCssClassName.TABLE_CONTAINER, shadowClassNames.RIGHT_SHADOW, shadowClassNames.LEFT_SHADOW, tableMarginTop - 1, tableMarginTop, akEditorStickyHeaderZIndex, getShadowOverrides(), isStickyScrollbarEnabled(appearance) ? stickyScrollbarStyles : '', shadowObserverClassNames.SENTINEL_LEFT, shadowObserverClassNames.SENTINEL_RIGHT, tableMarginTop, fg('platform_editor_renderer_table_header_styles') ? ".".concat(TableSharedCssClassName.TABLE_NODE_WRAPPER, " > table, .").concat(TableSharedCssClassName.TABLE_STICKY_WRAPPER, " > table") : 'table', tableSortableColumnStyle(wrapperProps), fg('platform_editor_renderer_table_header_styles') ? ".".concat(TableSharedCssClassName.TABLE_NODE_WRAPPER, " > table > tbody > tr:first-of-type, .").concat(TableSharedCssClassName.TABLE_STICKY_WRAPPER, " > table > tbody > tr:first-of-type") : 'table tr:first-of-type', RendererCssClassName.NUMBER_COLUMN, fg('platform_editor_tables_numbered_column_correction') ? "var(--ds-background-accent-gray-subtlest, #F1F2F4)" : "var(--ds-background-neutral, ".concat(akEditorTableToolbar, ")"), "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), akEditorTableNumberColumnWidth, "var(--ds-text-subtlest, ".concat(colors.N200, ")"), relativeFontSizeToBase16(14), RendererCssClassName.NUMBER_COLUMN, akEditorStickyHeaderZIndex, "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), akEditorStickyHeaderZIndex, "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableToolbar, ")"), "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableToolbar, ")"), "var(--ds-border-radius-100, 3px)", blockNodesVerticalMargin, useGridRenderForCodeBlock(useBlockRenderForCodeBlock), getLightWeightCodeBlockStylesForRootRendererStyleSheet(), isAdvancedLayoutsOn ? columnLayoutResponsiveSharedStyle : columnLayoutSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveRendererStyles, "var(--ds-space-250, 20px)", isAdvancedLayoutsOn ? 0 : "var(--ds-space-400, 32px)", gridMediumMaxWidth, blockNodesVerticalMargin, blockNodesVerticalMargin, blockNodesVerticalMargin, SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, browser.safari ? codeBlockInListSafariFix : '');
|
|
197
|
-
};
|
|
198
|
-
};
|
|
199
|
-
var useGridRenderForCodeBlock = function useGridRenderForCodeBlock(codeBlockRenderAsBlock) {
|
|
200
|
-
if (codeBlockRenderAsBlock) {
|
|
201
|
-
return '';
|
|
202
|
-
}
|
|
203
|
-
return "& .code-block {\n /* -ms- properties are necessary until MS supports the latest version of the grid spec */\n /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: auto 1fr;\n /* stylelint-enable */\n\n grid-template-columns: minmax(0, 1fr);\n\n & > span {\n /* stylelint-disable value-no-vendor-prefix */\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n /* stylelint-enable */\n grid-column: 1;\n }\n }";
|
|
204
|
-
};
|
|
2
|
+
export var TELEPOINTER_ID = 'ai-streaming-telepointer';
|
|
@@ -12,26 +12,11 @@ import { AnnotationsDraftContext } from '../context';
|
|
|
12
12
|
import { splitText, calcTextSplitOffset, findTextString } from './text';
|
|
13
13
|
import { calcInsertDraftPositionOnText } from './position';
|
|
14
14
|
import { dataAttributes } from './dom';
|
|
15
|
-
import { AnnotationSharedCSSByState } from '@atlaskit/editor-common/styles';
|
|
16
15
|
import { segmentText } from '../../../react/utils/segment-text';
|
|
17
16
|
import { renderTextSegments } from '../../../react/utils/render-text-segments';
|
|
18
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
19
|
-
|
|
20
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
21
|
-
var markStyles = function markStyles() {
|
|
22
|
-
return css({
|
|
23
|
-
color: 'inherit',
|
|
24
|
-
backgroundColor: 'unset',
|
|
25
|
-
WebkitTapHighlightColor: 'transparent'
|
|
26
|
-
},
|
|
27
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
28
|
-
AnnotationSharedCSSByState().common,
|
|
29
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
30
|
-
AnnotationSharedCSSByState().focus);
|
|
31
|
-
};
|
|
32
17
|
|
|
33
18
|
// Localized AnnotationSharedCSSByState().common and AnnotationSharedCSSByState().focus
|
|
34
|
-
var
|
|
19
|
+
var markStyles = css({
|
|
35
20
|
color: 'inherit',
|
|
36
21
|
backgroundColor: 'unset',
|
|
37
22
|
WebkitTapHighlightColor: 'transparent',
|
|
@@ -58,7 +43,7 @@ export var AnnotationDraft = function AnnotationDraft(_ref) {
|
|
|
58
43
|
// Ignored via go/ees005
|
|
59
44
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
60
45
|
}, dataAttributes(draftPosition), {
|
|
61
|
-
css:
|
|
46
|
+
css: markStyles
|
|
62
47
|
}), children);
|
|
63
48
|
};
|
|
64
49
|
export var getAnnotationIndex = function getAnnotationIndex(annotationPosition, fragmentCount) {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
4
|
-
var _templateObject;
|
|
5
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
5
|
/**
|
|
@@ -12,16 +10,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
12
10
|
import { useMemo, useCallback } from 'react';
|
|
13
11
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
14
12
|
import { css, jsx } from '@emotion/react';
|
|
15
|
-
import { AnnotationSharedCSSByState } from '@atlaskit/editor-common/styles';
|
|
16
13
|
import { AnnotationMarkStates } from '@atlaskit/adf-schema';
|
|
17
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
18
15
|
import { useIntl } from 'react-intl-next';
|
|
19
16
|
import { inlineCommentMessages } from '../../../messages';
|
|
20
|
-
|
|
21
|
-
var markStylesOld = function markStylesOld() {
|
|
22
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tcolor: inherit;\n\tbackground-color: unset;\n\t-webkit-tap-highlight-color: transparent;\n\n\t&[data-mark-annotation-state='", "'] {\n\t\t", "\n\t\t", "\n\n\t\t&:focus,\n\t\t\t&[data-has-focus='true'] {\n\t\t\t", "\n\t\t}\n\t\t&[data-is-hovered='true']:not([data-has-focus='true']) {\n\t\t\t", "\n\t\t}\n\t}\n"])), AnnotationMarkStates.ACTIVE, fg('editor_inline_comments_on_inline_nodes') ? AnnotationSharedCSSByState().common : '', AnnotationSharedCSSByState().blur, AnnotationSharedCSSByState().focus, fg('confluence-frontend-comments-panel') ? AnnotationSharedCSSByState().hover : '');
|
|
23
|
-
};
|
|
24
|
-
var markStylesNew = css(_defineProperty({
|
|
17
|
+
var markStyles = css(_defineProperty({
|
|
25
18
|
color: 'inherit',
|
|
26
19
|
backgroundColor: 'unset',
|
|
27
20
|
WebkitTapHighlightColor: 'transparent'
|
|
@@ -59,7 +52,7 @@ var markStylesWithUpdatedShadow = css(_defineProperty({}, "&[data-mark-annotatio
|
|
|
59
52
|
boxShadow: "var(--ds-shadow-raised, 0px 1px 1px #091E4240, 0px 0px 1px #091E424f)"
|
|
60
53
|
}
|
|
61
54
|
}));
|
|
62
|
-
var
|
|
55
|
+
var markStylesWithInlineComments = css(_defineProperty({}, "&[data-mark-annotation-state='".concat(AnnotationMarkStates.ACTIVE, "']"), {
|
|
63
56
|
// was from common in AnnotationSharedCSSByState().common
|
|
64
57
|
borderBottom: '2px solid transparent',
|
|
65
58
|
cursor: 'pointer',
|
|
@@ -83,7 +76,7 @@ var markStylesNewWithInlineComments = css(_defineProperty({}, "&[data-mark-annot
|
|
|
83
76
|
boxShadow: "var(--ds-shadow-overlay, 0px 8px 12px #091E4226, 0px 0px 1px #091E424f)"
|
|
84
77
|
}
|
|
85
78
|
}));
|
|
86
|
-
var
|
|
79
|
+
var markStylesWithCommentsPanel = css(_defineProperty({}, "&[data-mark-annotation-state='".concat(AnnotationMarkStates.ACTIVE, "']"), {
|
|
87
80
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
88
81
|
'&[data-is-hovered="true"]:not([data-has-focus="true"])': {
|
|
89
82
|
background: "var(--ds-background-accent-yellow-subtlest-hovered, #F8E6A0)",
|
|
@@ -96,28 +89,7 @@ var isMobile = function isMobile() {
|
|
|
96
89
|
// eslint-disable-next-line require-unicode-regexp
|
|
97
90
|
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
98
91
|
};
|
|
99
|
-
var
|
|
100
|
-
return css({
|
|
101
|
-
'&::before, &::after': {
|
|
102
|
-
clipPath: 'inset(100%)',
|
|
103
|
-
clip: 'rect(1px, 1px, 1px, 1px)',
|
|
104
|
-
height: '1px',
|
|
105
|
-
overflow: 'hidden',
|
|
106
|
-
position: 'absolute',
|
|
107
|
-
whiteSpace: 'nowrap',
|
|
108
|
-
width: '1px'
|
|
109
|
-
},
|
|
110
|
-
'&::before': {
|
|
111
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
112
|
-
content: "' [".concat(startMarker, "] '")
|
|
113
|
-
},
|
|
114
|
-
'&::after': {
|
|
115
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
116
|
-
content: "' [".concat(endMarker, "] '")
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
};
|
|
120
|
-
var accessibilityStylesNew = css({
|
|
92
|
+
var accessibilityStyles = css({
|
|
121
93
|
'&::before, &::after': {
|
|
122
94
|
clipPath: 'inset(100%)',
|
|
123
95
|
clip: 'rect(1px, 1px, 1px, 1px)',
|
|
@@ -207,32 +179,13 @@ export var MarkComponent = function MarkComponent(_ref) {
|
|
|
207
179
|
} : _objectSpread({
|
|
208
180
|
'aria-details': annotationIds.join(', ')
|
|
209
181
|
}, desktopAccessibilityAttributes);
|
|
210
|
-
var getAccessibilityStylesOld = function getAccessibilityStylesOld() {
|
|
211
|
-
if (isMobile()) {
|
|
212
|
-
return {};
|
|
213
|
-
}
|
|
214
|
-
if (state !== AnnotationMarkStates.RESOLVED) {
|
|
215
|
-
var startMarker = intl.formatMessage(inlineCommentMessages.contentRendererInlineCommentMarkerStart);
|
|
216
|
-
var endMarker = intl.formatMessage(inlineCommentMessages.contentRendererInlineCommentMarkerEnd);
|
|
217
|
-
return accessibilityStylesOld(startMarker, endMarker);
|
|
218
|
-
} else {
|
|
219
|
-
return {};
|
|
220
|
-
}
|
|
221
|
-
};
|
|
222
|
-
if (fg('platform_editor_emotion_refactor_renderer')) {
|
|
223
|
-
return jsx(useBlockLevel ? 'div' : 'mark', _objectSpread(_objectSpread(_objectSpread(_defineProperty({
|
|
224
|
-
id: id
|
|
225
|
-
}, fg('editor_inline_comments_on_inline_nodes') ? 'onClickCapture' : 'onClick', onMarkClick), accessibility), overriddenData), !useBlockLevel && {
|
|
226
|
-
css: [markStylesNew, fg('platform_renderer_nested_annotation_styling') && markStylesLayeringFix, fg('editor_inline_comments_on_inline_nodes') && markStylesNewWithInlineComments, fg('confluence-frontend-comments-panel') && markStylesNewWithCommentsPanel, !isMobile() && accessibilityStylesNew, markStylesWithUpdatedShadow],
|
|
227
|
-
style: {
|
|
228
|
-
'--ak-renderer-annotation-startmarker': intl.formatMessage(inlineCommentMessages.contentRendererInlineCommentMarkerStart),
|
|
229
|
-
'--ak-renderer-annotation-endmarker': intl.formatMessage(inlineCommentMessages.contentRendererInlineCommentMarkerEnd)
|
|
230
|
-
}
|
|
231
|
-
}), children);
|
|
232
|
-
}
|
|
233
182
|
return jsx(useBlockLevel ? 'div' : 'mark', _objectSpread(_objectSpread(_objectSpread(_defineProperty({
|
|
234
183
|
id: id
|
|
235
184
|
}, fg('editor_inline_comments_on_inline_nodes') ? 'onClickCapture' : 'onClick', onMarkClick), accessibility), overriddenData), !useBlockLevel && {
|
|
236
|
-
css: [
|
|
185
|
+
css: [markStyles, fg('platform_renderer_nested_annotation_styling') && markStylesLayeringFix, fg('editor_inline_comments_on_inline_nodes') && markStylesWithInlineComments, fg('confluence-frontend-comments-panel') && markStylesWithCommentsPanel, !isMobile() && accessibilityStyles, markStylesWithUpdatedShadow],
|
|
186
|
+
style: {
|
|
187
|
+
'--ak-renderer-annotation-startmarker': intl.formatMessage(inlineCommentMessages.contentRendererInlineCommentMarkerStart),
|
|
188
|
+
'--ak-renderer-annotation-endmarker': intl.formatMessage(inlineCommentMessages.contentRendererInlineCommentMarkerEnd)
|
|
189
|
+
}
|
|
237
190
|
}), children);
|
|
238
191
|
};
|