@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.
Files changed (72) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/afm-cc/tsconfig.json +3 -0
  3. package/dist/cjs/react/marks/alignment.js +3 -15
  4. package/dist/cjs/react/nodes/blockCard.js +24 -8
  5. package/dist/cjs/react/nodes/codeBlock/components/codeBlockContainer.js +3 -10
  6. package/dist/cjs/react/nodes/codeBlock/components/lightWeightCodeBlock.js +8 -53
  7. package/dist/cjs/react/nodes/layoutColumn.js +3 -11
  8. package/dist/cjs/react/nodes/media/index.js +28 -58
  9. package/dist/cjs/react/nodes/panel.js +2 -26
  10. package/dist/cjs/react/nodes/table/colgroup.js +5 -2
  11. package/dist/cjs/react/nodes/table/sticky.js +3 -57
  12. package/dist/cjs/react/nodes/table/table.js +6 -1
  13. package/dist/cjs/react/nodes/table.js +51 -23
  14. package/dist/cjs/react/nodes/tableNew.js +550 -0
  15. package/dist/cjs/ui/Expand.js +12 -62
  16. package/dist/cjs/ui/Renderer/RendererStyleContainer.js +19 -42
  17. package/dist/cjs/ui/Renderer/breakout-ssr.js +22 -22
  18. package/dist/cjs/ui/Renderer/index.js +4 -2
  19. package/dist/cjs/ui/Renderer/style.js +2 -208
  20. package/dist/cjs/ui/annotations/draft/component.js +2 -17
  21. package/dist/cjs/ui/annotations/element/mark.js +12 -61
  22. package/dist/es2019/react/marks/alignment.js +2 -17
  23. package/dist/es2019/react/nodes/blockCard.js +24 -8
  24. package/dist/es2019/react/nodes/codeBlock/components/codeBlockContainer.js +2 -39
  25. package/dist/es2019/react/nodes/codeBlock/components/lightWeightCodeBlock.js +5 -50
  26. package/dist/es2019/react/nodes/layoutColumn.js +4 -12
  27. package/dist/es2019/react/nodes/media/index.js +3 -36
  28. package/dist/es2019/react/nodes/panel.js +2 -41
  29. package/dist/es2019/react/nodes/table/colgroup.js +5 -2
  30. package/dist/es2019/react/nodes/table/sticky.js +3 -70
  31. package/dist/es2019/react/nodes/table/table.js +6 -1
  32. package/dist/es2019/react/nodes/table.js +50 -22
  33. package/dist/es2019/react/nodes/tableNew.js +501 -0
  34. package/dist/es2019/ui/Expand.js +11 -67
  35. package/dist/es2019/ui/Renderer/RendererStyleContainer.js +20 -43
  36. package/dist/es2019/ui/Renderer/breakout-ssr.js +22 -22
  37. package/dist/es2019/ui/Renderer/index.js +4 -2
  38. package/dist/es2019/ui/Renderer/style.js +1 -889
  39. package/dist/es2019/ui/annotations/draft/component.js +2 -15
  40. package/dist/es2019/ui/annotations/element/mark.js +9 -71
  41. package/dist/esm/react/marks/alignment.js +2 -16
  42. package/dist/esm/react/nodes/blockCard.js +24 -8
  43. package/dist/esm/react/nodes/codeBlock/components/codeBlockContainer.js +2 -11
  44. package/dist/esm/react/nodes/codeBlock/components/lightWeightCodeBlock.js +7 -52
  45. package/dist/esm/react/nodes/layoutColumn.js +4 -12
  46. package/dist/esm/react/nodes/media/index.js +28 -58
  47. package/dist/esm/react/nodes/panel.js +3 -27
  48. package/dist/esm/react/nodes/table/colgroup.js +5 -2
  49. package/dist/esm/react/nodes/table/sticky.js +3 -57
  50. package/dist/esm/react/nodes/table/table.js +6 -1
  51. package/dist/esm/react/nodes/table.js +51 -21
  52. package/dist/esm/react/nodes/tableNew.js +544 -0
  53. package/dist/esm/ui/Expand.js +12 -62
  54. package/dist/esm/ui/Renderer/RendererStyleContainer.js +20 -43
  55. package/dist/esm/ui/Renderer/breakout-ssr.js +22 -22
  56. package/dist/esm/ui/Renderer/index.js +4 -2
  57. package/dist/esm/ui/Renderer/style.js +1 -203
  58. package/dist/esm/ui/annotations/draft/component.js +2 -17
  59. package/dist/esm/ui/annotations/element/mark.js +9 -56
  60. package/dist/types/react/nodes/codeBlock/components/lightWeightCodeBlock.d.ts +1 -1
  61. package/dist/types/react/nodes/table.d.ts +35 -254
  62. package/dist/types/react/nodes/tableNew.d.ts +83 -0
  63. package/dist/types/ui/Renderer/breakout-ssr.d.ts +1 -2
  64. package/dist/types/ui/Renderer/style.d.ts +0 -11
  65. package/dist/types/ui/annotations/element/mark.d.ts +30 -6
  66. package/dist/types-ts4.5/react/nodes/codeBlock/components/lightWeightCodeBlock.d.ts +1 -1
  67. package/dist/types-ts4.5/react/nodes/table.d.ts +35 -254
  68. package/dist/types-ts4.5/react/nodes/tableNew.d.ts +83 -0
  69. package/dist/types-ts4.5/ui/Renderer/breakout-ssr.d.ts +1 -2
  70. package/dist/types-ts4.5/ui/Renderer/style.d.ts +0 -11
  71. package/dist/types-ts4.5/ui/annotations/element/mark.d.ts +30 -6
  72. package/package.json +14 -7
@@ -1,890 +1,2 @@
1
- /* eslint-disable @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation */
2
- /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
3
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
4
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
5
- import { css } from '@emotion/react';
6
- import { fg } from '@atlaskit/platform-feature-flags';
7
- // Ignored via go/ees005
8
- // eslint-disable-next-line import/no-namespace
9
- import * as colors from '@atlaskit/theme/colors';
10
- import { N60A, Y300, Y75, N40A } from '@atlaskit/theme/colors';
11
- import { getGlobalTheme } from '@atlaskit/tokens';
12
- import { mediaInlineImageStyles } from '@atlaskit/editor-common/media-inline';
13
- 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';
14
- import { shadowClassNames, shadowObserverClassNames } from '@atlaskit/editor-common/ui';
15
- import { browser } from '@atlaskit/editor-common/browser';
16
- import { editorFontSize, blockNodesVerticalMargin, akEditorTableToolbar, akEditorTableBorder, akEditorTableNumberColumnWidth, gridMediumMaxWidth, akEditorFullWidthLayoutWidth, akEditorStickyHeaderZIndex, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
17
- import { RendererCssClassName } from '../../consts';
18
- import { HeadingAnchorWrapperClassName } from '../../react/nodes/heading-anchor';
19
- import { getLightWeightCodeBlockStylesForRootRendererStyleSheet } from '../../react/nodes/codeBlock/components/lightWeightCodeBlock';
20
- import { isTableResizingEnabled, isStickyScrollbarEnabled } from '../../react/nodes/table';
21
- import { SORTABLE_COLUMN_ICON_CLASSNAME } from '@atlaskit/editor-common/table';
22
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
23
1
  export const FullPagePadding = 32;
24
- const tableShadowWidth = 32;
25
- export const TELEPOINTER_ID = 'ai-streaming-telepointer';
26
- const telepointerStyles = css`
27
- #${TELEPOINTER_ID} {
28
- display: inline-block;
29
- position: relative;
30
- width: 1.5px;
31
- height: 25px;
32
- background-color: ${"var(--ds-background-brand-bold, #0C66E4)"};
33
- margin-left: ${"var(--ds-space-025, 2px)"};
34
-
35
- &::after {
36
- content: 'AI';
37
- position: absolute;
38
- display: block;
39
- top: 0;
40
- left: 0;
41
- font-size: 10px;
42
- font-weight: ${"var(--ds-font-weight-bold, 700)"};
43
- width: 12.5px;
44
- height: 13px;
45
- padding-top: 1px;
46
- padding-left: 1.5px;
47
- line-height: initial;
48
- border-radius: 0px 2px 2px 0px;
49
- color: ${"var(--ds-text-inverse, white)"};
50
- background-color: ${"var(--ds-background-brand-bold, #0C66E4)"};
51
- }
52
- }
53
- `;
54
-
55
- /**
56
- * **DEPRECATED**
57
- *
58
- * Originally defined in `@atlaskit/theme/typography`, but moved here as it has since been deleted in favor of typography tokens.
59
- * This should be removed as part of editor token work. More info:
60
- * https://atlassian.slack.com/archives/C075G5D7ZP1/p1733449725865539?thread_ts=1732159801.409789&cid=C075G5D7ZP1
61
- * */
62
- const headingSizesImport = {
63
- h900: {
64
- size: 35,
65
- lineHeight: 40
66
- },
67
- h800: {
68
- size: 29,
69
- lineHeight: 32
70
- },
71
- h700: {
72
- size: 24,
73
- lineHeight: 28
74
- },
75
- h600: {
76
- size: 20,
77
- lineHeight: 24
78
- },
79
- h500: {
80
- size: 16,
81
- lineHeight: 20
82
- },
83
- h400: {
84
- size: 14,
85
- lineHeight: 16
86
- },
87
- h300: {
88
- size: 12,
89
- lineHeight: 16
90
- },
91
- h200: {
92
- size: 12,
93
- lineHeight: 16
94
- },
95
- h100: {
96
- size: 11,
97
- lineHeight: 16
98
- }
99
- };
100
- const getLineHeight = fontCode => headingSizesImport[fontCode].lineHeight / headingSizesImport[fontCode].size;
101
- const headingSizes = {
102
- h1: {
103
- lineHeight: getLineHeight('h700')
104
- },
105
- h2: {
106
- lineHeight: getLineHeight('h600')
107
- },
108
- h3: {
109
- lineHeight: getLineHeight('h500')
110
- },
111
- h4: {
112
- lineHeight: getLineHeight('h400')
113
- },
114
- h5: {
115
- lineHeight: getLineHeight('h300')
116
- },
117
- h6: {
118
- lineHeight: getLineHeight('h100')
119
- }
120
- };
121
- const headingAnchorStyle = headingTag => css`
122
- /**
123
- * The copy link button doesn't reserve space in the DOM so that
124
- * the text alignment isn't impacted by the button/icon's space.
125
- */
126
- .${HeadingAnchorWrapperClassName} {
127
- position: absolute;
128
- height: ${headingSizes[headingTag].lineHeight}em;
129
-
130
- margin-left: ${"var(--ds-space-075, 6px)"};
131
-
132
- button {
133
- padding-left: 0;
134
- padding-right: 0;
135
- }
136
- }
137
-
138
- /**
139
- * Applies hover effects to the heading anchor link button
140
- * to fade in when the user rolls over the heading.
141
- *
142
- * The link is persistent on mobile, so we use feature detection
143
- * to enable hover effects for systems that support it (desktop).
144
- *
145
- * @see https://caniuse.com/mdn-css_at-rules_media_hover
146
- */
147
- @media (hover: hover) and (pointer: fine) {
148
- .${HeadingAnchorWrapperClassName} {
149
- > button {
150
- opacity: 0;
151
- transform: translate(-8px, 0px);
152
- transition:
153
- opacity 0.2s ease 0s,
154
- transform 0.2s ease 0s;
155
- }
156
- }
157
-
158
- &:hover {
159
- .${HeadingAnchorWrapperClassName} > button {
160
- opacity: 1;
161
- transform: none !important;
162
- }
163
- }
164
- }
165
-
166
- /**
167
- * Adds the visibility of the button when in focus through keyboard navigation.
168
- */
169
- .${HeadingAnchorWrapperClassName} {
170
- button:focus {
171
- opacity: 1;
172
- transform: none !important;
173
- }
174
- }
175
- `;
176
- const alignedHeadingAnchorStyle = ({
177
- allowNestedHeaderLinks
178
- }) => {
179
- if (!allowNestedHeaderLinks) {
180
- return '';
181
- }
182
- return css`
183
- .fabric-editor-block-mark[data-align] > {
184
- h1,
185
- h2,
186
- h3,
187
- h4,
188
- h5,
189
- h6 {
190
- position: relative;
191
- }
192
- }
193
-
194
- /**
195
- * For right-alignment we flip the link to be before the heading
196
- * text so that the text is flush up against the edge of the editor's
197
- * container edge.
198
- */
199
- .fabric-editor-block-mark:not([data-align='center'])[data-align] {
200
- .${HeadingAnchorWrapperClassName} {
201
- margin: 0 ${"var(--ds-space-075, 6px)"} 0 0;
202
- // If the anchor is right aligned then the left side of the heading
203
- // is aligned with the left side of the anchor.
204
- // In order to align as expected we transform it the width of the element (plus our expected 6px)
205
- // to the left
206
- transform: translateX(calc(-100% - ${"var(--ds-space-075, 6px)"}));
207
- }
208
-
209
- @media (hover: hover) and (pointer: fine) {
210
- .${HeadingAnchorWrapperClassName} > button {
211
- transform: translate(8px, 0px);
212
- }
213
- }
214
- }
215
- `;
216
- };
217
- const tableSortableColumnStyle = ({
218
- allowColumnSorting,
219
- allowNestedHeaderLinks
220
- }) => {
221
- if (!allowColumnSorting) {
222
- return '';
223
- }
224
- let headingsCss = '';
225
- if (allowNestedHeaderLinks) {
226
- headingsCss = `
227
- /**
228
- * When the sort button is enabled we want the heading's copy link button
229
- * to reserve space so that it can prematurely wrap to avoid the button
230
- * being displayed underneath the sort button (hidden or obscured).
231
- *
232
- * The two buttons fight each other since the sort button is displayed
233
- * on hover of the <th /> and the copy link button is displayed on hover
234
- * of the heading.
235
- *
236
- * Note that this can break the WYSIWYG experience in the case where
237
- * a heading fills the width of the table cell and the only thing which
238
- * wraps is the copy link button. This is hopefully a rare fringe case.
239
- */
240
- .${HeadingAnchorWrapperClassName} {
241
- position: unset;
242
- }
243
- > {
244
- h1, h2, h3, h4, h5, h6 {
245
- margin-right: 30px;
246
- }
247
- }
248
- `;
249
- }
250
- return css`
251
- .${RendererCssClassName.SORTABLE_COLUMN_WRAPPER} {
252
- padding: 0;
253
-
254
- .${RendererCssClassName.SORTABLE_COLUMN} {
255
- width: 100%;
256
- height: 100%;
257
- padding: ${tableCellPadding}px;
258
- border-width: 1.5px;
259
- border-style: solid;
260
- border-color: transparent;
261
-
262
- > *:first-child {
263
- margin-top: 0;
264
- }
265
-
266
- > .ProseMirror-gapcursor:first-child + *,
267
- > style:first-child + .ProseMirror-gapcursor + * {
268
- margin-top: 0;
269
- }
270
-
271
- > .ProseMirror-gapcursor:first-child + span + *,
272
- > style:first-child + .ProseMirror-gapcursor + span + * {
273
- margin-top: 0;
274
- }
275
-
276
- @supports selector(:focus-visible) {
277
- &:focus {
278
- outline: unset;
279
- }
280
- &:focus-visible {
281
- border-color: ${`var(--ds-border-focused, ${colors.B300})`};
282
- }
283
- }
284
-
285
- ${headingsCss}
286
- }
287
-
288
- ${css`
289
- // New styles
290
- > .${RendererCssClassName.SORTABLE_COLUMN}
291
- > .${RendererCssClassName.SORTABLE_COLUMN_ICON_WRAPPER} {
292
- margin: 0;
293
-
294
- .${SORTABLE_COLUMN_ICON_CLASSNAME} {
295
- opacity: 1;
296
- transition: opacity 0.2s ease-in-out;
297
- }
298
- }
299
-
300
- > .${RendererCssClassName.SORTABLE_COLUMN}
301
- > .${RendererCssClassName.SORTABLE_COLUMN_NO_ORDER} {
302
- .${SORTABLE_COLUMN_ICON_CLASSNAME} {
303
- opacity: 0;
304
- &:focus {
305
- opacity: 1;
306
- }
307
- }
308
- }
309
-
310
- &:hover:not(
311
- :has(
312
- .${RendererCssClassName.SORTABLE_COLUMN_WRAPPER}
313
- .${RendererCssClassName.SORTABLE_COLUMN}:hover
314
- )
315
- )
316
- > .${RendererCssClassName.SORTABLE_COLUMN}
317
- > .${RendererCssClassName.SORTABLE_COLUMN_NO_ORDER} {
318
- .${SORTABLE_COLUMN_ICON_CLASSNAME} {
319
- opacity: 1;
320
- }
321
- }
322
- `}
323
- }
324
- `;
325
- };
326
- const fullPageStyles = ({
327
- appearance
328
- }, {
329
- theme
330
- }) => {
331
- if (appearance !== 'full-page') {
332
- return '';
333
- }
334
- return css`
335
- max-width: ${theme && theme.layoutMaxWidth ? `${theme.layoutMaxWidth}px` : 'none'};
336
- margin: 0 auto;
337
- padding: 0 ${appearance === 'full-page' ? FullPagePadding : 0}px;
338
- `;
339
- };
340
- const fullWidthStyles = ({
341
- appearance
342
- }) => {
343
- if (appearance !== 'full-width') {
344
- return '';
345
- }
346
- return css`
347
- max-width: ${akEditorFullWidthLayoutWidth}px;
348
- margin: 0 auto;
349
-
350
- /* don't override if the breakout mark has width attribute defined */
351
- .fabric-editor-breakout-mark:not([data-has-width='true']),
352
- .ak-renderer-extension {
353
- width: 100% !important;
354
- }
355
-
356
- ${isTableResizingEnabled(appearance) ? '' : `
357
- .pm-table-container {
358
- width: 100% !important;
359
- }
360
- `}
361
- `;
362
- };
363
- const breakoutWidthStyle = () => {
364
- return css`
365
- *:not([data-mark-type='fragment']) .${TableSharedCssClassName.TABLE_CONTAINER} {
366
- // Ignored via go/ees007
367
- // eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
368
- // TODO - improve inline style logic on table container so important styles aren't required here
369
- width: 100% !important;
370
- left: 0 !important;
371
- }
372
-
373
- [data-mark-type='fragment'] * .${TableSharedCssClassName.TABLE_CONTAINER} {
374
- // Ignored via go/ees007
375
- // eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
376
- // TODO - improve inline style logic on table container so important styles aren't required here
377
- width: 100% !important;
378
- left: 0 !important;
379
- }
380
- `;
381
- };
382
- const getShadowOverrides = () => {
383
- return css`
384
- /** Shadow overrides */
385
- &.${shadowClassNames.RIGHT_SHADOW}::after, &.${shadowClassNames.LEFT_SHADOW}::before {
386
- width: ${tableShadowWidth}px;
387
- background: linear-gradient(
388
- to left,
389
- transparent 0,
390
- ${`var(--ds-shadow-overflow-spread, ${N40A})`} 140%
391
- ),
392
- linear-gradient(
393
- to right,
394
- ${"var(--ds-shadow-overflow-perimeter, transparent)"} 0px,
395
- transparent 1px
396
- );
397
- }
398
-
399
- &.${shadowClassNames.RIGHT_SHADOW}::after {
400
- background: linear-gradient(
401
- to right,
402
- transparent 0,
403
- ${`var(--ds-shadow-overflow-spread, ${N40A})`} 140%
404
- ),
405
- linear-gradient(
406
- to left,
407
- ${"var(--ds-shadow-overflow-perimeter, transparent)"} 0px,
408
- transparent 1px
409
- );
410
- right: 0px;
411
- }
412
- `;
413
- };
414
- function getAnnotationStyles({
415
- allowAnnotations
416
- }) {
417
- if (!fg('editor_inline_comments_on_inline_nodes')) {
418
- return '';
419
- }
420
- if (fg('annotations_align_editor_and_renderer_styles')) {
421
- return css({
422
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
423
- '& [data-annotation-draft-mark][data-annotation-inline-node]': {
424
- borderBottom: '2px solid transparent',
425
- cursor: 'pointer',
426
- padding: '1px 0 2px',
427
- background: `var(--ds-background-accent-yellow-subtler, ${Y75})`,
428
- borderBottomColor: `var(--ds-border-accent-yellow, ${Y300})`,
429
- boxShadow: `var(--ds-shadow-overlay, ${`1px 2px 3px ${N60A}, -1px 2px 3px ${N60A}`})`
430
- },
431
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
432
- '& [data-annotation-draft-mark][data-annotation-inline-node][data-inline-card]': {
433
- padding: '5px 0 3px 0'
434
- },
435
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
436
- '& [data-annotation-draft-mark][data-annotation-inline-node].date-lozenger-container': {
437
- paddingTop: "var(--ds-space-025, 2px)"
438
- }
439
- });
440
- }
441
- return css({
442
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
443
- "& [data-mark-type='annotation'][data-mark-annotation-state='active'] [data-annotation-mark], & [data-annotation-draft-mark][data-annotation-inline-node]": {
444
- background: `var(--ds-background-accent-yellow-subtler, ${Y75})`,
445
- borderBottom: `2px solid ${`var(--ds-border-accent-yellow, ${Y300})`}`,
446
- boxShadow: `var(--ds-shadow-overlay, ${`1px 2px 3px ${N60A}, -1px 2px 3px ${N60A}`})`,
447
- cursor: 'pointer',
448
- padding: `${"var(--ds-space-050, 4px)"} ${"var(--ds-space-025, 2px)"}`
449
- }
450
- });
451
- }
452
- const tableRowHeight = 44;
453
- const stickyScrollbarStyles = `
454
- position: relative;
455
- flex-direction: column;
456
-
457
- > .${TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_CONTAINER} {
458
- width: 100%;
459
- display: block;
460
- visibility: hidden;
461
- overflow-x: auto;
462
- position: sticky;
463
- bottom: ${"var(--ds-space-0, 0px)"};
464
- z-index: 1;
465
- }
466
-
467
- > .${TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM},
468
- > .${TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP} {
469
- position: absolute;
470
- width: 100%;
471
- height: 1px;
472
- margin-top: -1px;
473
- // need this to avoid sentinel being focused via keyboard
474
- // this still allows it to be detected by intersection observer
475
- visibility: hidden;
476
- }
477
- > .${TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP} {
478
- top: ${tableRowHeight * 3}px;
479
- }
480
- > .${TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM} {
481
- bottom: ${"var(--ds-space-250, 20px)"}; // MAX_BROWSER_SCROLLBAR_HEIGHT = 20;
482
- }
483
- `;
484
-
485
- // Ignored via go/ees005
486
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
487
- export const rendererStyles = wrapperProps => theme => {
488
- const {
489
- typography
490
- } = getGlobalTheme();
491
- // This is required to be compatible with styled-components prop structure.
492
- const themeProps = {
493
- theme
494
- };
495
- const {
496
- useBlockRenderForCodeBlock,
497
- appearance
498
- } = wrapperProps;
499
- const isAdvancedLayoutsOn = editorExperiment('advanced_layouts', true);
500
-
501
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/design-system/no-css-tagged-template-expression
502
- return css`
503
- font-size: ${editorFontSize(themeProps)}px;
504
- line-height: 1.5rem;
505
- color: ${`var(--ds-text, ${colors.N800})`};
506
-
507
- .${RendererCssClassName.DOCUMENT}::after {
508
- // we add a clearfix after ak-renderer-document in order to
509
- // contain internal floats (such as media images that are "wrap-left")
510
- // to just the renderer (and not spill outside of it)
511
- content: '';
512
- visibility: hidden;
513
- display: block;
514
- height: 0;
515
- clear: both;
516
- }
517
-
518
- ${fullPageStyles(wrapperProps, themeProps)}
519
- ${fullWidthStyles(wrapperProps)}
520
-
521
- .${RendererCssClassName.DOCUMENT} {
522
- ${mediaInlineImageStyles}
523
- }
524
-
525
- & h1 {
526
- ${headingAnchorStyle('h1')}
527
- }
528
-
529
- & h2 {
530
- ${headingAnchorStyle('h2')}
531
- }
532
-
533
- & h3 {
534
- ${headingAnchorStyle('h3')}
535
- }
536
-
537
- & h4 {
538
- ${headingAnchorStyle('h4')}
539
- }
540
-
541
- & h5 {
542
- ${headingAnchorStyle('h5')}
543
- }
544
-
545
- & h6 {
546
- ${headingAnchorStyle('h6')}
547
- }
548
-
549
- & span.akActionMark {
550
- color: ${`var(--ds-link, ${colors.B400})`};
551
- text-decoration: none;
552
-
553
- &:hover {
554
- color: ${`var(--ds-link, ${colors.B300})`};
555
- text-decoration: underline;
556
- }
557
-
558
- &:active {
559
- color: ${`var(--ds-link-pressed, ${colors.B500})`};
560
- }
561
- }
562
-
563
- & span.akActionMark {
564
- cursor: pointer;
565
- }
566
-
567
- & span[data-placeholder] {
568
- color: ${`var(--ds-text-subtlest, ${colors.N200})`};
569
- }
570
-
571
- ${telepointerStyles}
572
- ${whitespaceSharedStyles};
573
- ${blockquoteSharedStyles};
574
- ${headingsSharedStyles(typography)};
575
- ${ruleSharedStyles()};
576
- ${paragraphSharedStyles(typography)};
577
- ${listsSharedStyles};
578
- ${indentationSharedStyles};
579
- ${blockMarksSharedStyles};
580
- ${codeMarkSharedStyles()};
581
- ${shadowSharedStyle};
582
- ${dateSharedStyle};
583
- ${textColorStyles};
584
- ${backgroundColorStyles()};
585
- ${tasksAndDecisionsStyles};
586
- ${fg('platform-linking-visual-refresh-v1') ? getSmartCardSharedStyles() : smartCardSharedStyles}
587
- ${getAnnotationStyles(wrapperProps)}
588
-
589
- & .UnknownBlock {
590
- font-family: ${"var(--ds-font-family-body, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)"};
591
- font-size: ${relativeFontSizeToBase16(14)};
592
- font-weight: ${"var(--ds-font-weight-regular, 400)"};
593
- white-space: pre-wrap;
594
- word-wrap: break-word;
595
- }
596
-
597
- & span.date-node {
598
- background: ${`var(--ds-background-neutral, ${colors.N30A})`};
599
- border-radius: ${"var(--ds-border-radius-100, 3px)"};
600
- color: ${`var(--ds-text, ${colors.N800})`};
601
- padding: ${"var(--ds-space-025, 2px)"} ${"var(--ds-space-050, 4px)"};
602
- margin: 0 1px;
603
- transition: background 0.3s;
604
- }
605
-
606
- & span.date-node-highlighted {
607
- background: ${`var(--ds-background-danger, ${colors.R50})`};
608
- color: ${`var(--ds-text-danger, ${colors.R500})`};
609
- }
610
-
611
- & .renderer-image {
612
- max-width: 100%;
613
- display: block;
614
- margin: ${"var(--ds-space-300, 24px)"} 0;
615
- }
616
-
617
- .${richMediaClassName}.rich-media-wrapped + .${richMediaClassName}:not(.rich-media-wrapped) {
618
- clear: both;
619
- }
620
-
621
- & .code-block,
622
- & blockquote,
623
- & hr,
624
- & > div > div:not(.rich-media-wrapped),
625
- .${richMediaClassName}.rich-media-wrapped + .rich-media-wrapped + *:not(.rich-media-wrapped),
626
- .${richMediaClassName}.rich-media-wrapped + div:not(.rich-media-wrapped),
627
- .${richMediaClassName}.image-align-start,
628
- .${richMediaClassName}.image-center,
629
- .${richMediaClassName}.image-align-end {
630
- clear: both;
631
- }
632
-
633
- & .rich-media-wrapped {
634
- & + h1,
635
- & + h2,
636
- & + h3,
637
- & + h4,
638
- & + h5,
639
- & + h6 {
640
- margin-top: ${"var(--ds-space-100, 8px)"};
641
- }
642
- }
643
-
644
- ${alignedHeadingAnchorStyle(wrapperProps)}
645
- /* plugin styles */
646
- ${mediaSingleSharedStyle} &
647
- div[class^='image-wrap-'] + div[class^='image-wrap-'] {
648
- margin-left: 0;
649
- margin-right: 0;
650
- }
651
-
652
- /* Breakout for tables and extensions */
653
- .${RendererCssClassName.DOCUMENT} > {
654
- ${breakoutWidthStyle()}
655
-
656
- * .${RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER} {
657
- overflow-x: auto;
658
- }
659
-
660
- & .${RendererCssClassName.EXTENSION}:first-child {
661
- margin-top: 0;
662
- }
663
- }
664
-
665
- .${RendererCssClassName.DOCUMENT} {
666
- .${RendererCssClassName.EXTENSION} {
667
- margin-top: ${blockNodesVerticalMargin};
668
- }
669
-
670
- .${RendererCssClassName.EXTENSION_CENTER_ALIGN} {
671
- margin-left: 50%;
672
- transform: translateX(-50%);
673
- }
674
-
675
- .${TableSharedCssClassName.TABLE_NODE_WRAPPER} {
676
- overflow-x: auto;
677
- }
678
-
679
- .${shadowObserverClassNames.SHADOW_CONTAINER} .${TableSharedCssClassName.TABLE_NODE_WRAPPER} {
680
- display: flex;
681
- }
682
- }
683
-
684
- ${tableSharedStyle()}
685
-
686
- .${RendererCssClassName.DOCUMENT} .${TableSharedCssClassName.TABLE_CONTAINER} {
687
- z-index: 0;
688
- transition: all 0.1s linear;
689
- display: flex; /* needed to avoid position: fixed jumpiness in Chrome */
690
-
691
- /** Shadow overrides */
692
- &.${shadowClassNames.RIGHT_SHADOW}::after, &.${shadowClassNames.LEFT_SHADOW}::before {
693
- top: ${tableMarginTop - 1}px;
694
- height: calc(100% - ${tableMarginTop}px);
695
- z-index: ${akEditorStickyHeaderZIndex};
696
- }
697
-
698
- ${getShadowOverrides()}
699
-
700
- ${isStickyScrollbarEnabled(appearance) ? stickyScrollbarStyles : ''}
701
-
702
- &
703
- .${shadowObserverClassNames.SENTINEL_LEFT},
704
- &
705
- .${shadowObserverClassNames.SENTINEL_RIGHT} {
706
- height: calc(100% - ${tableMarginTop}px);
707
- }
708
-
709
- /**
710
- * A hack for making all the <th /> heights equal in case some have shorter
711
- * content than others.
712
- *
713
- * This is done to make sort buttons fill entire <th />.
714
- */
715
- ${fg('platform_editor_renderer_table_header_styles') ? `.${TableSharedCssClassName.TABLE_NODE_WRAPPER} > table, .${TableSharedCssClassName.TABLE_STICKY_WRAPPER} > table` : 'table'} {
716
- height: 1px; /* will be ignored */
717
- ${tableSortableColumnStyle(wrapperProps)};
718
- margin-left: 0;
719
- margin-right: 0;
720
- }
721
-
722
- ${fg('platform_editor_renderer_table_header_styles') ? `.${TableSharedCssClassName.TABLE_NODE_WRAPPER} > table > tbody > tr:first-of-type, .${TableSharedCssClassName.TABLE_STICKY_WRAPPER} > table > tbody > tr:first-of-type` : 'table tr:first-of-type'} {
723
- height: 100%;
724
-
725
- td,
726
- th {
727
- position: relative;
728
- }
729
- }
730
-
731
- table[data-number-column='true'] {
732
- .${RendererCssClassName.NUMBER_COLUMN} {
733
- background-color: ${fg('platform_editor_tables_numbered_column_correction') ? "var(--ds-background-accent-gray-subtlest, #F1F2F4)" : `var(--ds-background-neutral, ${akEditorTableToolbar})`};
734
- border-right: 1px solid
735
- ${`var(--ds-background-accent-gray-subtler, ${akEditorTableBorder})`};
736
- width: ${akEditorTableNumberColumnWidth}px;
737
- text-align: center;
738
- color: ${`var(--ds-text-subtlest, ${colors.N200})`};
739
- font-size: ${relativeFontSizeToBase16(14)};
740
- }
741
-
742
- .fixed .${RendererCssClassName.NUMBER_COLUMN} {
743
- border-right: 0px none;
744
- }
745
- }
746
- }
747
-
748
- tr[data-header-row].fixed {
749
- position: fixed !important;
750
- display: flex;
751
- overflow: hidden;
752
- z-index: ${akEditorStickyHeaderZIndex};
753
-
754
- border-right: 1px solid ${`var(--ds-background-accent-gray-subtler, ${akEditorTableBorder})`};
755
- border-bottom: 1px solid ${`var(--ds-background-accent-gray-subtler, ${akEditorTableBorder})`};
756
-
757
- /* this is to compensate for the table border */
758
- transform: translateX(-1px);
759
- }
760
-
761
- .sticky > th {
762
- z-index: ${akEditorStickyHeaderZIndex};
763
- position: sticky !important;
764
- top: 0;
765
- }
766
-
767
- /* Make the number column header sticky */
768
- .sticky > td {
769
- position: sticky !important;
770
- top: 0;
771
- }
772
-
773
- /* add border for position: sticky
774
- and work around background-clip: padding-box
775
- bug for FF causing box-shadow bug in Chrome */
776
- .sticky th,
777
- .sticky td {
778
- box-shadow:
779
- 0px 1px ${`var(--ds-background-accent-gray-subtler, ${akEditorTableBorder})`},
780
- 0px -0.5px ${`var(--ds-background-accent-gray-subtler, ${akEditorTableBorder})`},
781
- inset -1px 0px ${`var(--ds-background-accent-gray-subtler, ${akEditorTableToolbar})`},
782
- 0px -1px ${`var(--ds-background-accent-gray-subtler, ${akEditorTableToolbar})`};
783
- }
784
-
785
- /* this will remove jumpiness caused in Chrome for sticky headers */
786
- .fixed + tr {
787
- min-height: 0px;
788
- }
789
-
790
- /*
791
- * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.
792
- * See ED-4159.
793
- */
794
- & .code-block {
795
- max-width: 100%;
796
- /* -ms- properties are necessary until MS supports the latest version of the grid spec */
797
- /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */
798
- display: block;
799
- /* stylelint-enable */
800
-
801
- position: relative;
802
- border-radius: ${"var(--ds-border-radius-100, 3px)"};
803
-
804
- /*
805
- * The overall renderer has word-wrap: break; which causes issues with
806
- * code block line numbers in Safari / iOS.
807
- */
808
- word-wrap: normal;
809
- }
810
-
811
- & .MediaGroup,
812
- & .code-block {
813
- margin-top: ${blockNodesVerticalMargin};
814
-
815
- &:first-child {
816
- margin-top: 0;
817
- }
818
- }
819
-
820
- ${useGridRenderForCodeBlock(useBlockRenderForCodeBlock)}
821
-
822
- ${getLightWeightCodeBlockStylesForRootRendererStyleSheet()}
823
-
824
- ${isAdvancedLayoutsOn ? columnLayoutResponsiveSharedStyle : columnLayoutSharedStyle};
825
- ${isAdvancedLayoutsOn && columnLayoutResponsiveRendererStyles};
826
- & [data-layout-section] {
827
- margin-top: ${"var(--ds-space-250, 20px)"};
828
- & > div + div {
829
- margin-left: ${isAdvancedLayoutsOn ? 0 : "var(--ds-space-400, 32px)"};
830
- }
831
-
832
- @media screen and (max-width: ${gridMediumMaxWidth}px) {
833
- & > div + div {
834
- margin-left: 0;
835
- }
836
- }
837
-
838
- & .MediaGroup,
839
- & .code-block {
840
- margin-top: ${blockNodesVerticalMargin};
841
-
842
- &:first-child {
843
- margin-top: 0;
844
- }
845
- }
846
- }
847
-
848
- & li {
849
- > .code-block {
850
- margin: ${blockNodesVerticalMargin} 0 0 0;
851
- }
852
- > .code-block:first-child {
853
- margin-top: 0;
854
- }
855
-
856
- > div:last-of-type.code-block {
857
- margin-bottom: ${blockNodesVerticalMargin};
858
- }
859
- }
860
-
861
- &:not([data-node-type='decisionList']) > li,
862
- // This prevents https://product-fabric.atlassian.net/browse/ED-20924
863
- &:not(.${SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER}) > li {
864
- ${browser.safari ? codeBlockInListSafariFix : ''}
865
- }
866
- `;
867
- };
868
- const useGridRenderForCodeBlock = codeBlockRenderAsBlock => {
869
- if (codeBlockRenderAsBlock) {
870
- return '';
871
- }
872
- return `& .code-block {
873
- /* -ms- properties are necessary until MS supports the latest version of the grid spec */
874
- /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */
875
- display: -ms-grid;
876
- display: grid;
877
- -ms-grid-columns: auto 1fr;
878
- /* stylelint-enable */
879
-
880
- grid-template-columns: minmax(0, 1fr);
881
-
882
- & > span {
883
- /* stylelint-disable value-no-vendor-prefix */
884
- -ms-grid-row: 1;
885
- -ms-grid-column: 2;
886
- /* stylelint-enable */
887
- grid-column: 1;
888
- }
889
- }`;
890
- };
2
+ export const TELEPOINTER_ID = 'ai-streaming-telepointer';