@atlaskit/renderer 92.0.1 → 93.0.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.
Files changed (125) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/dist/cjs/analytics/enums.js +1 -0
  3. package/dist/cjs/i18n/en.js +28 -0
  4. package/dist/cjs/i18n/en_GB.js +28 -0
  5. package/dist/cjs/i18n/pl.js +7 -1
  6. package/dist/cjs/i18n/pt_BR.js +1 -1
  7. package/dist/cjs/react/marks/alignment.js +11 -12
  8. package/dist/cjs/react/marks/breakout.js +7 -9
  9. package/dist/cjs/react/marks/link.js +13 -6
  10. package/dist/cjs/react/nodes/codeBlock.js +1 -1
  11. package/dist/cjs/react/nodes/codeBlockCopyButton.js +13 -11
  12. package/dist/cjs/react/nodes/embedCard.js +25 -33
  13. package/dist/cjs/react/nodes/heading-anchor.js +7 -6
  14. package/dist/cjs/react/nodes/mediaSingle/index.js +15 -4
  15. package/dist/cjs/react/nodes/mediaSingle/styles.js +7 -10
  16. package/dist/cjs/react/nodes/panel.js +36 -20
  17. package/dist/cjs/react/nodes/table/sticky.js +51 -54
  18. package/dist/cjs/react/nodes/table.js +2 -10
  19. package/dist/cjs/react/utils/performance/RenderTracking.js +52 -0
  20. package/dist/cjs/render-document.js +2 -2
  21. package/dist/cjs/text/index.js +2 -2
  22. package/dist/cjs/ui/Expand.js +40 -20
  23. package/dist/cjs/ui/MediaCard.js +4 -14
  24. package/dist/cjs/ui/Renderer/click-to-edit.js +4 -4
  25. package/dist/cjs/ui/Renderer/index.js +39 -50
  26. package/dist/cjs/ui/Renderer/style.js +58 -63
  27. package/dist/cjs/ui/Renderer/truncated-wrapper.js +19 -21
  28. package/dist/cjs/ui/SortingIcon.js +8 -9
  29. package/dist/cjs/ui/renderer-props.js +1 -3
  30. package/dist/cjs/utils.js +2 -2
  31. package/dist/cjs/version.json +1 -1
  32. package/dist/es2019/analytics/enums.js +1 -0
  33. package/dist/es2019/i18n/en.js +20 -0
  34. package/dist/es2019/i18n/en_GB.js +20 -0
  35. package/dist/es2019/i18n/pl.js +7 -1
  36. package/dist/es2019/i18n/pt_BR.js +1 -1
  37. package/dist/es2019/react/marks/alignment.js +15 -7
  38. package/dist/es2019/react/marks/breakout.js +6 -5
  39. package/dist/es2019/react/marks/link.js +8 -5
  40. package/dist/es2019/react/nodes/codeBlock.js +1 -1
  41. package/dist/es2019/react/nodes/codeBlockCopyButton.js +12 -9
  42. package/dist/es2019/react/nodes/embedCard.js +16 -16
  43. package/dist/es2019/react/nodes/heading-anchor.js +9 -6
  44. package/dist/es2019/react/nodes/mediaSingle/index.js +10 -6
  45. package/dist/es2019/react/nodes/mediaSingle/styles.js +6 -7
  46. package/dist/es2019/react/nodes/panel.js +38 -18
  47. package/dist/es2019/react/nodes/table/sticky.js +48 -41
  48. package/dist/es2019/react/nodes/table.js +2 -5
  49. package/dist/es2019/react/utils/performance/RenderTracking.js +37 -0
  50. package/dist/es2019/render-document.js +1 -1
  51. package/dist/es2019/text/index.js +1 -1
  52. package/dist/es2019/ui/Expand.js +52 -28
  53. package/dist/es2019/ui/MediaCard.js +3 -6
  54. package/dist/es2019/ui/Renderer/click-to-edit.js +1 -1
  55. package/dist/es2019/ui/Renderer/index.js +38 -43
  56. package/dist/es2019/ui/Renderer/style.js +363 -337
  57. package/dist/es2019/ui/Renderer/truncated-wrapper.js +26 -15
  58. package/dist/es2019/ui/SortingIcon.js +9 -7
  59. package/dist/es2019/ui/renderer-props.js +1 -1
  60. package/dist/es2019/utils.js +1 -1
  61. package/dist/es2019/version.json +1 -1
  62. package/dist/esm/analytics/enums.js +1 -0
  63. package/dist/esm/i18n/en.js +20 -0
  64. package/dist/esm/i18n/en_GB.js +20 -0
  65. package/dist/esm/i18n/pl.js +7 -1
  66. package/dist/esm/i18n/pt_BR.js +1 -1
  67. package/dist/esm/react/marks/alignment.js +13 -6
  68. package/dist/esm/react/marks/breakout.js +6 -5
  69. package/dist/esm/react/marks/link.js +7 -5
  70. package/dist/esm/react/nodes/codeBlock.js +1 -1
  71. package/dist/esm/react/nodes/codeBlockCopyButton.js +10 -7
  72. package/dist/esm/react/nodes/embedCard.js +19 -19
  73. package/dist/esm/react/nodes/heading-anchor.js +8 -6
  74. package/dist/esm/react/nodes/mediaSingle/index.js +11 -6
  75. package/dist/esm/react/nodes/mediaSingle/styles.js +5 -7
  76. package/dist/esm/react/nodes/panel.js +34 -17
  77. package/dist/esm/react/nodes/table/sticky.js +53 -52
  78. package/dist/esm/react/nodes/table.js +2 -8
  79. package/dist/esm/react/utils/performance/RenderTracking.js +39 -0
  80. package/dist/esm/render-document.js +1 -1
  81. package/dist/esm/text/index.js +1 -1
  82. package/dist/esm/ui/Expand.js +45 -21
  83. package/dist/esm/ui/MediaCard.js +3 -9
  84. package/dist/esm/ui/Renderer/click-to-edit.js +1 -1
  85. package/dist/esm/ui/Renderer/index.js +39 -47
  86. package/dist/esm/ui/Renderer/style.js +56 -57
  87. package/dist/esm/ui/Renderer/truncated-wrapper.js +20 -14
  88. package/dist/esm/ui/SortingIcon.js +9 -7
  89. package/dist/esm/ui/renderer-props.js +1 -1
  90. package/dist/esm/utils.js +1 -1
  91. package/dist/esm/version.json +1 -1
  92. package/dist/types/actions/index.d.ts +1 -4
  93. package/dist/types/analytics/enums.d.ts +1 -0
  94. package/dist/types/analytics/events.d.ts +7 -2
  95. package/dist/types/i18n/en.d.ts +20 -0
  96. package/dist/types/i18n/en_GB.d.ts +20 -0
  97. package/dist/types/i18n/pl.d.ts +6 -0
  98. package/dist/types/react/marks/alignment.d.ts +2 -2
  99. package/dist/types/react/marks/breakout.d.ts +4 -3
  100. package/dist/types/react/marks/link.d.ts +2 -2
  101. package/dist/types/react/nodes/copy-text-provider.d.ts +1 -1
  102. package/dist/types/react/nodes/embedCard.d.ts +3 -2
  103. package/dist/types/react/nodes/extension.d.ts +2 -2
  104. package/dist/types/react/nodes/fallback.d.ts +1 -1
  105. package/dist/types/react/nodes/heading-anchor.d.ts +1 -0
  106. package/dist/types/react/nodes/index.d.ts +20 -38
  107. package/dist/types/react/nodes/inlineCard.d.ts +20 -20
  108. package/dist/types/react/nodes/media.d.ts +1 -1
  109. package/dist/types/react/nodes/mediaGroup.d.ts +3 -3
  110. package/dist/types/react/nodes/mediaSingle/index.d.ts +1 -0
  111. package/dist/types/react/nodes/mediaSingle/styles.d.ts +2 -3
  112. package/dist/types/react/nodes/panel.d.ts +3 -1
  113. package/dist/types/react/nodes/table/sticky.d.ts +4 -2
  114. package/dist/types/react/nodes/table.d.ts +80 -80
  115. package/dist/types/react/utils/performance/RenderTracking.d.ts +15 -0
  116. package/dist/types/ui/Expand.d.ts +2 -2
  117. package/dist/types/ui/MediaCard.d.ts +2 -4
  118. package/dist/types/ui/Renderer/index.d.ts +0 -25
  119. package/dist/types/ui/Renderer/style.d.ts +1 -4
  120. package/dist/types/ui/Renderer/truncated-wrapper.d.ts +3 -1
  121. package/dist/types/ui/SmartCardStorage.d.ts +21 -20
  122. package/dist/types/ui/SortingIcon.d.ts +8 -6
  123. package/dist/types/ui/renderer-props.d.ts +14 -2
  124. package/dist/types/utils.d.ts +1 -1
  125. package/package.json +23 -25
@@ -1,10 +1,9 @@
1
- import styled, { css as deprecatedCss } from 'styled-components';
2
1
  import { css } from '@emotion/react';
3
2
  import { themed } from '@atlaskit/theme/components';
4
3
  import { gridSize, fontFamily, fontSize, borderRadius } from '@atlaskit/theme/constants';
5
4
  import * as colors from '@atlaskit/theme/colors';
6
5
  import { headingSizes as headingSizesImport } from '@atlaskit/theme/typography';
7
- import { tableSharedStyle, columnLayoutSharedStyle, blockquoteSharedStyles, headingsSharedStyles, panelSharedStyles, ruleSharedStyles, whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, mediaSingleSharedStyle, TableSharedCssClassName, tableMarginTop, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, richMediaClassName, tasksAndDecisionsStyles, smartCardSharedStyles, tableCellPadding, textColorStyles } from '@atlaskit/editor-common/styles';
6
+ import { tableSharedStyle, columnLayoutSharedStyle, blockquoteSharedStyles, headingsSharedStyles, ruleSharedStyles, whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, mediaSingleSharedStyle, TableSharedCssClassName, tableMarginTop, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, richMediaClassName, tasksAndDecisionsStyles, smartCardSharedStyles, tableCellPadding, textColorStyles } from '@atlaskit/editor-common/styles';
8
7
  import { shadowClassNames } from '@atlaskit/editor-common/ui';
9
8
  import { editorFontSize, blockNodesVerticalMargin, akEditorTableToolbar, akEditorTableToolbarDark, akEditorTableBorder, akEditorTableBorderDark, akEditorTableNumberColumnWidth, gridMediumMaxWidth, akEditorFullWidthLayoutWidth, akEditorStickyHeaderZIndex, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
10
9
  import { RendererCssClassName } from '../../consts';
@@ -34,7 +33,7 @@ export const headingSizes = {
34
33
  }
35
34
  };
36
35
 
37
- const headingAnchorStyle = headingTag => deprecatedCss`
36
+ const headingAnchorStyle = headingTag => css`
38
37
  /**
39
38
  * The copy link button doesn't reserve space in the DOM so that
40
39
  * the text alignment isn't impacted by the button/icon's space.
@@ -85,9 +84,14 @@ const alignedHeadingAnchorStyle = ({
85
84
  return '';
86
85
  }
87
86
 
88
- return `
87
+ return css`
89
88
  .fabric-editor-block-mark[data-align] > {
90
- h1, h2, h3, h4, h5, h6 {
89
+ h1,
90
+ h2,
91
+ h3,
92
+ h4,
93
+ h5,
94
+ h6 {
91
95
  position: relative;
92
96
  }
93
97
  }
@@ -98,41 +102,45 @@ const alignedHeadingAnchorStyle = ({
98
102
  * container edge.
99
103
  */
100
104
  .fabric-editor-block-mark:not([data-align='center'])[data-align] {
101
- > {
102
- h1, h2, h3, h4, h5, h6 {
103
- // Using right to left text to achieve the inverse effect
104
- // of where the copy link button icon sits for left/center
105
- // alignment.
106
- // Although this is unorthodox it's the only approach which
107
- // allows the button to sit flush against the left edge of
108
- // bottom line of text.
109
- direction: rtl;
110
-
111
- // By default RTL will negatively impact the layout of special
112
- // characters within the heading text, and potentially other
113
- // nested inline nodes. To prevent this we insert pseudo elements
114
- // containing HTML entities to retain LTR for all heading content
115
- // except for the copy link button.
116
- > *:not(.${HeadingAnchorWrapperClassName}):not(br) {
117
- ::before {
118
- // Open LTR: https://www.fileformat.info/info/unicode/char/202a/index.htm
119
- content: '\u202A';
120
- }
121
- ::after {
122
- // Close LTR: https://www.fileformat.info/info/unicode/char/202c/index.htm
123
- content: '\u202C';
124
- }
105
+ > {
106
+ h1,
107
+ h2,
108
+ h3,
109
+ h4,
110
+ h5,
111
+ h6 {
112
+ // Using right to left text to achieve the inverse effect
113
+ // of where the copy link button icon sits for left/center
114
+ // alignment.
115
+ // Although this is unorthodox it's the only approach which
116
+ // allows the button to sit flush against the left edge of
117
+ // bottom line of text.
118
+ direction: rtl;
119
+
120
+ // By default RTL will negatively impact the layout of special
121
+ // characters within the heading text, and potentially other
122
+ // nested inline nodes. To prevent this we insert pseudo elements
123
+ // containing HTML entities to retain LTR for all heading content
124
+ // except for the copy link button.
125
+ > *:not(.${HeadingAnchorWrapperClassName}):not(br) {
126
+ ::before {
127
+ // Open LTR: https://www.fileformat.info/info/unicode/char/202a/index.htm
128
+ content: '\u202A';
129
+ }
130
+ ::after {
131
+ // Close LTR: https://www.fileformat.info/info/unicode/char/202c/index.htm
132
+ content: '\u202C';
125
133
  }
126
134
  }
127
135
  }
128
- .${HeadingAnchorWrapperClassName} {
129
- margin: 0 6px 0 0;
130
- }
136
+ }
137
+ .${HeadingAnchorWrapperClassName} {
138
+ margin: 0 6px 0 0;
139
+ }
131
140
 
132
- @media (hover: hover) and (pointer: fine) {
133
- .${HeadingAnchorWrapperClassName} > button {
134
- transform: translate(8px, 0px);
135
- }
141
+ @media (hover: hover) and (pointer: fine) {
142
+ .${HeadingAnchorWrapperClassName} > button {
143
+ transform: translate(8px, 0px);
136
144
  }
137
145
  }
138
146
  }
@@ -175,7 +183,7 @@ const tableSortableColumnStyle = ({
175
183
  `;
176
184
  }
177
185
 
178
- return `
186
+ return css`
179
187
  .${RendererCssClassName.SORTABLE_COLUMN} {
180
188
  padding: 0;
181
189
 
@@ -212,7 +220,8 @@ const tableSortableColumnStyle = ({
212
220
  ${headingsCss}
213
221
  }
214
222
 
215
- &.${RendererCssClassName.SORTABLE_COLUMN_NOT_ALLOWED} .${RendererCssClassName.SORTABLE_COLUMN_BUTTON} {
223
+ &.${RendererCssClassName.SORTABLE_COLUMN_NOT_ALLOWED}
224
+ .${RendererCssClassName.SORTABLE_COLUMN_BUTTON} {
216
225
  cursor: default;
217
226
  }
218
227
 
@@ -236,14 +245,15 @@ const tableSortableColumnStyle = ({
236
245
  };
237
246
 
238
247
  const fullPageStyles = ({
239
- theme,
240
248
  appearance
249
+ }, {
250
+ theme
241
251
  }) => {
242
252
  if (appearance !== 'full-page' && appearance !== 'mobile') {
243
253
  return '';
244
254
  }
245
255
 
246
- return `
256
+ return css`
247
257
  max-width: ${theme && theme.layoutMaxWidth ? `${theme.layoutMaxWidth}px` : 'none'};
248
258
  margin: 0 auto;
249
259
  padding: 0 ${appearance === 'full-page' ? FullPagePadding : 0}px;
@@ -257,378 +267,394 @@ const fullWidthStyles = ({
257
267
  return '';
258
268
  }
259
269
 
260
- return `
261
- max-width: ${akEditorFullWidthLayoutWidth}px;
262
- margin: 0 auto;
270
+ return css`
271
+ max-width: ${akEditorFullWidthLayoutWidth}px;
272
+ margin: 0 auto;
263
273
 
264
- .fabric-editor-breakout-mark,
265
- .pm-table-container,
266
- .ak-renderer-extension {
267
- width: 100% !important;
268
- }
274
+ .fabric-editor-breakout-mark,
275
+ .pm-table-container,
276
+ .ak-renderer-extension {
277
+ width: 100% !important;
278
+ }
269
279
  `;
270
280
  };
271
281
 
272
- export const rendererStyles = theme => {
282
+ export const rendererStyles = wrapperProps => theme => {
273
283
  // This is required to be compatible with styled-components prop structure.
274
- const props = {
284
+ const themeProps = {
275
285
  theme
276
286
  };
277
287
  return css`
278
- ${tableSharedStyle(props)}
279
-
280
- ${whitespaceSharedStyles};
281
- ${blockquoteSharedStyles};
282
- ${headingsSharedStyles(props)};
283
-
284
- ${paragraphSharedStyles};
285
- ${listsSharedStyles};
286
- ${indentationSharedStyles};
287
- ${blockMarksSharedStyles};
288
- ${codeMarkSharedStyles(props)};
289
- ${shadowSharedStyle};
290
- ${dateSharedStyle};
291
- ${textColorStyles};
292
- ${tasksAndDecisionsStyles};
293
- ${smartCardSharedStyles}
294
-
295
- /* plugin styles*/
296
- ${mediaSingleSharedStyle} &
297
- div[class^='image-wrap-'] + div[class^='image-wrap-'] {
298
- margin-left: 0;
299
- margin-right: 0;
288
+ font-size: ${editorFontSize(themeProps)}px;
289
+ line-height: 1.5rem;
290
+ color: ${themed({
291
+ light: colors.N800,
292
+ dark: '#B8C7E0'
293
+ })(themeProps)};
294
+
295
+ .${RendererCssClassName.DOCUMENT}::after {
296
+ // we add a clearfix after ak-renderer-document in order to
297
+ // contain internal floats (such as media images that are "wrap-left")
298
+ // to just the renderer (and not spill outside of it)
299
+ content: '';
300
+ visibility: hidden;
301
+ display: block;
302
+ height: 0;
303
+ clear: both;
300
304
  }
301
305
 
302
- ${columnLayoutSharedStyle};
303
- `;
304
- }; // prettier-ignore
305
-
306
- export const DeprecatedWrapper = styled.div`
307
- font-size: ${editorFontSize}px;
308
- line-height: 1.5rem;
309
- color: ${themed({
310
- light: colors.N800,
311
- dark: '#B8C7E0'
312
- })};
313
-
314
- ${fullPageStyles}
315
- ${fullWidthStyles}
316
-
317
- & h1 {
318
- ${headingAnchorStyle('h1')}
319
- }
320
-
321
- & h2 {
322
- ${headingAnchorStyle('h2')}
323
- }
324
-
325
- & h3 {
326
- ${headingAnchorStyle('h3')}
327
- }
328
-
329
- & h4 {
330
- ${headingAnchorStyle('h4')}
331
- }
332
-
333
- & h5 {
334
- ${headingAnchorStyle('h5')}
335
- }
336
-
337
- & h6 {
338
- ${headingAnchorStyle('h6')}
339
- }
306
+ ${fullPageStyles(wrapperProps, themeProps)}
307
+ ${fullWidthStyles(wrapperProps)}
340
308
 
341
- & span.akActionMark {
342
- color: ${colors.B400};
343
- text-decoration: none;
309
+ & h1 {
310
+ ${headingAnchorStyle('h1')}
311
+ }
344
312
 
345
- &:hover {
346
- color: ${colors.B300};
347
- text-decoration: underline;
313
+ & h2 {
314
+ ${headingAnchorStyle('h2')}
348
315
  }
349
- }
350
316
 
351
- & span.akActionMark {
352
- cursor: pointer;
353
- }
317
+ & h3 {
318
+ ${headingAnchorStyle('h3')}
319
+ }
354
320
 
355
- & span[data-placeholder] {
356
- color: ${colors.placeholderText};
357
- }
321
+ & h4 {
322
+ ${headingAnchorStyle('h4')}
323
+ }
358
324
 
359
- ${panelSharedStyles};
360
- ${ruleSharedStyles};
325
+ & h5 {
326
+ ${headingAnchorStyle('h5')}
327
+ }
361
328
 
362
- & .UnknownBlock {
363
- font-family: ${fontFamily()};
364
- font-size: ${relativeFontSizeToBase16(fontSize())};
365
- font-weight: 400;
366
- white-space: pre-wrap;
367
- word-wrap: break-word;
368
- }
329
+ & h6 {
330
+ ${headingAnchorStyle('h6')}
331
+ }
369
332
 
370
- & span.date-node {
371
- background: ${themed({
372
- light: colors.N30A,
373
- dark: colors.DN70
374
- })};
375
- border-radius: ${borderRadius()}px;
376
- color: ${themed({
377
- light: colors.N800,
378
- dark: colors.DN600
379
- })};
380
- padding: 2px 4px;
381
- margin: 0 1px;
382
- transition: background 0.3s;
383
- }
333
+ & span.akActionMark {
334
+ color: ${colors.B400};
335
+ text-decoration: none;
384
336
 
385
- & span.date-node-highlighted {
386
- background: ${colors.R50};
387
- color: ${colors.R500};
388
- }
337
+ &:hover {
338
+ color: ${colors.B300};
339
+ text-decoration: underline;
340
+ }
341
+ }
389
342
 
390
- & .renderer-image {
391
- max-width: 100%;
392
- display: block;
393
- margin: ${gridSize() * 3}px 0;
394
- }
343
+ & span.akActionMark {
344
+ cursor: pointer;
345
+ }
395
346
 
396
- .${richMediaClassName}.rich-media-wrapped + .${richMediaClassName}:not(.rich-media-wrapped) {
397
- clear: both;
398
- }
347
+ & span[data-placeholder] {
348
+ color: ${colors.placeholderText(themeProps)};
349
+ }
399
350
 
400
- & .code-block,
401
- & blockquote,
402
- & hr,
403
- & > div > div:not(.rich-media-wrapped),
404
- .${richMediaClassName}.rich-media-wrapped + .rich-media-wrapped + *:not(.rich-media-wrapped),
405
- .${richMediaClassName}.rich-media-wrapped + div:not(.rich-media-wrapped),
406
- .${richMediaClassName}.image-align-start,
407
- .${richMediaClassName}.image-center,
408
- .${richMediaClassName}.image-align-end {
409
- clear: both;
410
- }
351
+ ${whitespaceSharedStyles};
352
+ ${blockquoteSharedStyles};
353
+ ${headingsSharedStyles(themeProps)};
354
+ ${ruleSharedStyles(themeProps)};
355
+ ${paragraphSharedStyles};
356
+ ${listsSharedStyles};
357
+ ${indentationSharedStyles};
358
+ ${blockMarksSharedStyles};
359
+ ${codeMarkSharedStyles(themeProps)};
360
+ ${shadowSharedStyle};
361
+ ${dateSharedStyle};
362
+ ${textColorStyles};
363
+ ${tasksAndDecisionsStyles};
364
+ ${smartCardSharedStyles}
411
365
 
412
- & .rich-media-wrapped {
413
- & + h1,
414
- & + h2,
415
- & + h3,
416
- & + h4,
417
- & + h5,
418
- & + h6 {
419
- margin-top: 8px;
366
+ & .UnknownBlock {
367
+ font-family: ${fontFamily()};
368
+ font-size: ${relativeFontSizeToBase16(fontSize())};
369
+ font-weight: 400;
370
+ white-space: pre-wrap;
371
+ word-wrap: break-word;
420
372
  }
421
- }
422
373
 
423
- ${alignedHeadingAnchorStyle}
374
+ & span.date-node {
375
+ background: ${themed({
376
+ light: colors.N30A,
377
+ dark: colors.DN70
378
+ })(themeProps)};
379
+ border-radius: ${borderRadius()}px;
380
+ color: ${themed({
381
+ light: colors.N800,
382
+ dark: colors.DN600
383
+ })(themeProps)};
384
+ padding: 2px 4px;
385
+ margin: 0 1px;
386
+ transition: background 0.3s;
387
+ }
424
388
 
389
+ & span.date-node-highlighted {
390
+ background: ${colors.R50};
391
+ color: ${colors.R500};
392
+ }
425
393
 
394
+ & .renderer-image {
395
+ max-width: 100%;
396
+ display: block;
397
+ margin: ${gridSize() * 3}px 0;
398
+ }
426
399
 
427
- /* Breakout for tables and extensions */
428
- .${RendererCssClassName.DOCUMENT} > {
429
- * .${TableSharedCssClassName.TABLE_CONTAINER} {
430
- width: 100% !important;
431
- left: 0 !important;
400
+ .${richMediaClassName}.rich-media-wrapped
401
+ + .${richMediaClassName}:not(.rich-media-wrapped) {
402
+ clear: both;
432
403
  }
433
404
 
434
- * .${RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER} {
435
- overflow-x: auto;
405
+ & .code-block,
406
+ & blockquote,
407
+ & hr,
408
+ & > div > div:not(.rich-media-wrapped),
409
+ .${richMediaClassName}.rich-media-wrapped
410
+ + .rich-media-wrapped
411
+ + *:not(.rich-media-wrapped),
412
+ .${richMediaClassName}.rich-media-wrapped + div:not(.rich-media-wrapped),
413
+ .${richMediaClassName}.image-align-start,
414
+ .${richMediaClassName}.image-center,
415
+ .${richMediaClassName}.image-align-end {
416
+ clear: both;
436
417
  }
437
418
 
438
- & .${RendererCssClassName.EXTENSION}:first-child {
439
- margin-top: 0;
419
+ & .rich-media-wrapped {
420
+ & + h1,
421
+ & + h2,
422
+ & + h3,
423
+ & + h4,
424
+ & + h5,
425
+ & + h6 {
426
+ margin-top: 8px;
427
+ }
440
428
  }
441
- }
442
429
 
443
- .${RendererCssClassName.EXTENSION} {
444
- margin-top: ${blockNodesVerticalMargin};
445
- }
430
+ ${alignedHeadingAnchorStyle(wrapperProps)}
431
+ /* plugin styles */
432
+ ${mediaSingleSharedStyle} &
433
+ div[class^='image-wrap-'] + div[class^='image-wrap-'] {
434
+ margin-left: 0;
435
+ margin-right: 0;
436
+ }
446
437
 
447
- .${RendererCssClassName.EXTENSION_CENTER_ALIGN} {
448
- margin-left: 50%;
449
- transform: translateX(-50%);
450
- }
438
+ /* Breakout for tables and extensions */
439
+ .${RendererCssClassName.DOCUMENT} > {
440
+ * .${TableSharedCssClassName.TABLE_CONTAINER} {
441
+ width: 100% !important;
442
+ left: 0 !important;
443
+ }
451
444
 
452
- .${TableSharedCssClassName.TABLE_NODE_WRAPPER} {
453
- overflow-x: auto;
454
- }
445
+ * .${RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER} {
446
+ overflow-x: auto;
447
+ }
455
448
 
449
+ & .${RendererCssClassName.EXTENSION}:first-child {
450
+ margin-top: 0;
451
+ }
452
+ }
456
453
 
454
+ .${RendererCssClassName.DOCUMENT} {
455
+ .${RendererCssClassName.EXTENSION} {
456
+ margin-top: ${blockNodesVerticalMargin};
457
+ }
457
458
 
458
- .${TableSharedCssClassName.TABLE_CONTAINER} {
459
- z-index: 0;
460
- transition: all 0.1s linear;
461
- display: flex; /* needed to avoid position: fixed jumpiness in Chrome */
459
+ .${RendererCssClassName.EXTENSION_CENTER_ALIGN} {
460
+ margin-left: 50%;
461
+ transform: translateX(-50%);
462
+ }
462
463
 
463
- /** Shadow overrides */
464
- &.${shadowClassNames.RIGHT_SHADOW}::after, &.${shadowClassNames.LEFT_SHADOW}::before {
465
- top: ${tableMarginTop - 1}px;
466
- height: calc(100% - ${tableMarginTop}px);
467
- z-index: ${akEditorStickyHeaderZIndex};
464
+ .${TableSharedCssClassName.TABLE_NODE_WRAPPER} {
465
+ overflow-x: auto;
466
+ }
468
467
  }
469
468
 
470
- /**
469
+ ${tableSharedStyle(themeProps)}
470
+
471
+ .${RendererCssClassName.DOCUMENT} .${TableSharedCssClassName.TABLE_CONTAINER} {
472
+ z-index: 0;
473
+ transition: all 0.1s linear;
474
+ display: flex; /* needed to avoid position: fixed jumpiness in Chrome */
475
+
476
+ /** Shadow overrides */
477
+ &.${shadowClassNames.RIGHT_SHADOW}::after,
478
+ &.${shadowClassNames.LEFT_SHADOW}::before {
479
+ top: ${tableMarginTop - 1}px;
480
+ height: calc(100% - ${tableMarginTop}px);
481
+ z-index: ${akEditorStickyHeaderZIndex};
482
+ }
483
+
484
+ /**
471
485
  * A hack for making all the <th /> heights equal in case some have shorter
472
486
  * content than others.
473
487
  *
474
488
  * This is done to make sort buttons fill entire <th />.
475
489
  */
476
- table {
477
- height: 1px; /* will be ignored */
478
- ${tableSortableColumnStyle};
479
- margin-left: 0;
480
- margin-right: 0;
481
- }
490
+ table {
491
+ height: 1px; /* will be ignored */
492
+ ${tableSortableColumnStyle(wrapperProps)};
493
+ margin-left: 0;
494
+ margin-right: 0;
495
+ }
482
496
 
483
- table tr:first-child {
484
- height: 100%;
497
+ table tr:first-child {
498
+ height: 100%;
485
499
 
486
- td, th {
487
- position: relative;
500
+ td,
501
+ th {
502
+ position: relative;
503
+ }
488
504
  }
489
- }
490
505
 
491
- table[data-number-column='true'] {
492
- .${RendererCssClassName.NUMBER_COLUMN} {
493
- background-color: ${themed({
494
- light: akEditorTableToolbar,
495
- dark: akEditorTableToolbarDark
496
- })};
497
- border-right: 1px solid ${themed({
498
- light: akEditorTableBorder,
499
- dark: akEditorTableBorderDark
500
- })};
501
- width: ${akEditorTableNumberColumnWidth}px;
502
- text-align: center;
503
- color: ${themed({
504
- light: colors.N200,
505
- dark: colors.DN400
506
- })};
507
- font-size: ${relativeFontSizeToBase16(fontSize())};
508
- }
506
+ table[data-number-column='true'] {
507
+ .${RendererCssClassName.NUMBER_COLUMN} {
508
+ background-color: ${themed({
509
+ light: akEditorTableToolbar,
510
+ dark: akEditorTableToolbarDark
511
+ })(themeProps)};
512
+ border-right: 1px solid
513
+ ${themed({
514
+ light: akEditorTableBorder,
515
+ dark: akEditorTableBorderDark
516
+ })(themeProps)};
517
+ width: ${akEditorTableNumberColumnWidth}px;
518
+ text-align: center;
519
+ color: ${themed({
520
+ light: colors.N200,
521
+ dark: colors.DN400
522
+ })(themeProps)};
523
+ font-size: ${relativeFontSizeToBase16(fontSize())};
524
+ }
509
525
 
510
- .fixed .${RendererCssClassName.NUMBER_COLUMN} {
511
- border-right: 0px none;
526
+ .fixed .${RendererCssClassName.NUMBER_COLUMN} {
527
+ border-right: 0px none;
528
+ }
512
529
  }
513
530
  }
514
- }
515
531
 
516
- tr[data-header-row].fixed {
517
- position: fixed !important;
518
- display: flex;
519
- overflow: hidden;
520
- z-index: ${akEditorStickyHeaderZIndex};
521
-
522
- border-right: 1px solid ${themed({
523
- light: akEditorTableBorder,
524
- dark: akEditorTableBorderDark
525
- })};
526
- border-bottom: 1px solid ${themed({
527
- light: akEditorTableBorder,
528
- dark: akEditorTableBorderDark
529
- })};
530
-
531
- /* this is to compensate for the table border */
532
- transform: translateX(-1px);
533
- }
532
+ tr[data-header-row].fixed {
533
+ position: fixed !important;
534
+ display: flex;
535
+ overflow: hidden;
536
+ z-index: ${akEditorStickyHeaderZIndex};
534
537
 
535
- .sticky > th {
536
- z-index: ${akEditorStickyHeaderZIndex};
537
- position: sticky !important;
538
- top: 0;
539
- }
538
+ border-right: 1px solid
539
+ ${themed({
540
+ light: akEditorTableBorder,
541
+ dark: akEditorTableBorderDark
542
+ })(themeProps)};
543
+ border-bottom: 1px solid
544
+ ${themed({
545
+ light: akEditorTableBorder,
546
+ dark: akEditorTableBorderDark
547
+ })(themeProps)};
548
+
549
+ /* this is to compensate for the table border */
550
+ transform: translateX(-1px);
551
+ }
540
552
 
541
- /* Make the number column header sticky */
542
- .sticky > td {
543
- position: sticky !important;
544
- top: 0;
545
- }
553
+ .sticky > th {
554
+ z-index: ${akEditorStickyHeaderZIndex};
555
+ position: sticky !important;
556
+ top: 0;
557
+ }
558
+
559
+ /* Make the number column header sticky */
560
+ .sticky > td {
561
+ position: sticky !important;
562
+ top: 0;
563
+ }
546
564
 
547
- /* add border for position: sticky
565
+ /* add border for position: sticky
548
566
  and work around background-clip: padding-box
549
567
  bug for FF causing box-shadow bug in Chrome */
550
- .sticky th, .sticky td {
551
- box-shadow: 0px 1px ${themed({
552
- light: akEditorTableBorder,
553
- dark: akEditorTableBorderDark
554
- })}, 0px -0.5px ${themed({
555
- light: akEditorTableBorder,
556
- dark: akEditorTableBorderDark
557
- })}, inset -1px 0px ${themed({
558
- light: akEditorTableToolbar,
559
- dark: akEditorTableToolbarDark
560
- })}, 0px -1px ${themed({
561
- light: akEditorTableToolbar,
562
- dark: akEditorTableToolbarDark
563
- })};
564
- }
568
+ .sticky th,
569
+ .sticky td {
570
+ box-shadow: 0px 1px
571
+ ${themed({
572
+ light: akEditorTableBorder,
573
+ dark: akEditorTableBorderDark
574
+ })(themeProps)},
575
+ 0px -0.5px ${themed({
576
+ light: akEditorTableBorder,
577
+ dark: akEditorTableBorderDark
578
+ })(themeProps)},
579
+ inset -1px 0px ${themed({
580
+ light: akEditorTableToolbar,
581
+ dark: akEditorTableToolbarDark
582
+ })(themeProps)},
583
+ 0px -1px ${themed({
584
+ light: akEditorTableToolbar,
585
+ dark: akEditorTableToolbarDark
586
+ })(themeProps)};
587
+ }
565
588
 
566
- /* this will remove jumpiness caused in Chrome for sticky headers */
567
- .fixed + tr {
568
- min-height: 0px;
569
- }
589
+ /* this will remove jumpiness caused in Chrome for sticky headers */
590
+ .fixed + tr {
591
+ min-height: 0px;
592
+ }
570
593
 
571
- /*
594
+ /*
572
595
  * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.
573
596
  * See ED-4159.
574
597
  */
575
- & .code-block {
576
- max-width: 100%;
577
- /* -ms- properties are necessary until MS supports the latest version of the grid spec */
578
- /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */
579
- display: -ms-grid;
580
- display: grid;
581
- -ms-grid-columns: auto 1fr;
582
- /* stylelint-enable */
583
-
584
- grid-template-columns: minmax(0, 1fr);
585
- position: relative;
586
- border-radius: ${borderRadius()}px;
598
+ & .code-block {
599
+ max-width: 100%;
600
+ /* -ms- properties are necessary until MS supports the latest version of the grid spec */
601
+ /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */
602
+ display: -ms-grid;
603
+ display: grid;
604
+ -ms-grid-columns: auto 1fr;
605
+ /* stylelint-enable */
587
606
 
588
- /*
607
+ grid-template-columns: minmax(0, 1fr);
608
+ position: relative;
609
+ border-radius: ${borderRadius()}px;
610
+
611
+ /*
589
612
  * The overall renderer has word-wrap: break; which causes issues with
590
613
  * code block line numbers in Safari / iOS.
591
614
  */
592
- word-wrap: normal;
593
-
594
- & > span {
595
- /* stylelint-disable value-no-vendor-prefix */
596
- -ms-grid-row: 1;
597
- -ms-grid-column: 2;
598
- /* stylelint-enable */
599
- grid-column: 1;
615
+ word-wrap: normal;
616
+
617
+ & > span {
618
+ /* stylelint-disable value-no-vendor-prefix */
619
+ -ms-grid-row: 1;
620
+ -ms-grid-column: 2;
621
+ /* stylelint-enable */
622
+ grid-column: 1;
623
+ }
600
624
  }
601
- }
602
625
 
603
- & .MediaGroup,
604
- & .code-block {
605
- margin-top: ${blockNodesVerticalMargin};
626
+ & .MediaGroup,
627
+ & .code-block {
628
+ margin-top: ${blockNodesVerticalMargin};
606
629
 
607
- &:first-child {
608
- margin-top: 0;
609
- }
610
-
611
- &:hover button.copy-to-clipboard, .copy-to-clipboard:focus{
612
- opacity: 1;
613
- position: absolute;
614
- height: 32px;
615
- width: 32px;
616
- right: 6px;
617
- top: 4px;
618
- padding: 2px;
619
- }
620
- }
630
+ &:first-child {
631
+ margin-top: 0;
632
+ }
621
633
 
622
- & [data-layout-section] {
623
- margin-top: ${gridSize() * 2.5}px;
624
- & > div + div {
625
- margin-left: ${gridSize() * 4}px;
634
+ &:hover button.copy-to-clipboard,
635
+ .copy-to-clipboard:focus {
636
+ opacity: 1;
637
+ position: absolute;
638
+ height: 32px;
639
+ width: 32px;
640
+ right: 6px;
641
+ top: 4px;
642
+ padding: 2px;
643
+ }
626
644
  }
627
645
 
628
- @media screen and (max-width: ${gridMediumMaxWidth}px) {
646
+ ${columnLayoutSharedStyle};
647
+ & [data-layout-section] {
648
+ margin-top: ${gridSize() * 2.5}px;
629
649
  & > div + div {
630
- margin-left: 0;
650
+ margin-left: ${gridSize() * 4}px;
651
+ }
652
+
653
+ @media screen and (max-width: ${gridMediumMaxWidth}px) {
654
+ & > div + div {
655
+ margin-left: 0;
656
+ }
631
657
  }
632
658
  }
633
- }
634
- `;
659
+ `;
660
+ };