@atlaskit/renderer 113.2.0 → 113.2.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.
@@ -0,0 +1,1742 @@
1
+ /* eslint-disable @atlaskit/ui-styling-standard/no-important-styles */
2
+ /* eslint-disable @atlaskit/ui-styling-standard/no-imported-style-values */
3
+ /* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values */
4
+ /**
5
+ * @jsxRuntime classic
6
+ * @jsx jsx
7
+ */
8
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
9
+ import { css, jsx } from '@emotion/react';
10
+ import { B300, B400, B500, N20, N200, N30A, N40A, N60A, N800, R50, R500, Y300, Y75 } from '@atlaskit/theme/colors';
11
+ import { getGlobalTheme } from '@atlaskit/tokens';
12
+ import { FullPagePadding, rendererStyles } from './style';
13
+ import { fg } from '@atlaskit/platform-feature-flags';
14
+ import { RendererCssClassName } from '../../consts';
15
+ import { akEditorBlockquoteBorderColor, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorLineHeight, akEditorSelectedNodeClassName, akEditorShadowZIndex, akEditorStickyHeaderZIndex, akEditorTableBorder, akEditorTableCellMinWidth, akEditorTableNumberColumnWidth, akEditorTableToolbar, blockNodesVerticalMargin, gridMediumMaxWidth } from '@atlaskit/editor-shared-styles';
16
+ import { INLINE_IMAGE_WRAPPER_CLASS_NAME } from '@atlaskit/editor-common/media-inline';
17
+ import { HeadingAnchorWrapperClassName } from '../../react/nodes/heading-anchor';
18
+ import { CodeBlockSharedCssClassName, DateSharedCssClassName, listItemCounterPadding, richMediaClassName, SmartCardSharedCssClassName, tableCellBorderWidth, tableCellMinWidth, tableCellPadding, tableMarginTop, TableSharedCssClassName, TaskDecisionSharedCssClassName } from '@atlaskit/editor-common/styles';
19
+ import { bulletListSelector, orderedListSelector } from '@atlaskit/adf-schema';
20
+ import { shadowClassNames, shadowObserverClassNames } from '@atlaskit/editor-common/ui';
21
+ import { browser } from '@atlaskit/editor-common/browser';
22
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
23
+ import { isStickyScrollbarEnabled, isTableResizingEnabled } from '../../react/nodes/table';
24
+ import { SORTABLE_COLUMN_ICON_CLASSNAME } from '@atlaskit/editor-common/table';
25
+ import { LightWeightCodeBlockCssClassName } from '../../react/nodes/codeBlock/components/lightWeightCodeBlock';
26
+ import { editorUGCToken } from '@atlaskit/editor-common/ugc-tokens';
27
+ import { getBaseFontSize } from './get-base-font-size';
28
+ const wrappedMediaBreakoutPoint = 410;
29
+ const TELEPOINTER_ID = 'ai-streaming-telepointer';
30
+ const tableShadowWidth = 32;
31
+ const LAYOUT_BREAKPOINT_RENDERER = 629;
32
+ // originally defined from packages/editor/editor-plugin-table/src/ui/common-styles.ts
33
+ // TODO: tableRowHeight can be moved into `@atlaskit/editor-common/table`
34
+ const tableRowHeight = 44;
35
+ const {
36
+ typography
37
+ } = getGlobalTheme();
38
+ const isBackgroundClipBrowserFixNeeded = () => browser.isGecko || browser.isIE || browser.isMac && browser.isChrome;
39
+
40
+ // styles are copied from ./style.tsx
41
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage
42
+ const baseStyles = css({
43
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
44
+ fontSize: 'var(--ak-renderer-base-font-size)',
45
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
46
+ lineHeight: '1.5rem',
47
+ color: `var(--ds-text, ${N800})`,
48
+ [`.${RendererCssClassName.DOCUMENT}::after`]: {
49
+ // we add a clearfix after ak-renderer-document in order to
50
+ // contain internal floats (such as media images that are "wrap-left")
51
+ // to just the renderer (and not spill outside of it)
52
+ content: '""',
53
+ visibility: 'hidden',
54
+ display: 'block',
55
+ height: 0,
56
+ clear: 'both'
57
+ },
58
+ [`.${RendererCssClassName.DOCUMENT}`]: {
59
+ // p, h3, and action items
60
+ [`.${INLINE_IMAGE_WRAPPER_CLASS_NAME}`]: {
61
+ height: '22px',
62
+ transform: `translateY(-2px)`
63
+ },
64
+ h1: {
65
+ [`> .mediaInlineView-content-wrap > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
66
+ > :is(a, span[data-mark-type='border']) .mediaInlineView-content-wrap > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
67
+ > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
68
+ > :is(a, span[data-mark-type='border']) .${INLINE_IMAGE_WRAPPER_CLASS_NAME}`]: {
69
+ height: '36px',
70
+ transform: `translateY(-3px)`
71
+ }
72
+ },
73
+ h2: {
74
+ [`> .mediaInlineView-content-wrap > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
75
+ > :is(a, span[data-mark-type='border']) .mediaInlineView-content-wrap > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
76
+ > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
77
+ > :is(a, span[data-mark-type='border']) .${INLINE_IMAGE_WRAPPER_CLASS_NAME}`]: {
78
+ height: '31px',
79
+ transform: `translateY(-3px)`
80
+ }
81
+ },
82
+ h3: {
83
+ [`> .mediaInlineView-content-wrap > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
84
+ > :is(a, span[data-mark-type='border']) .mediaInlineView-content-wrap > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
85
+ > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
86
+ > :is(a, span[data-mark-type='border']) .${INLINE_IMAGE_WRAPPER_CLASS_NAME}`]: {
87
+ height: '25px',
88
+ transform: `translateY(-2px)`
89
+ }
90
+ },
91
+ h4: {
92
+ [`> .mediaInlineView-content-wrap > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
93
+ > :is(a, span[data-mark-type='border']) .mediaInlineView-content-wrap > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
94
+ > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
95
+ > :is(a, span[data-mark-type='border']) .${INLINE_IMAGE_WRAPPER_CLASS_NAME}`]: {
96
+ height: '23px',
97
+ transform: `translateY(-2px)`
98
+ }
99
+ },
100
+ h5: {
101
+ [`> .mediaInlineView-content-wrap > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
102
+ > :is(a, span[data-mark-type='border']) .mediaInlineView-content-wrap > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
103
+ > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
104
+ > :is(a, span[data-mark-type='border']) .${INLINE_IMAGE_WRAPPER_CLASS_NAME}`]: {
105
+ height: '20px',
106
+ transform: `translateY(-2px)`
107
+ }
108
+ },
109
+ h6: {
110
+ [`> .mediaInlineView-content-wrap > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
111
+ > :is(a, span[data-mark-type='border']) .mediaInlineView-content-wrap > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
112
+ > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
113
+ > :is(a, span[data-mark-type='border']) .${INLINE_IMAGE_WRAPPER_CLASS_NAME}`]: {
114
+ height: '18px',
115
+ transform: `translateY(-2px)`
116
+ }
117
+ }
118
+ },
119
+ '& h1, & h2, & h3, & h4, & h5, & h6': {
120
+ [`.${HeadingAnchorWrapperClassName}`]: {
121
+ position: 'absolute',
122
+ marginLeft: "var(--ds-space-075, 6px)",
123
+ button: {
124
+ paddingLeft: 0,
125
+ paddingRight: 0
126
+ },
127
+ /**
128
+ * Adds the visibility of the button when in focus through keyboard navigation.
129
+ */
130
+ 'button:focus': {
131
+ opacity: 1,
132
+ transform: 'none !important'
133
+ }
134
+ },
135
+ [`@media (hover: hover) and (pointer: fine)`]: {
136
+ [`.${HeadingAnchorWrapperClassName}`]: {
137
+ '> button': {
138
+ opacity: 0,
139
+ transform: `translate(-8px, 0px)`,
140
+ transition: `opacity 0.2s ease 0s, transform 0.2s ease 0s`
141
+ }
142
+ },
143
+ '&:hover': {
144
+ [`.${HeadingAnchorWrapperClassName} > button`]: {
145
+ opacity: 1,
146
+ transform: 'none !important'
147
+ }
148
+ }
149
+ }
150
+ },
151
+ '& h1': {
152
+ [`.${HeadingAnchorWrapperClassName}`]: {
153
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
154
+ lineHeight: `${28 / 24}em`
155
+ }
156
+ },
157
+ '& h2': {
158
+ [`.${HeadingAnchorWrapperClassName}`]: {
159
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
160
+ lineHeight: `${24 / 20}em`
161
+ }
162
+ },
163
+ '& h3': {
164
+ [`.${HeadingAnchorWrapperClassName}`]: {
165
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
166
+ lineHeight: `${20 / 16}em`
167
+ }
168
+ },
169
+ '& h4': {
170
+ [`.${HeadingAnchorWrapperClassName}`]: {
171
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
172
+ lineHeight: `${16 / 14}em`
173
+ }
174
+ },
175
+ '& h5': {
176
+ [`.${HeadingAnchorWrapperClassName}`]: {
177
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
178
+ lineHeight: `${16 / 12}em`
179
+ }
180
+ },
181
+ '& h6': {
182
+ [`.${HeadingAnchorWrapperClassName}`]: {
183
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
184
+ lineHeight: `${16 / 11}em`
185
+ }
186
+ },
187
+ [`& span.akActionMark`]: {
188
+ color: `var(--ds-link, ${B400})`,
189
+ textDecoration: 'none',
190
+ cursor: 'pointer',
191
+ '&:hover': {
192
+ color: `var(--ds-link, ${B300})`,
193
+ textDecoration: 'underline'
194
+ },
195
+ '&:active': {
196
+ color: `var(--ds-link-pressed, ${B500})`
197
+ }
198
+ },
199
+ '& span[data-placeholder]': {
200
+ color: `var(--ds-text-subtlest, ${N200})`
201
+ }
202
+ });
203
+ const rendererFullPageStyles = css({
204
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
205
+ maxWidth: `${akEditorDefaultLayoutWidth}px`,
206
+ margin: '0 auto',
207
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
208
+ padding: `0 ${FullPagePadding}px`
209
+ });
210
+ const rendererFullWidthStyles = css({
211
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
212
+ maxWidth: `${akEditorFullWidthLayoutWidth}px`,
213
+ margin: `0 auto`,
214
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
215
+ '.fabric-editor-breakout-mark:not([data-has-width="true"]), .ak-renderer-extension': {
216
+ width: '100% !important'
217
+ }
218
+ });
219
+ const rendererFullWidthStylesForTableResizing = css({
220
+ '.pm-table-container': {
221
+ width: '100% !important'
222
+ }
223
+ });
224
+
225
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
226
+ const telepointerStyles = css({
227
+ [`#${TELEPOINTER_ID}`]: {
228
+ display: 'inline-block',
229
+ position: 'relative',
230
+ width: '1.5px',
231
+ height: '25px',
232
+ backgroundColor: "var(--ds-background-brand-bold, #0C66E4)",
233
+ marginLeft: "var(--ds-space-025, 2px)",
234
+ '&::after': {
235
+ content: '"AI"',
236
+ position: 'absolute',
237
+ display: 'block',
238
+ top: 0,
239
+ left: 0,
240
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
241
+ fontSize: '10px',
242
+ fontWeight: "var(--ds-font-weight-bold, 700)",
243
+ width: '12.5px',
244
+ height: '13px',
245
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
246
+ paddingTop: '1px',
247
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
248
+ paddingLeft: '1.5px',
249
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
250
+ lineHeight: 'initial',
251
+ borderRadius: '0px 2px 2px 0px',
252
+ color: "var(--ds-text-inverse, white)",
253
+ backgroundColor: "var(--ds-background-brand-bold, #0C66E4)"
254
+ }
255
+ }
256
+ });
257
+ const whitespaceSharedStyles = css({
258
+ wordWrap: 'break-word',
259
+ whiteSpace: 'pre-wrap'
260
+ });
261
+ const blockquoteSharedStyles = css({
262
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
263
+ '& blockquote': {
264
+ boxSizing: 'border-box',
265
+ color: 'inherit',
266
+ width: '100%',
267
+ display: 'inline-block',
268
+ paddingLeft: "var(--ds-space-200, 16px)",
269
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
270
+ borderLeft: `2px solid ${`var(--ds-border, ${akEditorBlockquoteBorderColor})`}`,
271
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
272
+ margin: `${blockNodesVerticalMargin} 0 0 0`,
273
+ marginRight: 0,
274
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
275
+ "[dir='rtl'] &": {
276
+ paddingLeft: 0,
277
+ paddingRight: "var(--ds-space-200, 16px)"
278
+ },
279
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
280
+ '&:first-child': {
281
+ marginTop: 0
282
+ },
283
+ '&::before': {
284
+ content: "''"
285
+ },
286
+ '&::after': {
287
+ content: 'none'
288
+ },
289
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
290
+ '& p': {
291
+ display: 'block'
292
+ },
293
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
294
+ '& table, & table:last-child': {
295
+ display: 'inline-table'
296
+ },
297
+ // Workaround for overriding the inline-block display on last child of a blockquote set in CSS reset.
298
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
299
+ '> .code-block:last-child, >.mediaSingleView-content-wrap:last-child, >.mediaGroupView-content-wrap:last-child': {
300
+ display: 'block'
301
+ },
302
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
303
+ '> .extensionView-content-wrap:last-child': {
304
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
305
+ display: `${editorExperiment('platform_editor_nested_non_bodied_macros', 'test')}` ? 'block' : 'inline-block'
306
+ }
307
+ }
308
+ });
309
+ const headingsSharedStyles = css({
310
+ '& h1': {
311
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
312
+ fontSize: `${24 / 14}em`,
313
+ fontStyle: 'inherit',
314
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
315
+ lineHeight: 28 / 24,
316
+ color: "var(--ds-text, #172B4D)",
317
+ fontWeight: "var(--ds-font-weight-medium, 500)",
318
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
319
+ letterSpacing: `-0.01em`,
320
+ marginBottom: 0,
321
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
322
+ marginTop: '1.667em'
323
+ },
324
+ '& h2': {
325
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
326
+ fontSize: `${20 / 14}em`,
327
+ fontStyle: 'inherit',
328
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
329
+ lineHeight: 24 / 20,
330
+ color: "var(--ds-text, #172B4D)",
331
+ fontWeight: "var(--ds-font-weight-medium, 500)",
332
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
333
+ letterSpacing: `-0.008em`,
334
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
335
+ marginTop: '1.8em',
336
+ marginBottom: 0
337
+ },
338
+ '& h3': {
339
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
340
+ fontSize: `${16 / 14}em`,
341
+ fontStyle: 'inherit',
342
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
343
+ lineHeight: 20 / 16,
344
+ color: "var(--ds-text, #172B4D)",
345
+ fontWeight: "var(--ds-font-weight-semibold, 600)",
346
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
347
+ letterSpacing: `-0.006em`,
348
+ marginTop: "var(--ds-space-400, 2em)",
349
+ marginBottom: 0
350
+ },
351
+ '& h4': {
352
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
353
+ fontSize: `${14 / 14}em`,
354
+ fontStyle: 'inherit',
355
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
356
+ lineHeight: 16 / 14,
357
+ color: "var(--ds-text, #172B4D)",
358
+ fontWeight: "var(--ds-font-weight-semibold, 600)",
359
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
360
+ letterSpacing: `-0.003em`,
361
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
362
+ marginTop: '1.357em'
363
+ },
364
+ '& h5': {
365
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
366
+ fontSize: `${12 / 14}em`,
367
+ fontStyle: 'inherit',
368
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
369
+ lineHeight: 16 / 12,
370
+ color: "var(--ds-text, #172B4D)",
371
+ fontWeight: "var(--ds-font-weight-semibold, 600)",
372
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
373
+ marginTop: '1.667em',
374
+ textTransform: 'none'
375
+ },
376
+ '& h6': {
377
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
378
+ fontSize: `${11 / 14}em`,
379
+ fontStyle: 'inherit',
380
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
381
+ lineHeight: 16 / 11,
382
+ color: "var(--ds-text-subtlest, #626F86)",
383
+ fontWeight: "var(--ds-font-weight-bold, 700)",
384
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
385
+ marginTop: '1.455em',
386
+ textTransform: 'none'
387
+ }
388
+ });
389
+
390
+ // TODO: emotion refactor - check if we need UGC token?
391
+ const headingsSharedStylesWithEditorUGC = css({
392
+ '& h1': {
393
+ font: editorUGCToken('editor.font.heading.h1', typography),
394
+ marginBottom: 0,
395
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
396
+ marginTop: '1.45833em',
397
+ '& strong': {
398
+ fontWeight: editorUGCToken('editor.font.weight.heading.h1.bold', typography)
399
+ },
400
+ '&::before': {}
401
+ },
402
+ '& h2': {
403
+ font: editorUGCToken('editor.font.heading.h2', typography),
404
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
405
+ marginTop: '1.4em',
406
+ marginBottom: 0,
407
+ '& strong': {
408
+ fontWeight: editorUGCToken('editor.font.weight.heading.h1.bold', typography)
409
+ }
410
+ },
411
+ '& h3': {
412
+ font: editorUGCToken('editor.font.heading.h3', typography),
413
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
414
+ marginTop: '1.31249em',
415
+ marginBottom: 0,
416
+ '& strong': {
417
+ fontWeight: editorUGCToken('editor.font.weight.heading.h1.bold', typography)
418
+ }
419
+ },
420
+ '& h4': {
421
+ font: editorUGCToken('editor.font.heading.h4', typography),
422
+ marginTop: "var(--ds-space-250, 1.25em)",
423
+ '& strong': {
424
+ fontWeight: editorUGCToken('editor.font.weight.heading.h1.bold', typography)
425
+ }
426
+ },
427
+ '& h5': {
428
+ font: editorUGCToken('editor.font.heading.h5', typography),
429
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
430
+ marginTop: '1.45833em',
431
+ textTransform: 'none',
432
+ '& strong': {
433
+ fontWeight: editorUGCToken('editor.font.weight.heading.h1.bold', typography)
434
+ }
435
+ },
436
+ '& h6': {
437
+ font: editorUGCToken('editor.font.heading.h6', typography),
438
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
439
+ marginTop: '1.59091em',
440
+ textTransform: 'none',
441
+ '& strong': {
442
+ fontWeight: editorUGCToken('editor.font.weight.heading.h1.bold', typography)
443
+ }
444
+ }
445
+ });
446
+ const headingWithAlignmentStyles = css({
447
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
448
+ '.fabric-editor-block-mark.fabric-editor-alignment:not(:first-child)': {
449
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
450
+ '> h1:first-child': {
451
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
452
+ marginTop: '1.667em'
453
+ },
454
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
455
+ ' > h2:first-child': {
456
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
457
+ marginTop: '1.8em'
458
+ },
459
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
460
+ '> h3:first-child': {
461
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
462
+ marginTop: '2em'
463
+ },
464
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
465
+ '> h4:first-child': {
466
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
467
+ marginTop: '1.357em'
468
+ },
469
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
470
+ '> h5:first-child': {
471
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
472
+ marginTop: '1.667em'
473
+ },
474
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
475
+ '> h6:first-child': {
476
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
477
+ marginTop: '1.455em'
478
+ }
479
+ },
480
+ // Set marginTop: 0 if alignment block is next to a gap cursor or widget that is first child
481
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
482
+ '.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': {
483
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
484
+ '> :is(h1, h2, h3, h4, h5, h6):first-child': {
485
+ marginTop: '0'
486
+ }
487
+ }
488
+ });
489
+ const ruleSharedStyles = css({
490
+ '& hr': {
491
+ border: 'none',
492
+ backgroundColor: "var(--ds-border, #091E4224)",
493
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
494
+ margin: `${akEditorLineHeight}em 0`,
495
+ height: '2px',
496
+ borderRadius: '1px'
497
+ }
498
+ });
499
+ const paragraphSharedStylesWithEditorUGC = css({
500
+ '& p': {
501
+ font: editorUGCToken('editor.font.body', typography),
502
+ marginTop: blockNodesVerticalMargin,
503
+ marginBottom: 0
504
+ }
505
+ });
506
+ const paragraphSharedStyles = css({
507
+ '& p': {
508
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
509
+ fontSize: '1em',
510
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
511
+ lineHeight: akEditorLineHeight,
512
+ fontWeight: "var(--ds-font-weight-regular, 400)",
513
+ marginTop: blockNodesVerticalMargin,
514
+ marginBottom: 0,
515
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
516
+ letterSpacing: '-0.005em'
517
+ }
518
+ });
519
+ const listsSharedStyles = css({
520
+ /* =============== INDENTATION SPACING ========= */
521
+ 'ul, ol': {
522
+ boxSizing: 'border-box',
523
+ paddingLeft: `var(--ed--list--item-counter--padding, ${listItemCounterPadding}px)`
524
+ },
525
+ [`${orderedListSelector}, ${bulletListSelector}`]: {
526
+ /*
527
+ Ensures list item content adheres to the list's margin instead
528
+ of filling the entire block row. This is important to allow
529
+ clicking interactive elements which are floated next to a list.
530
+ For some history and context on this block, see PRs related to tickets.:
531
+ @see ED-6551 - original issue.
532
+ @see ED-7015 - follow up issue.
533
+ @see ED-7447 - flow-root change.
534
+ used to have display: 'table' in tag template style but not supported in object styles
535
+ removed display: 'table' as 'flow-root' is supported in latest browsers
536
+ @see https://css-tricks.com/display-flow-root/
537
+ */
538
+ display: 'flow-root'
539
+ },
540
+ /* =============== INDENTATION AESTHETICS ========= */
541
+ /**
542
+ We support nested lists up to six levels deep.
543
+ **/
544
+ /* LEGACY LISTS */
545
+ 'ul, ul ul ul ul': {
546
+ listStyleType: 'disc'
547
+ },
548
+ 'ul ul, ul ul ul ul ul': {
549
+ listStyleType: 'circle'
550
+ },
551
+ 'ul ul ul, ul ul ul ul ul ul': {
552
+ listStyleType: 'square'
553
+ },
554
+ 'ol, ol ol ol ol': {
555
+ listStyleType: 'decimal'
556
+ },
557
+ 'ol ol, ol ol ol ol ol': {
558
+ listStyleType: 'lower-alpha'
559
+ },
560
+ 'ol ol ol, ol ol ol ol ol ol': {
561
+ listStyleType: 'lower-roman'
562
+ },
563
+ /* PREDICTABLE LISTS */
564
+ 'ol[data-indent-level="1"], ol[data-indent-level="4"]': {
565
+ listStyleType: 'decimal'
566
+ },
567
+ 'ol[data-indent-level="2"], ol[data-indent-level="5"]': {
568
+ listStyleType: 'lower-alpha'
569
+ },
570
+ 'ol[data-indent-level="3"], ol[data-indent-level="6"]': {
571
+ listStyleType: 'lower-roman'
572
+ },
573
+ 'ul[data-indent-level="1"], ul[data-indent-level="4"]': {
574
+ listStyleType: 'disc'
575
+ },
576
+ 'ul[data-indent-level="2"], ul[data-indent-level="5"]': {
577
+ listStyleType: 'circle'
578
+ },
579
+ 'ul[data-indent-level="3"], ul[data-indent-level="6"]': {
580
+ listStyleType: 'square'
581
+ }
582
+ });
583
+
584
+ /*
585
+ Firefox does not handle empty block element inside li tag.
586
+ If there is not block element inside li tag,
587
+ then firefox sets inherited height to li
588
+ However, if there is any block element and if it's empty
589
+ (or has empty inline element) then
590
+ firefox sets li tag height to zero.
591
+ More details at
592
+ https://product-fabric.atlassian.net/wiki/spaces/~455502413/pages/3149365890/ED-14110+Investigation
593
+ */
594
+ const listsSharedStylesForGekko = css({
595
+ 'ul, ol': {
596
+ 'li p:empty, li p > span:empty': {
597
+ display: 'inline-block'
598
+ }
599
+ }
600
+ });
601
+ const indentationSharedStyles = css({
602
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
603
+ '.fabric-editor-indentation-mark': {
604
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
605
+ "&[data-level='1']": {
606
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
607
+ marginLeft: '30px'
608
+ },
609
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
610
+ "&[data-level='2']": {
611
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
612
+ marginLeft: '60px'
613
+ },
614
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
615
+ "&[data-level='3']": {
616
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
617
+ marginLeft: '90px'
618
+ },
619
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
620
+ "&[data-level='4']": {
621
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
622
+ marginLeft: '120px'
623
+ },
624
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
625
+ "&[data-level='5']": {
626
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
627
+ marginLeft: '150px'
628
+ },
629
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
630
+ "&[data-level='6']": {
631
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
632
+ marginLeft: '180px'
633
+ }
634
+ }
635
+ });
636
+ const blockMarksSharedStyles = css({
637
+ /**
638
+ * We need to remove margin-top from first item
639
+ * inside doc, tableCell, tableHeader, blockquote, etc.
640
+ */
641
+ [`*:not(.fabric-editor-block-mark) >,
642
+ *:not(.fabric-editor-block-mark) >
643
+ div.fabric-editor-block-mark:first-of-type
644
+ :not(.fabric-editor-indentation-mark)
645
+ :not(.fabric-editor-alignment),
646
+ .fabric-editor-alignment:first-of-type:first-child,
647
+ .ProseMirror .fabric-editor-indentation-mark:first-of-type:first-child`]: {
648
+ 'p, h1, h2, h3, h4, h5, h6, .heading-wrapper': {
649
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
650
+ ':first-child:not(style), style:first-child + *': {
651
+ marginTop: 0
652
+ }
653
+ }
654
+ }
655
+ });
656
+ const codeMarkSharedStyles = css({
657
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
658
+ '.code': {
659
+ '--ds--code--bg-color': "var(--ds-background-neutral, #091E420F)",
660
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
661
+ fontSize: '0.875em',
662
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
663
+ fontFamily: "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
664
+ fontWeight: "var(--ds-font-weight-regular, 400)",
665
+ backgroundColor: `var(--ds--code--bg-color,${`var(--ds-background-neutral, ${N20})`})`,
666
+ color: `var(--ds-text, ${N800})`,
667
+ borderStyle: 'none',
668
+ borderRadius: "var(--ds-border-radius, 3px)",
669
+ display: 'inline',
670
+ padding: '2px 0.5ch',
671
+ boxDecorationBreak: 'clone',
672
+ overflow: 'auto',
673
+ overflowWrap: 'break-word',
674
+ whiteSpace: 'pre-wrap'
675
+ }
676
+ });
677
+ const shadowSharedStyle = css({
678
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
679
+ [`& .${shadowClassNames.RIGHT_SHADOW}::before, .${shadowClassNames.RIGHT_SHADOW}::after, .${shadowClassNames.LEFT_SHADOW}::before, .${shadowClassNames.LEFT_SHADOW}::after`]: {
680
+ display: 'none',
681
+ position: 'absolute',
682
+ pointerEvents: 'none',
683
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
684
+ zIndex: akEditorShadowZIndex,
685
+ width: '8px',
686
+ content: "''",
687
+ height: 'calc(100%)'
688
+ },
689
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
690
+ [`& .${shadowClassNames.RIGHT_SHADOW}, .${shadowClassNames.LEFT_SHADOW}`]: {
691
+ position: 'relative'
692
+ },
693
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
694
+ [`& .${shadowClassNames.LEFT_SHADOW}::before`]: {
695
+ background: `linear-gradient( to left, transparent 0, ${"var(--ds-shadow-overflow-spread, #091e4229)"} 140% ), linear-gradient( to right, ${"var(--ds-shadow-overflow-perimeter, transparent)"} 0px, transparent 1px )`,
696
+ top: '0px',
697
+ left: 0,
698
+ display: 'block'
699
+ },
700
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
701
+ [`& .${shadowClassNames.RIGHT_SHADOW}::after`]: {
702
+ background: `linear-gradient( to right, transparent 0, ${"var(--ds-shadow-overflow-spread, #091e4229)"} 140% ), linear-gradient( to left, ${"var(--ds-shadow-overflow-perimeter, transparent)"} 0px, transparent 1px )`,
703
+ right: '0px',
704
+ top: '0px',
705
+ display: 'block'
706
+ },
707
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
708
+ [`& .${shadowObserverClassNames.SENTINEL_LEFT}`]: {
709
+ height: '100%',
710
+ width: '0px',
711
+ minWidth: '0px'
712
+ },
713
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
714
+ [`& .${shadowObserverClassNames.SENTINEL_RIGHT}`]: {
715
+ height: '100%',
716
+ width: '0px',
717
+ minWidth: '0px'
718
+ }
719
+ });
720
+ const dateSharedStyle = css({
721
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
722
+ [`.${DateSharedCssClassName.DATE_WRAPPER} span`]: {
723
+ whiteSpace: 'unset'
724
+ }
725
+ });
726
+ const textColorStyles = css({
727
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
728
+ '.fabric-text-color-mark': {
729
+ color: 'var(--custom-palette-color, inherit)'
730
+ },
731
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
732
+ 'a .fabric-text-color-mark': {
733
+ color: 'unset'
734
+ }
735
+ });
736
+ const backgroundColorStyles = css({
737
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
738
+ '.fabric-background-color-mark': {
739
+ backgroundColor: 'var(--custom-palette-color, inherit)',
740
+ borderRadius: '2px',
741
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
742
+ paddingTop: '1px',
743
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
744
+ paddingBottom: '2px',
745
+ boxDecorationBreak: 'clone'
746
+ },
747
+ // Don't show text highlight styling when there is a hyperlink
748
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
749
+ 'a .fabric-background-color-mark': {
750
+ backgroundColor: 'unset'
751
+ },
752
+ // Don't show text highlight styling when there is an inline comment
753
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
754
+ '.fabric-background-color-mark .ak-editor-annotation': {
755
+ backgroundColor: 'unset'
756
+ }
757
+ });
758
+ const tasksAndDecisionsStyles = css({
759
+ '.ProseMirror': {
760
+ [`.taskItemView-content-wrap,
761
+ .${TaskDecisionSharedCssClassName.DECISION_CONTAINER}`]: {
762
+ position: 'relative',
763
+ minWidth: `${akEditorTableCellMinWidth}px`
764
+ },
765
+ [`.${TaskDecisionSharedCssClassName.DECISION_CONTAINER}`]: {
766
+ marginTop: 0
767
+ },
768
+ [`.${TaskDecisionSharedCssClassName.TASK_CONTAINER}`]: {
769
+ 'span[contenteditable="false"]': {
770
+ height: `${akEditorLineHeight}em`
771
+ }
772
+ },
773
+ [`.${TaskDecisionSharedCssClassName.TASK_ITEM}`]: {
774
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
775
+ lineHeight: akEditorLineHeight
776
+ }
777
+ },
778
+ 'div[data-task-local-id]': {
779
+ 'span[contenteditable="false"]': {
780
+ height: `${akEditorLineHeight}em`
781
+ },
782
+ 'span[contenteditable="false"] + div': {
783
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
784
+ lineHeight: `${akEditorLineHeight}em`
785
+ }
786
+ },
787
+ 'div[data-task-list-local-id]': {
788
+ margin: `${"var(--ds-space-150, 12px)"} 0 0 0`,
789
+ // If task item is not first in the list then set margin top to 4px.
790
+ 'div + div': {
791
+ marginTop: "var(--ds-space-050, 4px)"
792
+ }
793
+ },
794
+ // If task list is not first in the document then set margin top to 4px.
795
+ 'div[data-task-list-local-id] div[data-task-list-local-id]': {
796
+ marginTop: "var(--ds-space-050, 4px)",
797
+ marginLeft: "var(--ds-space-300, 24px)"
798
+ },
799
+ /* When action list is inside panel */
800
+ '.ak-editor-panel__content': {
801
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
802
+ '> div[data-task-list-local-id]:first-child': {
803
+ margin: '0 0 0 0 !important'
804
+ }
805
+ }
806
+ });
807
+ const smartCardStyles = css({
808
+ [`.${SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER}`]: {
809
+ display: 'block',
810
+ margin: `${blockNodesVerticalMargin} 0 0`,
811
+ maxWidth: `${8 * 95}px`
812
+ }
813
+ });
814
+ const baseOtherStyles = css({
815
+ '& .UnknownBlock': {
816
+ fontFamily: "var(--ds-font-family-body, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
817
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
818
+ fontSize: `${14 / 16}rem`,
819
+ fontWeight: "var(--ds-font-weight-regular, 400)",
820
+ whiteSpace: 'pre-wrap',
821
+ wordWrap: 'break-word'
822
+ },
823
+ '& span.date-node': {
824
+ background: `var(--ds-background-neutral, ${N30A})`,
825
+ borderRadius: "var(--ds-border-radius-100, 3px)",
826
+ color: `var(--ds-text, ${N800})`,
827
+ padding: `${"var(--ds-space-025, 2px)"} ${"var(--ds-space-050, 4px)"}`,
828
+ margin: `0 1px`,
829
+ transition: `background 0.3s`
830
+ },
831
+ '& span.date-node-highlighted': {
832
+ background: `var(--ds-background-danger, ${R50})`,
833
+ color: `var(--ds-text-danger, ${R500})`
834
+ },
835
+ '& .renderer-image': {
836
+ maxWidth: '100%',
837
+ display: 'block',
838
+ margin: `${"var(--ds-space-300, 24px)"} 0`
839
+ },
840
+ [`.${richMediaClassName}.rich-media-wrapped + .${richMediaClassName}:not(.rich-media-wrapped)`]: {
841
+ clear: 'both'
842
+ },
843
+ [`& .code-block,
844
+ & blockquote,
845
+ & hr,
846
+ & > div > div:not(.rich-media-wrapped),
847
+ .${richMediaClassName}.rich-media-wrapped + .rich-media-wrapped + *:not(.rich-media-wrapped),
848
+ .${richMediaClassName}.rich-media-wrapped + div:not(.rich-media-wrapped),
849
+ .${richMediaClassName}.image-align-start,
850
+ .${richMediaClassName}.image-center,
851
+ .${richMediaClassName}.image-align-end`]: {
852
+ clear: 'both'
853
+ },
854
+ '& .rich-media-wrapped': {
855
+ '& + h1, & + h2, & + h3, & + h4, & + h5, & + h6': {
856
+ marginTop: "var(--ds-space-100, 8px)"
857
+ }
858
+ },
859
+ // originally copied the block after mediaSharedStyle
860
+ 'div[class^="image-wrap-"] + div[class^="image-wrap-"]': {
861
+ marginLeft: 0,
862
+ marginRight: 0
863
+ },
864
+ /* Breakout for tables and extensions */
865
+ [`.${RendererCssClassName.DOCUMENT} >`]: {
866
+ [`*:not([data-mark-type='fragment']) .${TableSharedCssClassName.TABLE_CONTAINER}`]: {
867
+ // TODO - improve inline style logic on table container so important styles aren't required here
868
+ width: '100% !important',
869
+ left: '0 !important'
870
+ },
871
+ [`[data-mark-type='fragment'] * .${TableSharedCssClassName.TABLE_CONTAINER}`]: {
872
+ // TODO - improve inline style logic on table container so important styles aren't required here
873
+ width: '100% !important',
874
+ left: '0 !important'
875
+ },
876
+ [`* .${RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER}`]: {
877
+ overflowX: 'auto'
878
+ },
879
+ [`& .${RendererCssClassName.EXTENSION}:first-child`]: {
880
+ marginTop: 0
881
+ }
882
+ },
883
+ [`.${RendererCssClassName.DOCUMENT}`]: {
884
+ [`.${RendererCssClassName.EXTENSION}`]: {
885
+ marginTop: `${blockNodesVerticalMargin}`
886
+ },
887
+ [`.${RendererCssClassName.EXTENSION_CENTER_ALIGN}`]: {
888
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
889
+ marginLeft: '50%',
890
+ transform: 'translateX(-50%)'
891
+ },
892
+ [`.${TableSharedCssClassName.TABLE_NODE_WRAPPER}`]: {
893
+ overflowX: 'auto'
894
+ },
895
+ [`.${shadowObserverClassNames.SHADOW_CONTAINER} .${TableSharedCssClassName.TABLE_NODE_WRAPPER}`]: {
896
+ display: 'flex'
897
+ }
898
+ }
899
+ });
900
+ const alignedHeadingAnchorStyle = css({
901
+ // TODO Delete this comment after verifying space token -> previous value `margin: 6px`
902
+ '.fabric-editor-block-mark[data-align] >': {
903
+ 'h1, h2, h3, h4, h5, h6': {
904
+ position: 'relative'
905
+ }
906
+ },
907
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
908
+ '.fabric-editor-block-mark:not([data-align="center"])[data-align]': {
909
+ [`.${HeadingAnchorWrapperClassName}`]: {
910
+ margin: `0 ${"var(--ds-space-075, 6px)"} 0 0`,
911
+ // If the anchor is right aligned then the left side of the heading
912
+ // is aligned with the left side of the anchor.
913
+ // In order to align as expected we transform it the width of the element (plus our expected 6px)
914
+ // to the left
915
+ transform: `translateX(calc(-100% - ${"var(--ds-space-075, 6px)"}))`
916
+ },
917
+ '@media (hover: hover) and (pointer: fine)': {
918
+ [`.${HeadingAnchorWrapperClassName} > button`]: {
919
+ transform: `translate(8px, 0px)`
920
+ }
921
+ }
922
+ }
923
+ });
924
+
925
+ // TODO: emotion refactor - there's a mediaSingleSharedNewStyle, but not originally used in the renderer.
926
+ const mediaSingleSharedStyle = css({
927
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
928
+ [`li .${richMediaClassName}`]: {
929
+ margin: 0
930
+ },
931
+ // Hack for chrome to fix media single position inside a list when media is the first child
932
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
933
+ '&.ua-chrome li > .mediaSingleView-content-wrap::before': {
934
+ content: "''",
935
+ display: 'block',
936
+ height: 0
937
+ },
938
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
939
+ '&.ua-firefox': {
940
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
941
+ '.mediaSingleView-content-wrap': {
942
+ userSelect: 'none'
943
+ },
944
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
945
+ '.captionView-content-wrap': {
946
+ userSelect: 'text'
947
+ }
948
+ },
949
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
950
+ ".mediaSingleView-content-wrap[layout='center']": {
951
+ clear: 'both'
952
+ },
953
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
954
+ [`table .${richMediaClassName}`]: {
955
+ marginTop: "var(--ds-space-150, 12px)",
956
+ marginBottom: "var(--ds-space-150, 12px)",
957
+ clear: 'both',
958
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
959
+ '&.image-wrap-left[data-layout], &.image-wrap-right[data-layout]': {
960
+ clear: 'none',
961
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
962
+ '&:first-child': {
963
+ marginTop: "var(--ds-space-150, 12px)"
964
+ }
965
+ }
966
+ },
967
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
968
+ [`.${richMediaClassName}.image-wrap-right + .${richMediaClassName}.image-wrap-left`]: {
969
+ clear: 'both'
970
+ },
971
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
972
+ [`.${richMediaClassName}.image-wrap-left + .${richMediaClassName}.image-wrap-right, .${richMediaClassName}.image-wrap-right + .${richMediaClassName}.image-wrap-left, .${richMediaClassName}.image-wrap-left + .${richMediaClassName}.image-wrap-left, .${richMediaClassName}.image-wrap-right + .${richMediaClassName}.image-wrap-right`]: {
973
+ marginRight: 0,
974
+ marginLeft: 0
975
+ },
976
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
977
+ [`@media all and (max-width: ${wrappedMediaBreakoutPoint}px)`]: {
978
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
979
+ "div.mediaSingleView-content-wrap[layout='wrap-left'], div.mediaSingleView-content-wrap[data-layout='wrap-left'], div.mediaSingleView-content-wrap[layout='wrap-right'], div.mediaSingleView-content-wrap[data-layout='wrap-right']": {
980
+ float: 'none',
981
+ overflow: 'auto',
982
+ margin: `${"var(--ds-space-150, 12px)"} 0`
983
+ }
984
+ }
985
+ });
986
+
987
+ // was shared between editor-core and renderer
988
+ const tableSharedStyle = css({
989
+ // originally from packages/editor/editor-common/src/styles/shared/tableCell.ts
990
+ // Hardcoding the background color for the table cells to avoid the use of inline styles
991
+ 'td[colorname="white" i], th[colorname="white" i]': {
992
+ backgroundColor: `${"var(--ds-surface, #FFFFFF)"} !important`
993
+ },
994
+ 'td[colorname="light blue" i], th[colorname="light blue" i]': {
995
+ backgroundColor: `${"var(--ds-background-accent-blue-subtlest, #DEEBFF)"} !important`
996
+ },
997
+ 'td[colorname="light teal" i], th[colorname="light teal" i]': {
998
+ backgroundColor: `${"var(--ds-background-accent-teal-subtlest, #E6FCFF)"} !important`
999
+ },
1000
+ 'td[colorname="light green" i], th[colorname="light green" i]': {
1001
+ backgroundColor: `${"var(--ds-background-accent-green-subtlest, #E3FCEF)"} !important`
1002
+ },
1003
+ 'td[colorname="light yellow" i], th[colorname="light yellow" i]': {
1004
+ backgroundColor: `${"var(--ds-background-accent-yellow-subtlest, #FFFAE6)"} !important`
1005
+ },
1006
+ 'td[colorname="light red" i], th[colorname="light red" i]': {
1007
+ backgroundColor: `${"var(--ds-background-accent-red-subtlest, #FFEBE6)"} !important`
1008
+ },
1009
+ 'td[colorname="light purple" i], th[colorname="light purple" i]': {
1010
+ backgroundColor: `${"var(--ds-background-accent-purple-subtlest, #EAE6FF)"} !important`
1011
+ },
1012
+ 'td[colorname="light gray" i], th[colorname="light gray" i]': {
1013
+ backgroundColor: `${"var(--ds-background-accent-gray-subtlest, #F4F5F7)"} !important`
1014
+ },
1015
+ 'td[colorname="blue" i], th[colorname="blue" i]': {
1016
+ backgroundColor: `${"var(--ds-background-accent-blue-subtler, #B3D4FF)"} !important`
1017
+ },
1018
+ 'td[colorname="teal" i], th[colorname="teal" i]': {
1019
+ backgroundColor: `${"var(--ds-background-accent-teal-subtler, #B3F5FF)"} !important`
1020
+ },
1021
+ 'td[colorname="green" i], th[colorname="green" i]': {
1022
+ backgroundColor: `${"var(--ds-background-accent-green-subtler, #ABF5D1)"} !important`
1023
+ },
1024
+ 'td[colorname="yellow" i], th[colorname="yellow" i]': {
1025
+ backgroundColor: `${"var(--ds-background-accent-yellow-subtler, #FFF0B3)"} !important`
1026
+ },
1027
+ 'td[colorname="red" i], th[colorname="red" i]': {
1028
+ backgroundColor: `${"var(--ds-background-accent-red-subtler, #FFBDAD)"} !important`
1029
+ },
1030
+ 'td[colorname="purple" i], th[colorname="purple" i]': {
1031
+ backgroundColor: `${"var(--ds-background-accent-purple-subtler, #C0B6F2)"} !important`
1032
+ },
1033
+ 'td[colorname="gray" i], th[colorname="gray" i]': {
1034
+ backgroundColor: `${"var(--ds-background-accent-gray-subtle, #B3BAC5)"} !important`
1035
+ },
1036
+ 'td[colorname="dark blue" i], th[colorname="dark blue" i]': {
1037
+ backgroundColor: `${"var(--ds-background-accent-blue-subtle, #4C9AFF)"} !important`
1038
+ },
1039
+ 'td[colorname="dark teal" i], th[colorname="dark teal" i]': {
1040
+ backgroundColor: `${"var(--ds-background-accent-teal-subtle, #79E2F2)"} !important`
1041
+ },
1042
+ 'td[colorname="dark green" i], th[colorname="dark green" i]': {
1043
+ backgroundColor: `${"var(--ds-background-accent-green-subtle, #57D9A3)"} !important`
1044
+ },
1045
+ 'td[colorname="dark yellow" i], th[colorname="dark yellow" i]': {
1046
+ backgroundColor: `${"var(--ds-background-accent-orange-subtle, #FFC400)"} !important`
1047
+ },
1048
+ 'td[colorname="dark red" i], th[colorname="dark red" i]': {
1049
+ backgroundColor: `${"var(--ds-background-accent-red-subtle, #FF8F73)"} !important`
1050
+ },
1051
+ 'td[colorname="dark purple" i], th[colorname="dark purple" i]': {
1052
+ backgroundColor: `${"var(--ds-background-accent-purple-subtle, #998DD9)"} !important`
1053
+ },
1054
+ [`.${TableSharedCssClassName.TABLE_CONTAINER}`]: {
1055
+ position: 'relative',
1056
+ margin: `0 auto ${"var(--ds-space-200, 16px)"}`,
1057
+ boxSizing: 'border-box',
1058
+ /**
1059
+ * Fix block top alignment inside table cells.
1060
+ */
1061
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
1062
+ '.decisionItemView-content-wrap:first-of-type > div': {
1063
+ marginTop: 0
1064
+ }
1065
+ },
1066
+ [`.${TableSharedCssClassName.TABLE_CONTAINER}[data-number-column='true']`]: {
1067
+ paddingLeft: `${akEditorTableNumberColumnWidth - 1}px`,
1068
+ clear: 'both'
1069
+ },
1070
+ [`.${TableSharedCssClassName.TABLE_RESIZER_CONTAINER}`]: {
1071
+ willChange: 'width, margin-left'
1072
+ },
1073
+ [`.${TableSharedCssClassName.TABLE_RESIZER_CONTAINER} table`]: {
1074
+ willChange: 'width'
1075
+ },
1076
+ [`.${TableSharedCssClassName.TABLE_NODE_WRAPPER} > table`]: {
1077
+ margin: `${"var(--ds-space-300, 24px)"} 0 0 0`
1078
+ },
1079
+ [`.${TableSharedCssClassName.TABLE_CONTAINER} > table,
1080
+ .${TableSharedCssClassName.TABLE_STICKY_WRAPPER} > table`]: {
1081
+ margin: `${"var(--ds-space-300, 24px)"} ${"var(--ds-space-100, 8px)"} 0 0`
1082
+ },
1083
+ /* avoid applying styles to nested tables (possible via extensions) */
1084
+ [`.${TableSharedCssClassName.TABLE_CONTAINER} > table,
1085
+ .${TableSharedCssClassName.TABLE_NODE_WRAPPER} > table,
1086
+ .${TableSharedCssClassName.TABLE_STICKY_WRAPPER} > table`]: {
1087
+ borderCollapse: 'collapse',
1088
+ border: `${tableCellBorderWidth}px solid ${`var(--ds-background-accent-gray-subtler, ${akEditorTableBorder})`}`,
1089
+ tableLayout: 'fixed',
1090
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
1091
+ fontSize: '1em',
1092
+ width: '100%',
1093
+ '&[data-autosize="true"]': {
1094
+ tableLayout: 'auto'
1095
+ },
1096
+ '*': {
1097
+ boxSizing: 'border-box'
1098
+ },
1099
+ hr: {
1100
+ boxSizing: 'content-box'
1101
+ },
1102
+ tbody: {
1103
+ borderBottom: 'none'
1104
+ },
1105
+ 'th td': {
1106
+ backgroundColor: "var(--ds-background-neutral-subtle, white)"
1107
+ },
1108
+ // platform_editor_nested_tables_renderer_styles has already been lunched, so assume it's on
1109
+ '> tbody > tr > td': {
1110
+ backgroundColor: "var(--ds-surface, #FFFFFF)"
1111
+ },
1112
+ th: {
1113
+ backgroundColor: `var(--ds-background-accent-gray-subtlest, ${akEditorTableToolbar})`,
1114
+ textAlign: 'left',
1115
+ /* only apply this styling to codeblocks in default background headercells */
1116
+ /* TODO this needs to be overhauled as it relies on unsafe selectors */
1117
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
1118
+ '&:not([style]):not(.danger)': {
1119
+ [`.${CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER}:not(.danger)`]: {
1120
+ backgroundColor: "var(--ds-surface-raised, rgb(235, 237, 240))",
1121
+ [`&:not(.${akEditorSelectedNodeClassName})`]: {
1122
+ boxShadow: `0px 0px 0px 1px ${"var(--ds-border, transparent)"}`
1123
+ },
1124
+ [`.${CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER}`]: {
1125
+ // originally copied from packages/editor/editor-shared-styles/src/overflow-shadow/overflow-shadow.ts
1126
+ backgroundImage: `linear-gradient(
1127
+ to right,
1128
+ ${"var(--ds-background-neutral, #091E420F)"} ${"var(--ds-space-300, 24px)"},
1129
+ transparent ${"var(--ds-space-300, 24px)"}
1130
+ ),linear-gradient(
1131
+ to right,
1132
+ ${"var(--ds-surface-raised, #FFFFFF)"} ${"var(--ds-space-300, 24px)"},
1133
+ transparent ${"var(--ds-space-300, 24px)"}
1134
+ ),linear-gradient(
1135
+ to left,
1136
+ ${"var(--ds-background-neutral, #091E420F)"} ${"var(--ds-space-100, 8px)"},
1137
+ transparent ${"var(--ds-space-100, 8px)"}
1138
+ ),linear-gradient(
1139
+ to left,
1140
+ ${"var(--ds-surface-raised, #FFFFFF)"} ${"var(--ds-space-100, 8px)"},
1141
+ transparent ${"var(--ds-space-100, 8px)"}
1142
+ ),linear-gradient(
1143
+ to left,
1144
+ ${"var(--ds-shadow-overflow-spread, #091e4229)"} 0,
1145
+ ${"var(--ds-UNSAFE-transparent, transparent)"} ${"var(--ds-space-100, 8px)"}
1146
+ ),linear-gradient(
1147
+ to left,
1148
+ ${"var(--ds-shadow-overflow-perimeter, #091e421f)"} 0,
1149
+ ${"var(--ds-UNSAFE-transparent, transparent)"} ${"var(--ds-space-100, 8px)"}
1150
+ ),linear-gradient(
1151
+ to right,
1152
+ ${"var(--ds-shadow-overflow-spread, #091e4229)"} 0,
1153
+ ${"var(--ds-UNSAFE-transparent, transparent)"} ${"var(--ds-space-100, 8px)"}
1154
+ ),linear-gradient(
1155
+ to right,
1156
+ ${"var(--ds-shadow-overflow-perimeter, #091e421f)"} 0,
1157
+ ${"var(--ds-UNSAFE-transparent, transparent)"} ${"var(--ds-space-100, 8px)"}
1158
+ )`,
1159
+ backgroundColor: "var(--ds-background-neutral, rgb(235, 237, 240))"
1160
+ },
1161
+ [`.${CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER}`]: {
1162
+ backgroundColor: "var(--ds-background-neutral, rgb(226, 229, 233))"
1163
+ },
1164
+ /* this is only relevant to the element taken care of by renderer */
1165
+ '> [data-ds--code--code-block]': {
1166
+ // originally copied from packages/editor/editor-shared-styles/src/overflow-shadow/overflow-shadow.ts
1167
+ backgroundImage: `linear-gradient(
1168
+ to right,
1169
+ ${"var(--ds-background-neutral, #091E420F)"} ${"var(--ds-space-300, 24px)"},
1170
+ transparent ${"var(--ds-space-300, 24px)"}
1171
+ ),linear-gradient(
1172
+ to right,
1173
+ ${"var(--ds-surface-raised, #FFFFFF)"} ${"var(--ds-space-300, 24px)"},
1174
+ transparent ${"var(--ds-space-300, 24px)"}
1175
+ ),linear-gradient(
1176
+ to left,
1177
+ ${"var(--ds-background-neutral, #091E420F)"} ${"var(--ds-space-100, 8px)"},
1178
+ transparent ${"var(--ds-space-100, 8px)"}
1179
+ ),linear-gradient(
1180
+ to left,
1181
+ ${"var(--ds-surface-raised, #FFFFFF)"} ${"var(--ds-space-100, 8px)"},
1182
+ transparent ${"var(--ds-space-100, 8px)"}
1183
+ ),linear-gradient(
1184
+ to left,
1185
+ ${"var(--ds-shadow-overflow-spread, #091e4229)"} 0,
1186
+ ${"var(--ds-UNSAFE-transparent, transparent)"} ${"var(--ds-space-100, 8px)"}
1187
+ ),linear-gradient(
1188
+ to left,
1189
+ ${"var(--ds-shadow-overflow-perimeter, #091e421f)"} 0,
1190
+ ${"var(--ds-UNSAFE-transparent, transparent)"} ${"var(--ds-space-100, 8px)"}
1191
+ ),linear-gradient(
1192
+ to right,
1193
+ ${"var(--ds-shadow-overflow-spread, #091e4229)"} 0,
1194
+ ${"var(--ds-UNSAFE-transparent, transparent)"} ${"var(--ds-space-100, 8px)"}
1195
+ ),linear-gradient(
1196
+ to right,
1197
+ ${"var(--ds-shadow-overflow-perimeter, #091e421f)"} 0,
1198
+ ${"var(--ds-UNSAFE-transparent, transparent)"} ${"var(--ds-space-100, 8px)"}
1199
+ )`,
1200
+ backgroundColor: `${"var(--ds-background-neutral, rgb(235, 237, 240))"}!important`,
1201
+ // selector lives inside @atlaskit/code
1202
+ '--ds--code--line-number-bg-color': "var(--ds-background-neutral, rgb(226, 229, 233))"
1203
+ }
1204
+ }
1205
+ }
1206
+ }
1207
+ }
1208
+ });
1209
+ const tableRendererHeaderStylesForTableCellOnly = css({
1210
+ [`.${TableSharedCssClassName.TABLE_CONTAINER} > table,
1211
+ .${TableSharedCssClassName.TABLE_NODE_WRAPPER} > table,
1212
+ .${TableSharedCssClassName.TABLE_STICKY_WRAPPER} > table`]: {
1213
+ // platform_editor_renderer_table_header_styles has already been launched, so assume it's on
1214
+ '> tbody > tr > th, > tbody > tr > td': {
1215
+ minWidth: `${tableCellMinWidth}px`,
1216
+ fontWeight: "var(--ds-font-weight-regular, 400)",
1217
+ verticalAlign: 'top',
1218
+ border: `1px solid ${`var(--ds-background-accent-gray-subtler, ${akEditorTableBorder})`}`,
1219
+ borderRightWidth: 0,
1220
+ borderBottomWidth: 0,
1221
+ padding: "var(--ds-space-100, 8px)",
1222
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
1223
+ 'th p:not(:first-of-type), td p:not(:first-of-type)': {
1224
+ marginTop: "var(--ds-space-150, 12px)"
1225
+ }
1226
+ }
1227
+ }
1228
+ });
1229
+ const tableStylesBackGroundClipForGeckoForTableCellOnly = css({
1230
+ [`.${TableSharedCssClassName.TABLE_CONTAINER} > table,
1231
+ .${TableSharedCssClassName.TABLE_NODE_WRAPPER} > table,
1232
+ .${TableSharedCssClassName.TABLE_STICKY_WRAPPER} > table`]: {
1233
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
1234
+ '> tbody > tr > th, > tbody > tr > td': {
1235
+ backgroundClip: 'padding-box'
1236
+ }
1237
+ }
1238
+ });
1239
+ const firstNodeWithNotMarginTopWithNestedDnD = css({
1240
+ [`.${TableSharedCssClassName.TABLE_CONTAINER} > table,
1241
+ .${TableSharedCssClassName.TABLE_NODE_WRAPPER} > table,
1242
+ .${TableSharedCssClassName.TABLE_STICKY_WRAPPER} > table`]: {
1243
+ '> tbody > tr > th, > tbody > tr > td': {
1244
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
1245
+ '> :nth-child(1 of :not(style, .ProseMirror-gapcursor, .ProseMirror-widget, span))': {
1246
+ marginTop: 0
1247
+ }
1248
+ }
1249
+ }
1250
+ });
1251
+ const firstNodeWithNotMarginTop = css({
1252
+ [`.${TableSharedCssClassName.TABLE_CONTAINER} > table,
1253
+ .${TableSharedCssClassName.TABLE_NODE_WRAPPER} > table,
1254
+ .${TableSharedCssClassName.TABLE_STICKY_WRAPPER} > table`]: {
1255
+ '> tbody > tr > th, > tbody > tr > td': {
1256
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
1257
+ '> :first-child:not(style), > style:first-child + *': {
1258
+ marginTop: 0
1259
+ },
1260
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
1261
+ '> .ProseMirror-gapcursor:first-child + *, > style:first-child + .ProseMirror-gapcursor + *': {
1262
+ marginTop: 0
1263
+ },
1264
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
1265
+ '> .ProseMirror-gapcursor:first-child + span + *, > style:first-child + .ProseMirror-gapcursor + span + *': {
1266
+ marginTop: 0
1267
+ }
1268
+ }
1269
+ }
1270
+ });
1271
+ const rendererTableStyles = css({
1272
+ [`.${RendererCssClassName.DOCUMENT} .${TableSharedCssClassName.TABLE_CONTAINER}`]: {
1273
+ zIndex: 0,
1274
+ transition: `all 0.1s linear`,
1275
+ display: 'flex' /* needed to avoid position: fixed jumpiness in Chrome */,
1276
+
1277
+ /** Shadow overrides */
1278
+ [`&.${shadowClassNames.RIGHT_SHADOW}::after, &.${shadowClassNames.LEFT_SHADOW}::before`]: {
1279
+ top: `${tableMarginTop - 1}px`,
1280
+ height: `calc(100% - ${tableMarginTop}px)`,
1281
+ zIndex: `${akEditorStickyHeaderZIndex}`,
1282
+ width: `${tableShadowWidth}px`,
1283
+ background: `linear-gradient(
1284
+ to left,
1285
+ transparent 0,
1286
+ ${`var(--ds-shadow-overflow-spread, ${N40A})`} 140%
1287
+ ),
1288
+ linear-gradient(
1289
+ to right,
1290
+ ${"var(--ds-shadow-overflow-perimeter, transparent)"} 0px,
1291
+ transparent 1px
1292
+ )`
1293
+ },
1294
+ [`&.${shadowClassNames.RIGHT_SHADOW}::after`]: {
1295
+ background: `linear-gradient(
1296
+ to right,
1297
+ transparent 0,
1298
+ ${`var(--ds-shadow-overflow-spread, ${N40A})`} 140%
1299
+ ),
1300
+ linear-gradient(
1301
+ to left,
1302
+ ${"var(--ds-shadow-overflow-perimeter, transparent)"} 0px,
1303
+ transparent 1px
1304
+ )`,
1305
+ right: `0px`
1306
+ },
1307
+ [`&
1308
+ .${shadowObserverClassNames.SENTINEL_LEFT},
1309
+ &
1310
+ .${shadowObserverClassNames.SENTINEL_RIGHT}`]: {
1311
+ height: `calc(100% - ${tableMarginTop}px)`
1312
+ }
1313
+ }
1314
+ });
1315
+ const stickyScrollbarStyles = css({
1316
+ [`.${RendererCssClassName.DOCUMENT} .${TableSharedCssClassName.TABLE_CONTAINER}`]: {
1317
+ position: 'relative',
1318
+ flexDirection: 'column',
1319
+ [`> .${TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_CONTAINER}`]: {
1320
+ width: '100%',
1321
+ display: 'block',
1322
+ visibility: 'hidden',
1323
+ overflowX: 'auto',
1324
+ position: 'sticky',
1325
+ bottom: `${"var(--ds-space-0, 0px)"}`,
1326
+ zIndex: 1
1327
+ },
1328
+ [`> .${TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM},
1329
+ > .${TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP}`]: {
1330
+ position: 'absolute',
1331
+ width: '100%',
1332
+ height: '1px',
1333
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
1334
+ marginTop: '-1px',
1335
+ // need this to avoid sentinel being focused via keyboard
1336
+ // this still allows it to be detected by intersection observer
1337
+ visibility: 'hidden'
1338
+ },
1339
+ [`> .${TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP}`]: {
1340
+ top: `${tableRowHeight * 3}px`
1341
+ },
1342
+ [`> .${TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM}`]: {
1343
+ bottom: `${"var(--ds-space-250, 20px)"}` // MAX_BROWSER_SCROLLBAR_HEIGHT = 20;
1344
+ }
1345
+ }
1346
+ });
1347
+ const rendererTableHeaderEqualHeightStylesForTableCellOnly = css({
1348
+ [`.${RendererCssClassName.DOCUMENT} .${TableSharedCssClassName.TABLE_CONTAINER}`]: {
1349
+ [`.${TableSharedCssClassName.TABLE_NODE_WRAPPER} > table, .${TableSharedCssClassName.TABLE_STICKY_WRAPPER} > table`]: {
1350
+ height: '1px' /* will be ignored */,
1351
+ marginLeft: 0,
1352
+ marginRight: 0
1353
+ }
1354
+ },
1355
+ [`.${TableSharedCssClassName.TABLE_NODE_WRAPPER} > table > tbody > tr:first-of-type, .${TableSharedCssClassName.TABLE_STICKY_WRAPPER} > table > tbody > tr:first-of-type`]: {
1356
+ height: '100%',
1357
+ 'td, th': {
1358
+ position: 'relative'
1359
+ }
1360
+ }
1361
+ });
1362
+ const rendererTableSortableColumnStyles = css({
1363
+ [`.${RendererCssClassName.DOCUMENT} .${TableSharedCssClassName.TABLE_CONTAINER}`]: {
1364
+ [`.${TableSharedCssClassName.TABLE_NODE_WRAPPER} > table, .${TableSharedCssClassName.TABLE_STICKY_WRAPPER} > table`]: {
1365
+ // allow nested heading links
1366
+ [`.${RendererCssClassName.SORTABLE_COLUMN_WRAPPER}`]: {
1367
+ padding: 0,
1368
+ [`.${RendererCssClassName.SORTABLE_COLUMN}`]: {
1369
+ width: '100%',
1370
+ height: '100%',
1371
+ padding: `${tableCellPadding}px`,
1372
+ borderWidth: '1.5px',
1373
+ borderStyle: 'solid',
1374
+ borderColor: `transparent`,
1375
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
1376
+ '> *:first-child': {
1377
+ marginTop: 0
1378
+ },
1379
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
1380
+ '> .ProseMirror-gapcursor:first-child + *, > style:first-child + .ProseMirror-gapcursor + *': {
1381
+ marginTop: 0
1382
+ },
1383
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
1384
+ '> .ProseMirror-gapcursor:first-child + span + *, > style:first-child + .ProseMirror-gapcursor + span + *': {
1385
+ marginTop: 0
1386
+ },
1387
+ '@supports selector(:focus-visible)': {
1388
+ '&:focus': {
1389
+ outline: 'unset'
1390
+ },
1391
+ '&:focus-visible': {
1392
+ borderColor: `${`var(--ds-border-focused, ${B300})`}`
1393
+ }
1394
+ }
1395
+ },
1396
+ [`> .${RendererCssClassName.SORTABLE_COLUMN} > .${RendererCssClassName.SORTABLE_COLUMN_ICON_WRAPPER}`]: {
1397
+ margin: 0,
1398
+ [`.${SORTABLE_COLUMN_ICON_CLASSNAME}`]: {
1399
+ opacity: 1,
1400
+ transition: `opacity 0.2s ease-in-out`
1401
+ }
1402
+ },
1403
+ [`> .${RendererCssClassName.SORTABLE_COLUMN}
1404
+ > .${RendererCssClassName.SORTABLE_COLUMN_NO_ORDER}`]: {
1405
+ [`.${SORTABLE_COLUMN_ICON_CLASSNAME}`]: {
1406
+ opacity: 0,
1407
+ '&:focus': {
1408
+ opacity: 1
1409
+ }
1410
+ }
1411
+ },
1412
+ [`&:hover:not(
1413
+ :has(
1414
+ .${RendererCssClassName.SORTABLE_COLUMN_WRAPPER}
1415
+ .${RendererCssClassName.SORTABLE_COLUMN}:hover
1416
+ )
1417
+ )
1418
+ > .${RendererCssClassName.SORTABLE_COLUMN}
1419
+ > .${RendererCssClassName.SORTABLE_COLUMN_NO_ORDER}`]: {
1420
+ [`.${SORTABLE_COLUMN_ICON_CLASSNAME}`]: {
1421
+ opacity: 1
1422
+ }
1423
+ }
1424
+ }
1425
+ }
1426
+ }
1427
+ });
1428
+ const rendererTableColumnStyles = css({
1429
+ [`.${RendererCssClassName.DOCUMENT} .${TableSharedCssClassName.TABLE_CONTAINER}`]: {
1430
+ 'table[data-number-column="true"]': {
1431
+ [`.${RendererCssClassName.NUMBER_COLUMN}`]: {
1432
+ backgroundColor: `${`var(--ds-background-neutral, ${akEditorTableToolbar})`}`,
1433
+ borderRight: `1px solid
1434
+ ${`var(--ds-background-accent-gray-subtler, ${akEditorTableBorder})`}`,
1435
+ width: `${akEditorTableNumberColumnWidth}px`,
1436
+ textAlign: 'center',
1437
+ color: `${`var(--ds-text-subtlest, ${N200})`}`,
1438
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
1439
+ fontSize: `${14 / 16} rem`
1440
+ },
1441
+ [`.fixed .${RendererCssClassName.NUMBER_COLUMN}`]: {
1442
+ borderRight: `0px none`
1443
+ }
1444
+ }
1445
+ }
1446
+ });
1447
+
1448
+ // assume FG platform_editor_nested_tables_renderer_styles and platform_editor_renderer_table_header_styles on
1449
+ const rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks = css({
1450
+ [`.${RendererCssClassName.DOCUMENT} .${TableSharedCssClassName.TABLE_CONTAINER}`]: {
1451
+ [`.${TableSharedCssClassName.TABLE_NODE_WRAPPER} > table, .${TableSharedCssClassName.TABLE_STICKY_WRAPPER} > table`]: {
1452
+ [`.${RendererCssClassName.SORTABLE_COLUMN_WRAPPER}`]: {
1453
+ [`.${RendererCssClassName.SORTABLE_COLUMN}`]: {
1454
+ [`.${HeadingAnchorWrapperClassName}`]: {
1455
+ position: 'unset'
1456
+ },
1457
+ '>': {
1458
+ 'h1, h2, h3, h4, h5, h6': {
1459
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
1460
+ marginRight: '30px'
1461
+ }
1462
+ }
1463
+ }
1464
+ }
1465
+ }
1466
+ }
1467
+ });
1468
+
1469
+ // @ts-expect-error - throw TS error when use !import in position.
1470
+ const stickyHeaderStyles = css({
1471
+ 'tr[data-header-row].fixed': {
1472
+ position: 'fixed !important',
1473
+ display: 'flex',
1474
+ overflow: 'hidden',
1475
+ zIndex: `${akEditorStickyHeaderZIndex}`,
1476
+ borderRight: `1px solid ${`var(--ds-background-accent-gray-subtler, ${akEditorTableBorder})`}`,
1477
+ borderBottom: `1px solid ${`var(--ds-background-accent-gray-subtler, ${akEditorTableBorder})`}`,
1478
+ /* this is to compensate for the table border */
1479
+ transform: 'translateX(-1px)'
1480
+ },
1481
+ '.sticky > th': {
1482
+ zIndex: `${akEditorStickyHeaderZIndex}`,
1483
+ position: 'fixed !important',
1484
+ top: 0
1485
+ },
1486
+ /* Make the number column header sticky */
1487
+ '.sticky > td': {
1488
+ position: 'fixed !important',
1489
+ top: 0
1490
+ },
1491
+ /* add border for position: sticky
1492
+ and work around background-clip: padding-box
1493
+ bug for FF causing box-shadow bug in Chrome */
1494
+ '.sticky th, .sticky td': {
1495
+ boxShadow: `0px 1px ${`var(--ds-background-accent-gray-subtler, ${akEditorTableBorder})`},
1496
+ 0px -0.5px ${`var(--ds-background-accent-gray-subtler, ${akEditorTableBorder})`},
1497
+ inset -1px 0px ${`var(--ds-background-accent-gray-subtler, ${akEditorTableToolbar})`},
1498
+ 0px -1px ${`var(--ds-background-accent-gray-subtler, ${akEditorTableToolbar})`}`
1499
+ },
1500
+ /* this will remove jumpiness caused in Chrome for sticky headers */
1501
+ '.fixed + tr': {
1502
+ minHeight: '0px'
1503
+ }
1504
+ });
1505
+ const codeBlockAndLayoutStyles = css({
1506
+ /*
1507
+ * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.
1508
+ * See ED-4159.
1509
+ */
1510
+ '& .code-block': {
1511
+ maxWidth: '100%',
1512
+ display: 'block',
1513
+ position: 'relative',
1514
+ borderRadius: "var(--ds-border-radius-100, 3px)",
1515
+ /*
1516
+ * The overall renderer has word-wrap: break; which causes issues with
1517
+ * code block line numbers in Safari / iOS.
1518
+ */
1519
+ wordWrap: 'normal'
1520
+ },
1521
+ '& .MediaGroup, & .code-block': {
1522
+ marginTop: `${blockNodesVerticalMargin}`,
1523
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
1524
+ '&:first-child': {
1525
+ marginTop: 0
1526
+ }
1527
+ },
1528
+ // We overwrite the rule that clears margin-top for first nested codeblocks, as
1529
+ // our lightweight codeblock dom structure will always nest the codeblock inside
1530
+ // an extra container div which would constantly be targeted. Now, top-level
1531
+ // lightweight codeblock containers will not be targeted.
1532
+ // NOTE: This must be added after other .code-block styles in the root
1533
+ // Renderer stylesheet.
1534
+ [`.${RendererCssClassName.DOCUMENT}
1535
+ > .${LightWeightCodeBlockCssClassName.CONTAINER}
1536
+ .${CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER}`]: {
1537
+ marginTop: blockNodesVerticalMargin
1538
+ },
1539
+ '& [data-layout-section]': {
1540
+ marginTop: "var(--ds-space-250, 20px)",
1541
+ '& > div + div': {
1542
+ marginLeft: "var(--ds-space-400, 32px)"
1543
+ },
1544
+ [`@media screen and (max-width: ${gridMediumMaxWidth}px)`]: {
1545
+ '& > div + div': {
1546
+ marginLeft: 0
1547
+ }
1548
+ },
1549
+ '& .MediaGroup, & .code-block': {
1550
+ marginTop: blockNodesVerticalMargin,
1551
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
1552
+ '&:first-child': {
1553
+ marginTop: 0
1554
+ }
1555
+ }
1556
+ },
1557
+ '& li': {
1558
+ '> .code-block': {
1559
+ margin: `${blockNodesVerticalMargin} 0 0 0`
1560
+ },
1561
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
1562
+ '> .code-block:first-child': {
1563
+ marginTop: 0
1564
+ },
1565
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
1566
+ '> div:last-of-type.code-block': {
1567
+ marginBottom: blockNodesVerticalMargin
1568
+ }
1569
+ }
1570
+ });
1571
+ const layoutSectionForAdvancedLayoutsStyles = css({
1572
+ '& [data-layout-section]': {
1573
+ '& > div + div': {
1574
+ marginLeft: 0
1575
+ }
1576
+ }
1577
+ });
1578
+ const gridRenderForCodeBlockStyles = css({
1579
+ '& .code-block': {
1580
+ // removed old -ms- prefix, as grid is well supported for MS Edge
1581
+ display: 'grid',
1582
+ gridTemplateColumns: 'minmax(0, 1fr)',
1583
+ '& > span': {
1584
+ gridColumn: 1
1585
+ }
1586
+ }
1587
+ });
1588
+
1589
+ // This prevents https://product-fabric.atlassian.net/browse/ED-20924
1590
+ const codeBlockInListSafariFixStyles = css({
1591
+ [`&:not([data-node-type='decisionList']) > li,
1592
+ &:not(.${SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER}) > li`]: {
1593
+ '&::before': {
1594
+ content: '" "',
1595
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
1596
+ lineHeight: akEditorLineHeight
1597
+ },
1598
+ [`> p:first-child,
1599
+ > .code-block:first-child,
1600
+ > .ProseMirror-gapcursor:first-child + .code-block`]: {
1601
+ marginTop: `-${akEditorLineHeight}em !important`
1602
+ }
1603
+ }
1604
+ });
1605
+ const columnLayoutSharedStyle = css({
1606
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
1607
+ '[data-layout-section]': {
1608
+ position: 'relative',
1609
+ display: 'flex',
1610
+ flexDirection: 'row',
1611
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
1612
+ '& > *': {
1613
+ flex: 1,
1614
+ minWidth: 0
1615
+ },
1616
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
1617
+ '& > .unsupportedBlockView-content-wrap': {
1618
+ minWidth: 'initial'
1619
+ },
1620
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
1621
+ [`@media screen and (max-width: ${gridMediumMaxWidth}px)`]: {
1622
+ flexDirection: 'column'
1623
+ }
1624
+ }
1625
+ });
1626
+ const columnLayoutResponsiveSharedStyle = css({
1627
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
1628
+ '[data-layout-section]': {
1629
+ display: 'flex',
1630
+ flexDirection: 'row',
1631
+ gap: "var(--ds-space-100, 8px)",
1632
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
1633
+ '& > *': {
1634
+ flex: 1,
1635
+ minWidth: 0
1636
+ },
1637
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
1638
+ '& > .unsupportedBlockView-content-wrap': {
1639
+ minWidth: 'initial'
1640
+ }
1641
+ },
1642
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
1643
+ '.layout-section-container': {
1644
+ containerType: 'inline-size',
1645
+ containerName: 'layout-area'
1646
+ }
1647
+ });
1648
+ const columnLayoutResponsiveRendererStyles = css({
1649
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
1650
+ '.layout-section-container [data-layout-section]': {
1651
+ gap: "var(--ds-space-600, 48px)",
1652
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-container-queries
1653
+ [`@container layout-area (max-width: ${LAYOUT_BREAKPOINT_RENDERER}px)`]: {
1654
+ flexDirection: 'column',
1655
+ gap: "var(--ds-space-400, 32px)"
1656
+ }
1657
+ }
1658
+ });
1659
+ const rendererAnnotationStyles = css({
1660
+ "& [data-mark-type='annotation'][data-mark-annotation-state='active'] [data-annotation-mark], & [data-annotation-draft-mark][data-annotation-inline-node]": {
1661
+ background: `var(--ds-background-accent-yellow-subtler, ${Y75})`,
1662
+ borderBottom: `2px solid ${`var(--ds-border-accent-yellow, ${Y300})`}`,
1663
+ boxShadow: `var(--ds-shadow-overlay, ${`1px 2px 3px ${N60A}, -1px 2px 3px ${N60A}`})`,
1664
+ cursor: 'pointer',
1665
+ padding: `${"var(--ds-space-050, 4px)"} ${"var(--ds-space-025, 2px)"}`
1666
+ }
1667
+ });
1668
+ const rendererAnnotationStylesCommentHeightFix = css({
1669
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
1670
+ '& [data-annotation-draft-mark][data-annotation-inline-node]': {
1671
+ borderBottom: '2px solid transparent',
1672
+ cursor: 'pointer',
1673
+ padding: '1px 0 2px',
1674
+ background: `var(--ds-background-accent-yellow-subtler, ${Y75})`,
1675
+ borderBottomColor: `var(--ds-border-accent-yellow, ${Y300})`,
1676
+ boxShadow: `var(--ds-shadow-overlay, ${`1px 2px 3px ${N60A}, -1px 2px 3px ${N60A}`})`
1677
+ },
1678
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
1679
+ '& [data-annotation-draft-mark][data-annotation-inline-node][data-inline-card]': {
1680
+ padding: '5px 0 3px 0'
1681
+ },
1682
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
1683
+ '& [data-annotation-draft-mark][data-annotation-inline-node].date-lozenger-container': {
1684
+ paddingTop: "var(--ds-space-025, 2px)"
1685
+ }
1686
+ });
1687
+ export const RendererStyleContainer = props => {
1688
+ const {
1689
+ onClick,
1690
+ onMouseDown,
1691
+ appearance,
1692
+ allowNestedHeaderLinks,
1693
+ allowColumnSorting,
1694
+ allowAnnotations,
1695
+ allowTableResizing,
1696
+ useBlockRenderForCodeBlock,
1697
+ children,
1698
+ innerRef,
1699
+ testId
1700
+ } = props;
1701
+ const isAdvancedLayoutsOn = editorExperiment('advanced_layouts', true);
1702
+ if (fg('platform_editor_emotion_refactor_renderer')) {
1703
+ return (
1704
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
1705
+ jsx("div", {
1706
+ ref: innerRef,
1707
+ onClick: onClick,
1708
+ onMouseDown: onMouseDown,
1709
+ style: {
1710
+ '--ak-renderer-base-font-size': `${getBaseFontSize(appearance)}px`
1711
+ },
1712
+ css: [baseStyles, appearance === 'full-page' && rendererFullPageStyles, appearance === 'full-width' && rendererFullWidthStyles, !isTableResizingEnabled(appearance) && rendererFullWidthStylesForTableResizing, telepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, fg('platform_editor_typography_ugc') ? headingsSharedStylesWithEditorUGC : headingsSharedStyles, fg('platform_editor_heading_margin_fix') && headingWithAlignmentStyles, ruleSharedStyles, fg('platform_editor_typography_ugc') ? paragraphSharedStylesWithEditorUGC : paragraphSharedStyles, listsSharedStyles, browser.gecko && listsSharedStylesForGekko, indentationSharedStyles, blockMarksSharedStyles, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles, tasksAndDecisionsStyles, smartCardStyles,
1713
+ // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
1714
+ fg('editor_inline_comments_on_inline_nodes') && rendererAnnotationStyles,
1715
+ // eslint-disable-next-line @atlaskit/platform/no-preconditioning, @atlaskit/platform/ensure-feature-flag-prefix
1716
+ fg('editor_inline_comments_on_inline_nodes') &&
1717
+ // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
1718
+ fg('annotations_align_editor_and_renderer_styles') && rendererAnnotationStylesCommentHeightFix, baseOtherStyles, allowNestedHeaderLinks && alignedHeadingAnchorStyle, mediaSingleSharedStyle, tableSharedStyle, tableRendererHeaderStylesForTableCellOnly, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, editorExperiment('nested-dnd', true) ? firstNodeWithNotMarginTopWithNestedDnD : firstNodeWithNotMarginTop, rendererTableStyles, isStickyScrollbarEnabled(appearance) && stickyScrollbarStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && allowNestedHeaderLinks && rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks, rendererTableColumnStyles, stickyHeaderStyles, codeBlockAndLayoutStyles, columnLayoutSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveRendererStyles, isAdvancedLayoutsOn && layoutSectionForAdvancedLayoutsStyles, !useBlockRenderForCodeBlock && gridRenderForCodeBlockStyles, browser.safari && codeBlockInListSafariFixStyles],
1719
+ "data-testid": testId
1720
+ }, children)
1721
+ );
1722
+ }
1723
+ return (
1724
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
1725
+ jsx("div", {
1726
+ ref: innerRef,
1727
+ onClick: onClick,
1728
+ onMouseDown: onMouseDown
1729
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
1730
+ ,
1731
+ css: rendererStyles({
1732
+ appearance,
1733
+ allowNestedHeaderLinks,
1734
+ allowColumnSorting: !!allowColumnSorting,
1735
+ useBlockRenderForCodeBlock,
1736
+ allowAnnotations: allowAnnotations,
1737
+ allowTableResizing: allowTableResizing
1738
+ }),
1739
+ "data-testid": testId
1740
+ }, props.children)
1741
+ );
1742
+ };