@atlaskit/renderer 103.0.0 → 103.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 (230) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/cjs/consts.js +2 -2
  3. package/dist/cjs/messages.js +1 -1
  4. package/dist/cjs/react/nodes/panel.js +19 -10
  5. package/dist/cjs/react/nodes/tableCell.js +8 -26
  6. package/dist/cjs/ui/ExtensionRenderer.js +9 -2
  7. package/dist/cjs/ui/Renderer/index.js +1 -1
  8. package/dist/cjs/ui/Renderer/style.js +5 -3
  9. package/dist/cjs/ui/SortingIcon.js +55 -28
  10. package/dist/cjs/version.json +1 -1
  11. package/dist/es2019/consts.js +2 -2
  12. package/dist/es2019/messages.js +1 -1
  13. package/dist/es2019/react/nodes/panel.js +16 -6
  14. package/dist/es2019/react/nodes/tableCell.js +8 -27
  15. package/dist/es2019/ui/ExtensionRenderer.js +7 -2
  16. package/dist/es2019/ui/Renderer/index.js +1 -1
  17. package/dist/es2019/ui/Renderer/style.js +308 -287
  18. package/dist/es2019/ui/SortingIcon.js +89 -32
  19. package/dist/es2019/version.json +1 -1
  20. package/dist/esm/consts.js +2 -2
  21. package/dist/esm/messages.js +1 -1
  22. package/dist/esm/react/nodes/panel.js +18 -10
  23. package/dist/esm/react/nodes/tableCell.js +8 -26
  24. package/dist/esm/ui/ExtensionRenderer.js +9 -2
  25. package/dist/esm/ui/Renderer/index.js +1 -1
  26. package/dist/esm/ui/Renderer/style.js +5 -4
  27. package/dist/esm/ui/SortingIcon.js +55 -27
  28. package/dist/esm/version.json +1 -1
  29. package/dist/types/consts.d.ts +2 -2
  30. package/dist/types/react/nodes/bodiedExtension.d.ts +2 -1
  31. package/dist/types/react/nodes/extension.d.ts +2 -1
  32. package/dist/types/react/nodes/inlineExtension.d.ts +2 -0
  33. package/dist/types/ui/ExtensionRenderer.d.ts +2 -0
  34. package/dist/types/ui/SortingIcon.d.ts +4 -1
  35. package/package.json +19 -23
  36. package/report.api.md +359 -255
  37. package/dist/types-ts4.0/actions/index.d.ts +0 -61
  38. package/dist/types-ts4.0/actions/matches-utils.d.ts +0 -7
  39. package/dist/types-ts4.0/actions.d.ts +0 -3
  40. package/dist/types-ts4.0/analytics/analyticsContext.d.ts +0 -6
  41. package/dist/types-ts4.0/analytics/enums.d.ts +0 -56
  42. package/dist/types-ts4.0/analytics/events.d.ts +0 -110
  43. package/dist/types-ts4.0/analytics/unsupported-content.d.ts +0 -10
  44. package/dist/types-ts4.0/consts.d.ts +0 -12
  45. package/dist/types-ts4.0/i18n/cs.d.ts +0 -20
  46. package/dist/types-ts4.0/i18n/da.d.ts +0 -20
  47. package/dist/types-ts4.0/i18n/de.d.ts +0 -20
  48. package/dist/types-ts4.0/i18n/en.d.ts +0 -20
  49. package/dist/types-ts4.0/i18n/en_GB.d.ts +0 -20
  50. package/dist/types-ts4.0/i18n/en_ZZ.d.ts +0 -20
  51. package/dist/types-ts4.0/i18n/es.d.ts +0 -20
  52. package/dist/types-ts4.0/i18n/et.d.ts +0 -8
  53. package/dist/types-ts4.0/i18n/fi.d.ts +0 -20
  54. package/dist/types-ts4.0/i18n/fr.d.ts +0 -20
  55. package/dist/types-ts4.0/i18n/hu.d.ts +0 -20
  56. package/dist/types-ts4.0/i18n/index.d.ts +0 -31
  57. package/dist/types-ts4.0/i18n/it.d.ts +0 -20
  58. package/dist/types-ts4.0/i18n/ja.d.ts +0 -20
  59. package/dist/types-ts4.0/i18n/ko.d.ts +0 -20
  60. package/dist/types-ts4.0/i18n/nb.d.ts +0 -20
  61. package/dist/types-ts4.0/i18n/nl.d.ts +0 -20
  62. package/dist/types-ts4.0/i18n/pl.d.ts +0 -20
  63. package/dist/types-ts4.0/i18n/pt_BR.d.ts +0 -20
  64. package/dist/types-ts4.0/i18n/pt_PT.d.ts +0 -8
  65. package/dist/types-ts4.0/i18n/ru.d.ts +0 -20
  66. package/dist/types-ts4.0/i18n/sk.d.ts +0 -8
  67. package/dist/types-ts4.0/i18n/sv.d.ts +0 -20
  68. package/dist/types-ts4.0/i18n/th.d.ts +0 -20
  69. package/dist/types-ts4.0/i18n/tr.d.ts +0 -20
  70. package/dist/types-ts4.0/i18n/uk.d.ts +0 -20
  71. package/dist/types-ts4.0/i18n/vi.d.ts +0 -20
  72. package/dist/types-ts4.0/i18n/zh.d.ts +0 -20
  73. package/dist/types-ts4.0/i18n/zh_TW.d.ts +0 -20
  74. package/dist/types-ts4.0/index.d.ts +0 -11
  75. package/dist/types-ts4.0/messages.d.ts +0 -61
  76. package/dist/types-ts4.0/react/hooks/use-bidi-warnings.d.ts +0 -10
  77. package/dist/types-ts4.0/react/hooks/use-in-viewport.d.ts +0 -5
  78. package/dist/types-ts4.0/react/hooks/use-observed-width.d.ts +0 -3
  79. package/dist/types-ts4.0/react/index.d.ts +0 -118
  80. package/dist/types-ts4.0/react/marks/alignment.d.ts +0 -4
  81. package/dist/types-ts4.0/react/marks/annotation.d.ts +0 -6
  82. package/dist/types-ts4.0/react/marks/breakout.d.ts +0 -6
  83. package/dist/types-ts4.0/react/marks/code.d.ts +0 -16
  84. package/dist/types-ts4.0/react/marks/confluence-inline-comment.d.ts +0 -8
  85. package/dist/types-ts4.0/react/marks/data-consumer.d.ts +0 -4
  86. package/dist/types-ts4.0/react/marks/em.d.ts +0 -3
  87. package/dist/types-ts4.0/react/marks/fragment.d.ts +0 -4
  88. package/dist/types-ts4.0/react/marks/indentation.d.ts +0 -4
  89. package/dist/types-ts4.0/react/marks/index.d.ts +0 -21
  90. package/dist/types-ts4.0/react/marks/link.d.ts +0 -9
  91. package/dist/types-ts4.0/react/marks/strike.d.ts +0 -3
  92. package/dist/types-ts4.0/react/marks/strong.d.ts +0 -3
  93. package/dist/types-ts4.0/react/marks/subsup.d.ts +0 -4
  94. package/dist/types-ts4.0/react/marks/textColor.d.ts +0 -4
  95. package/dist/types-ts4.0/react/marks/underline.d.ts +0 -3
  96. package/dist/types-ts4.0/react/marks/unsupportedMark.d.ts +0 -3
  97. package/dist/types-ts4.0/react/marks/unsupportedNodeAttribute.d.ts +0 -3
  98. package/dist/types-ts4.0/react/nodes/blockCard.d.ts +0 -10
  99. package/dist/types-ts4.0/react/nodes/blockquote.d.ts +0 -2
  100. package/dist/types-ts4.0/react/nodes/bodiedExtension.d.ts +0 -23
  101. package/dist/types-ts4.0/react/nodes/bulletList.d.ts +0 -5
  102. package/dist/types-ts4.0/react/nodes/caption.d.ts +0 -4
  103. package/dist/types-ts4.0/react/nodes/codeBlock/codeBlock.d.ts +0 -14
  104. package/dist/types-ts4.0/react/nodes/codeBlock/components/codeBlockContainer.d.ts +0 -12
  105. package/dist/types-ts4.0/react/nodes/codeBlock/components/lightWeightCodeBlock.d.ts +0 -9
  106. package/dist/types-ts4.0/react/nodes/codeBlock/windowedCodeBlock.d.ts +0 -4
  107. package/dist/types-ts4.0/react/nodes/codeBlockCopyButton.d.ts +0 -9
  108. package/dist/types-ts4.0/react/nodes/date.d.ts +0 -11
  109. package/dist/types-ts4.0/react/nodes/decisionItem.d.ts +0 -3
  110. package/dist/types-ts4.0/react/nodes/decisionList.d.ts +0 -7
  111. package/dist/types-ts4.0/react/nodes/doc.d.ts +0 -3
  112. package/dist/types-ts4.0/react/nodes/embedCard.d.ts +0 -17
  113. package/dist/types-ts4.0/react/nodes/emoji.d.ts +0 -10
  114. package/dist/types-ts4.0/react/nodes/extension.d.ts +0 -112
  115. package/dist/types-ts4.0/react/nodes/fallback.d.ts +0 -16
  116. package/dist/types-ts4.0/react/nodes/hardBreak.d.ts +0 -6
  117. package/dist/types-ts4.0/react/nodes/heading-anchor.d.ts +0 -14
  118. package/dist/types-ts4.0/react/nodes/heading.d.ts +0 -14
  119. package/dist/types-ts4.0/react/nodes/index.d.ts +0 -94
  120. package/dist/types-ts4.0/react/nodes/inline.d.ts +0 -1
  121. package/dist/types-ts4.0/react/nodes/inlineCard.d.ts +0 -65
  122. package/dist/types-ts4.0/react/nodes/inlineExtension.d.ts +0 -16
  123. package/dist/types-ts4.0/react/nodes/layoutColumn.d.ts +0 -6
  124. package/dist/types-ts4.0/react/nodes/layoutSection.d.ts +0 -2
  125. package/dist/types-ts4.0/react/nodes/listItem.d.ts +0 -2
  126. package/dist/types-ts4.0/react/nodes/media.d.ts +0 -27
  127. package/dist/types-ts4.0/react/nodes/mediaGroup.d.ts +0 -29
  128. package/dist/types-ts4.0/react/nodes/mediaInline.d.ts +0 -20
  129. package/dist/types-ts4.0/react/nodes/mediaSingle/index.d.ts +0 -23
  130. package/dist/types-ts4.0/react/nodes/mediaSingle/styles.d.ts +0 -2
  131. package/dist/types-ts4.0/react/nodes/mention.d.ts +0 -13
  132. package/dist/types-ts4.0/react/nodes/orderedList.d.ts +0 -6
  133. package/dist/types-ts4.0/react/nodes/panel.d.ts +0 -17
  134. package/dist/types-ts4.0/react/nodes/paragraph.d.ts +0 -3
  135. package/dist/types-ts4.0/react/nodes/placeholder.d.ts +0 -6
  136. package/dist/types-ts4.0/react/nodes/rule.d.ts +0 -2
  137. package/dist/types-ts4.0/react/nodes/status.d.ts +0 -10
  138. package/dist/types-ts4.0/react/nodes/table/colgroup.d.ts +0 -3
  139. package/dist/types-ts4.0/react/nodes/table/sticky.d.ts +0 -38
  140. package/dist/types-ts4.0/react/nodes/table/table.d.ts +0 -7
  141. package/dist/types-ts4.0/react/nodes/table/types.d.ts +0 -7
  142. package/dist/types-ts4.0/react/nodes/table.d.ts +0 -269
  143. package/dist/types-ts4.0/react/nodes/tableCell.d.ts +0 -81
  144. package/dist/types-ts4.0/react/nodes/tableRow.d.ts +0 -24
  145. package/dist/types-ts4.0/react/nodes/task-item-with-providers.d.ts +0 -29
  146. package/dist/types-ts4.0/react/nodes/taskItem.d.ts +0 -19
  147. package/dist/types-ts4.0/react/nodes/taskList.d.ts +0 -8
  148. package/dist/types-ts4.0/react/nodes/text-wrapper.d.ts +0 -8
  149. package/dist/types-ts4.0/react/nodes/unknownBlock.d.ts +0 -2
  150. package/dist/types-ts4.0/react/renderer-node.d.ts +0 -4
  151. package/dist/types-ts4.0/react/types.d.ts +0 -57
  152. package/dist/types-ts4.0/react/utils/clipboard.d.ts +0 -1
  153. package/dist/types-ts4.0/react/utils/element-selection.d.ts +0 -9
  154. package/dist/types-ts4.0/react/utils/getCardClickHandler.d.ts +0 -2
  155. package/dist/types-ts4.0/react/utils/inject-props.d.ts +0 -6
  156. package/dist/types-ts4.0/react/utils/links.d.ts +0 -3
  157. package/dist/types-ts4.0/react/utils/lists.d.ts +0 -2
  158. package/dist/types-ts4.0/react/utils/performance/RenderTracking.d.ts +0 -15
  159. package/dist/types-ts4.0/react/utils/use-select-all-trap.d.ts +0 -2
  160. package/dist/types-ts4.0/render-document.d.ts +0 -23
  161. package/dist/types-ts4.0/renderer-context.d.ts +0 -9
  162. package/dist/types-ts4.0/serializer.d.ts +0 -4
  163. package/dist/types-ts4.0/steps/index.d.ts +0 -14
  164. package/dist/types-ts4.0/text/index.d.ts +0 -8
  165. package/dist/types-ts4.0/text/nodes/blockquote.d.ts +0 -3
  166. package/dist/types-ts4.0/text/nodes/bulletList.d.ts +0 -3
  167. package/dist/types-ts4.0/text/nodes/date.d.ts +0 -3
  168. package/dist/types-ts4.0/text/nodes/decisionItem.d.ts +0 -3
  169. package/dist/types-ts4.0/text/nodes/hardBreak.d.ts +0 -3
  170. package/dist/types-ts4.0/text/nodes/heading.d.ts +0 -3
  171. package/dist/types-ts4.0/text/nodes/index.d.ts +0 -6
  172. package/dist/types-ts4.0/text/nodes/inlineCard.d.ts +0 -3
  173. package/dist/types-ts4.0/text/nodes/listItem.d.ts +0 -3
  174. package/dist/types-ts4.0/text/nodes/mediaGroup.d.ts +0 -3
  175. package/dist/types-ts4.0/text/nodes/mention.d.ts +0 -3
  176. package/dist/types-ts4.0/text/nodes/orderedList.d.ts +0 -3
  177. package/dist/types-ts4.0/text/nodes/panel.d.ts +0 -3
  178. package/dist/types-ts4.0/text/nodes/paragraph.d.ts +0 -3
  179. package/dist/types-ts4.0/text/nodes/rule.d.ts +0 -3
  180. package/dist/types-ts4.0/text/nodes/status.d.ts +0 -3
  181. package/dist/types-ts4.0/text/nodes/table.d.ts +0 -3
  182. package/dist/types-ts4.0/text/nodes/taskItem.d.ts +0 -3
  183. package/dist/types-ts4.0/text/nodes/unknown.d.ts +0 -3
  184. package/dist/types-ts4.0/text-serializer.d.ts +0 -1
  185. package/dist/types-ts4.0/types/i18n.d.ts +0 -5
  186. package/dist/types-ts4.0/types/mediaOptions.d.ts +0 -12
  187. package/dist/types-ts4.0/types/smartLinksOptions.d.ts +0 -3
  188. package/dist/types-ts4.0/ui/Expand.d.ts +0 -21
  189. package/dist/types-ts4.0/ui/ExtensionRenderer.d.ts +0 -40
  190. package/dist/types-ts4.0/ui/MediaCard.d.ts +0 -77
  191. package/dist/types-ts4.0/ui/Renderer/ErrorBoundary.d.ts +0 -24
  192. package/dist/types-ts4.0/ui/Renderer/breakout-ssr.d.ts +0 -11
  193. package/dist/types-ts4.0/ui/Renderer/click-to-edit.d.ts +0 -6
  194. package/dist/types-ts4.0/ui/Renderer/index.d.ts +0 -33
  195. package/dist/types-ts4.0/ui/Renderer/style.d.ts +0 -14
  196. package/dist/types-ts4.0/ui/Renderer/truncated-wrapper.d.ts +0 -12
  197. package/dist/types-ts4.0/ui/Renderer/types.d.ts +0 -16
  198. package/dist/types-ts4.0/ui/RendererActionsContext/WithRendererActions.d.ts +0 -6
  199. package/dist/types-ts4.0/ui/RendererActionsContext/index.d.ts +0 -9
  200. package/dist/types-ts4.0/ui/SmartCardStorage.d.ts +0 -60
  201. package/dist/types-ts4.0/ui/SortingIcon.d.ts +0 -20
  202. package/dist/types-ts4.0/ui/TaskItemsFormatContext/TaskItemsFormatContext.d.ts +0 -15
  203. package/dist/types-ts4.0/ui/TaskItemsFormatContext/index.d.ts +0 -2
  204. package/dist/types-ts4.0/ui/active-header-id-provider.d.ts +0 -18
  205. package/dist/types-ts4.0/ui/annotations/context.d.ts +0 -27
  206. package/dist/types-ts4.0/ui/annotations/draft/component.d.ts +0 -20
  207. package/dist/types-ts4.0/ui/annotations/draft/dom.d.ts +0 -7
  208. package/dist/types-ts4.0/ui/annotations/draft/index.d.ts +0 -2
  209. package/dist/types-ts4.0/ui/annotations/draft/position.d.ts +0 -2
  210. package/dist/types-ts4.0/ui/annotations/draft/text.d.ts +0 -11
  211. package/dist/types-ts4.0/ui/annotations/element/index.d.ts +0 -10
  212. package/dist/types-ts4.0/ui/annotations/element/mark.d.ts +0 -14
  213. package/dist/types-ts4.0/ui/annotations/hooks/index.d.ts +0 -3
  214. package/dist/types-ts4.0/ui/annotations/hooks/use-events.d.ts +0 -18
  215. package/dist/types-ts4.0/ui/annotations/hooks/use-inline-comment-subscriber.d.ts +0 -1
  216. package/dist/types-ts4.0/ui/annotations/hooks/use-inline-comments-filter.d.ts +0 -9
  217. package/dist/types-ts4.0/ui/annotations/hooks/use-load-annotations.d.ts +0 -6
  218. package/dist/types-ts4.0/ui/annotations/hooks/user-selection.d.ts +0 -9
  219. package/dist/types-ts4.0/ui/annotations/hooks/utils.d.ts +0 -2
  220. package/dist/types-ts4.0/ui/annotations/index.d.ts +0 -5
  221. package/dist/types-ts4.0/ui/annotations/selection/index.d.ts +0 -1
  222. package/dist/types-ts4.0/ui/annotations/selection/mounter.d.ts +0 -20
  223. package/dist/types-ts4.0/ui/annotations/selection/range-validator.d.ts +0 -13
  224. package/dist/types-ts4.0/ui/annotations/selection/wrapper.d.ts +0 -8
  225. package/dist/types-ts4.0/ui/annotations/types.d.ts +0 -22
  226. package/dist/types-ts4.0/ui/annotations/view/index.d.ts +0 -7
  227. package/dist/types-ts4.0/ui/index.d.ts +0 -1
  228. package/dist/types-ts4.0/ui/renderer-props.d.ts +0 -100
  229. package/dist/types-ts4.0/use-feature-flags.d.ts +0 -2
  230. package/dist/types-ts4.0/utils.d.ts +0 -24
@@ -6,14 +6,9 @@ import { N20, N30 } from '@atlaskit/theme/colors';
6
6
  import { SortOrder } from '@atlaskit/editor-common/types';
7
7
  import { sortingIconMessages } from '../messages';
8
8
  import { injectIntl } from 'react-intl-next';
9
- import { token } from '@atlaskit/tokens'; // We use data url here because of this issue:
10
- // https://product-fabric.atlassian.net/browse/ED-8001
11
- // Remove this workaround if Firefox has fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=1664350
12
- // TODO: Quality ticket: https://product-fabric.atlassian.net/browse/DSP-4136
13
-
14
- export const TableSortIconDataUrl = `data:image/svg+xml;utf8,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="M-8-6h24v24H-8z"></path><path d="M3 8.509V1c0-.552.449-1 1-1 .552 0 1 .448 1 1V8.51l1.217-1.206a1.05 1.05 0 011.477 0 1.03 1.03 0 01.004 1.463l-.003.002-2.956 2.93a1.053 1.053 0 01-1.478 0L.305 8.767a1.03 1.03 0 01.001-1.464 1.05 1.05 0 011.477 0L3 8.508z" fill="#42526E"></path></g></svg>`)}`;
15
- const TABLE_SORTING_ICON_CLASS = 'table-sorting-icon';
16
- export let StatusClassNames; // TODO: get design to check border
9
+ import { token } from '@atlaskit/tokens';
10
+ import { RendererCssClassName } from '../consts';
11
+ export let StatusClassNames;
17
12
 
18
13
  (function (StatusClassNames) {
19
14
  StatusClassNames["ASC"] = "sorting-icon-svg__asc";
@@ -22,7 +17,7 @@ export let StatusClassNames; // TODO: get design to check border
22
17
  StatusClassNames["SORTING_NOT_ALLOWED"] = "sorting-icon-svg__not-allowed";
23
18
  })(StatusClassNames || (StatusClassNames = {}));
24
19
 
25
- const wrapperStyles = css`
20
+ const buttonStyles = css`
26
21
  position: absolute;
27
22
  display: flex;
28
23
  height: 28px;
@@ -30,50 +25,90 @@ const wrapperStyles = css`
30
25
  margin: 6px;
31
26
  right: 0;
32
27
  top: 0;
33
- border: 2px solid ${token('color.border.inverse', '#fff')};
28
+ border: 2px solid ${token('color.border', '#fff')};
34
29
  border-radius: ${gridSize() / 2}px;
35
- background-color: ${token('color.background.neutral.subtle', N20)};
30
+ background-color: ${token('elevation.surface.overlay', N20)};
36
31
  justify-content: center;
37
32
  align-items: center;
33
+ cursor: pointer;
38
34
 
39
35
  &:hover {
40
- background-color: ${token('color.background.neutral.subtle.hovered', N30)};
36
+ background-color: ${token('elevation.surface.overlay.hovered', N30)};
37
+ }
38
+
39
+ &:active {
40
+ background-color: ${token('elevation.surface.overlay.pressed', 'rgba(179, 212, 255, 0.6)')};
41
41
  }
42
42
 
43
- &.${StatusClassNames.SORTING_NOT_ALLOWED} {
43
+ &.${RendererCssClassName.SORTABLE_COLUMN_ICON}__not-allowed {
44
44
  cursor: not-allowed;
45
45
  }
46
46
  `;
47
- const tableSortingIconStyles = css`
47
+ const iconWrapperStyles = css`
48
48
  width: 8px;
49
49
  height: 12px;
50
50
  transition: transform 0.3s cubic-bezier(0.15, 1, 0.3, 1);
51
51
  transform-origin: 50% 50%;
52
- background-image: url(${TableSortIconDataUrl});
52
+ display: flex;
53
+ justify-content: center;
53
54
 
54
55
  &.${StatusClassNames.DESC} {
55
56
  transform: rotate(-180deg);
56
57
  }
57
58
 
58
- &.${TABLE_SORTING_ICON_CLASS}-inactive {
59
+ &.${RendererCssClassName.SORTABLE_COLUMN_ICON}-inactive {
59
60
  opacity: 0.7;
60
61
  }
62
+ `; // The icon is created with CSS due to the following Firefox issue: https://product-fabric.atlassian.net/browse/ED-8001
63
+ // The TL;DR is that svg's in tables mess up how HTML is copied in Firefox. Using a styled div instead solves the problem.
64
+ // For this reason, svg's should be avoided in tables until this issue is fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=1664350
65
+
66
+ const iconStyles = css`
67
+ height: 100%;
68
+ width: 2px;
69
+ border-radius: 50px;
70
+ background: ${token('color.icon', '#42526E')};
71
+
72
+ &::before,
73
+ &::after {
74
+ background: ${token('color.icon', '#42526E')};
75
+ content: '';
76
+ height: 2px;
77
+ width: 6px;
78
+ position: absolute;
79
+ border-radius: 50px;
80
+ }
81
+
82
+ &::before {
83
+ transform: rotate(45deg) translate(3.4px, 8.5px);
84
+ }
85
+
86
+ &::after {
87
+ transform: rotate(-45deg) translate(-6.3px, 5.7px);
88
+ }
61
89
  `;
62
90
 
63
- const getClassName = status => {
64
- switch (status) {
91
+ const getIconClassName = (isSortingAllowed, sortOrdered) => {
92
+ const activated = sortOrdered !== SortOrder.NO_ORDER;
93
+ const activeStatusClass = `${RendererCssClassName.SORTABLE_COLUMN_ICON}-${activated ? 'active' : 'inactive'}`;
94
+
95
+ if (!isSortingAllowed) {
96
+ return `${StatusClassNames.SORTING_NOT_ALLOWED} ${activeStatusClass}`;
97
+ }
98
+
99
+ switch (sortOrdered) {
65
100
  case SortOrder.ASC:
66
- return StatusClassNames.ASC;
101
+ return `${StatusClassNames.ASC} ${activeStatusClass}`;
67
102
 
68
103
  case SortOrder.DESC:
69
- return StatusClassNames.DESC;
104
+ return `${StatusClassNames.DESC} ${activeStatusClass}`;
70
105
 
71
106
  default:
72
- return StatusClassNames.NO_ORDER;
107
+ return `${StatusClassNames.NO_ORDER} ${activeStatusClass}`;
73
108
  }
74
109
  };
75
110
 
76
- const getTooltipTitle = (intl, isSortingAllowed, status) => {
111
+ const getTooltipTitle = (intl, isSortingAllowed, sortOrdered) => {
77
112
  const {
78
113
  noOrderLabel,
79
114
  ascOrderLabel,
@@ -85,7 +120,7 @@ const getTooltipTitle = (intl, isSortingAllowed, status) => {
85
120
  return intl.formatMessage(invalidLabel);
86
121
  }
87
122
 
88
- switch (status) {
123
+ switch (sortOrdered) {
89
124
  case SortOrder.NO_ORDER:
90
125
  return intl.formatMessage(noOrderLabel);
91
126
 
@@ -102,22 +137,44 @@ const getTooltipTitle = (intl, isSortingAllowed, status) => {
102
137
  const SortingIcon = ({
103
138
  isSortingAllowed,
104
139
  sortOrdered,
105
- intl
140
+ intl,
141
+ onClick,
142
+ onKeyDown
106
143
  }) => {
107
- const activated = sortOrdered !== SortOrder.NO_ORDER;
108
- const wrapperClassName = !isSortingAllowed ? StatusClassNames.SORTING_NOT_ALLOWED : '';
144
+ const buttonClassName = `${RendererCssClassName.SORTABLE_COLUMN_ICON}${isSortingAllowed ? '' : ` ${RendererCssClassName.SORTABLE_COLUMN_ICON}__not-allowed`}`;
109
145
  const content = getTooltipTitle(intl, isSortingAllowed, sortOrdered);
146
+
147
+ const handleClick = () => {
148
+ if (isSortingAllowed) {
149
+ onClick();
150
+ }
151
+ };
152
+
153
+ const handleKeyDown = event => {
154
+ if (isSortingAllowed) {
155
+ onKeyDown(event);
156
+ }
157
+ };
158
+
110
159
  return jsx(Tooltip, {
111
160
  delay: 0,
112
161
  content: content,
113
162
  position: "top"
114
- }, jsx("figure", {
115
- css: wrapperStyles,
116
- className: wrapperClassName
117
163
  }, jsx("div", {
118
- css: tableSortingIconStyles,
119
- className: `${getClassName(sortOrdered)} ${TABLE_SORTING_ICON_CLASS}-${activated ? 'active' : 'inactive'}`
120
- })));
164
+ css: buttonStyles,
165
+ className: buttonClassName,
166
+ role: "button",
167
+ tabIndex: isSortingAllowed ? 0 : -1,
168
+ "aria-label": "sort column",
169
+ "aria-disabled": !isSortingAllowed,
170
+ onClick: handleClick,
171
+ onKeyDown: handleKeyDown
172
+ }, jsx("div", {
173
+ css: iconWrapperStyles,
174
+ className: getIconClassName(isSortingAllowed, sortOrdered)
175
+ }, jsx("div", {
176
+ css: iconStyles
177
+ }))));
121
178
  };
122
179
 
123
180
  export default injectIntl(SortingIcon);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "103.0.0",
3
+ "version": "103.0.2",
4
4
  "sideEffects": false
5
5
  }
@@ -5,9 +5,9 @@ export var RendererCssClassName = {
5
5
  EXTENSION_CENTER_ALIGN: "".concat(clPrefix, "extension-center-align"),
6
6
  EXTENSION_OVERFLOW_CONTAINER: "".concat(clPrefix, "extension-overflow-container"),
7
7
  NUMBER_COLUMN: "".concat(clPrefix, "table-number-column"),
8
+ SORTABLE_COLUMN_WRAPPER: "".concat(clPrefix, "tableHeader-sortable-column__wrapper"),
8
9
  SORTABLE_COLUMN: "".concat(clPrefix, "tableHeader-sortable-column"),
9
- SORTABLE_COLUMN_BUTTON: "".concat(clPrefix, "tableHeader-sortable-column__button"),
10
- SORTABLE_COLUMN_NOT_ALLOWED: "".concat(clPrefix, "tableHeader-sortable-column__not-allowed"),
10
+ SORTABLE_COLUMN_ICON_WRAPPER: "".concat(clPrefix, "tableHeader-sorting-icon__wrapper"),
11
11
  SORTABLE_COLUMN_ICON: "".concat(clPrefix, "tableHeader-sorting-icon"),
12
12
  SORTABLE_COLUMN_NO_ORDER: "".concat(clPrefix, "tableHeader-sorting-icon__no-order")
13
13
  };
@@ -56,7 +56,7 @@ export var sortingIconMessages = defineMessages({
56
56
  },
57
57
  invalidLabel: {
58
58
  id: 'fabric.editor.headingLink.invalidLabel',
59
- defaultMessage: "\u26A0\uFE0F You can't sort a table with merged cell",
59
+ defaultMessage: "\u26A0\uFE0F You can't sort a table with merged cells",
60
60
  description: 'this sort is invalid for merged cells'
61
61
  }
62
62
  });
@@ -1,8 +1,11 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
3
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
4
 
4
5
  var _templateObject, _templateObject2;
5
6
 
7
+ var _excluded = ["backgroundColor", "hasIcon"];
8
+
6
9
  /** @jsx jsx */
7
10
  import React from 'react';
8
11
  import { css, jsx } from '@emotion/react';
@@ -16,24 +19,28 @@ import EmojiItem from './emoji'; // AFP-2532 TODO: Fix automatic suppressions be
16
19
  import { themed } from '@atlaskit/theme';
17
20
  import { PanelInfoIcon, PanelSuccessIcon, PanelNoteIcon, PanelWarningIcon, PanelErrorIcon } from '@atlaskit/editor-common/icons';
18
21
 
19
- var PanelStyled = function PanelStyled(props) {
22
+ var PanelStyled = function PanelStyled(_ref) {
23
+ var backgroundColor = _ref.backgroundColor,
24
+ hasIcon = _ref.hasIcon,
25
+ props = _objectWithoutProperties(_ref, _excluded);
26
+
20
27
  var styles = function styles(theme) {
21
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.", " {\n ", "\n }\n "])), PanelSharedCssClassName.prefix, panelSharedStylesWithoutPrefix({
28
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.", " {\n ", "\n\n &[data-panel-type=", "] {\n ", "\n }\n }\n "])), PanelSharedCssClassName.prefix, panelSharedStylesWithoutPrefix({
22
29
  theme: theme
23
- }));
30
+ }), PanelType.CUSTOM, hasIcon ? '' : 'padding: 12px;');
24
31
  };
25
32
 
26
- if (props['data-panel-type'] === PanelType.CUSTOM && props.backgroundColor) {
33
+ if (props['data-panel-type'] === PanelType.CUSTOM && backgroundColor) {
27
34
  styles = function styles(theme) {
28
35
  var customStyle = themed({
29
36
  dark: getPanelBackgroundDarkModeColors,
30
- light: "background-color: ".concat(props.backgroundColor, ";")
37
+ light: "background-color: ".concat(backgroundColor, ";")
31
38
  })({
32
39
  theme: theme
33
40
  });
34
- return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &.", " {\n ", "\n }\n\n &[data-panel-type=", "] {\n ", ";\n }\n "])), PanelSharedCssClassName.prefix, panelSharedStylesWithoutPrefix({
41
+ return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &.", " {\n ", "\n }\n\n &[data-panel-type=", "] {\n ", ";\n ", "\n }\n "])), PanelSharedCssClassName.prefix, panelSharedStylesWithoutPrefix({
35
42
  theme: theme
36
- }), PanelType.CUSTOM, customStyle);
43
+ }), PanelType.CUSTOM, customStyle, hasIcon ? '' : 'padding: 12px;');
37
44
  };
38
45
  }
39
46
 
@@ -86,9 +93,9 @@ var Panel = function Panel(props) {
86
93
  });
87
94
  };
88
95
 
89
- var renderIcon = function renderIcon() {
90
- var icon = getIcon();
96
+ var icon = getIcon();
91
97
 
98
+ var renderIcon = function renderIcon() {
92
99
  if (icon) {
93
100
  return jsx("div", {
94
101
  className: PanelSharedCssClassName.icon
@@ -103,7 +110,8 @@ var Panel = function Panel(props) {
103
110
  "data-panel-icon": panelIcon,
104
111
  "data-panel-icon-id": panelIconId,
105
112
  "data-panel-icon-text": panelIconText,
106
- backgroundColor: panelColor
113
+ backgroundColor: panelColor,
114
+ hasIcon: Boolean(icon)
107
115
  }, renderIcon(), jsx("div", {
108
116
  className: PanelSharedCssClassName.content
109
117
  }, children));
@@ -152,19 +152,11 @@ export var withSortableColumn = function withSortableColumn(WrapperComponent) {
152
152
  if (keys.includes(event.key) && !IgnoreSorting.includes(tagName)) {
153
153
  event.preventDefault();
154
154
 
155
- _this.onClick(event);
155
+ _this.sort();
156
156
  }
157
157
  });
158
158
 
159
- _defineProperty(_assertThisInitialized(_this), "onClick", function (event) {
160
- // ignore sorting when specific elements are clicked
161
- var _ref2 = event.target,
162
- tagName = _ref2.tagName;
163
-
164
- if (IgnoreSorting.includes(tagName)) {
165
- return;
166
- }
167
-
159
+ _defineProperty(_assertThisInitialized(_this), "sort", function () {
168
160
  var _this$props2 = _this.props,
169
161
  fireAnalyticsEvent = _this$props2.fireAnalyticsEvent,
170
162
  onSorting = _this$props2.onSorting,
@@ -217,28 +209,18 @@ export var withSortableColumn = function withSortableColumn(WrapperComponent) {
217
209
  return /*#__PURE__*/React.createElement(WrapperComponent, this.props);
218
210
  }
219
211
 
220
- var className = RendererCssClassName.SORTABLE_COLUMN;
221
-
222
- if (!onSorting) {
223
- className = "".concat(className, " ").concat(RendererCssClassName.SORTABLE_COLUMN_NOT_ALLOWED);
224
- }
225
-
226
212
  return /*#__PURE__*/React.createElement(WrapperComponent, _extends({}, this.props, {
227
- className: className,
213
+ className: RendererCssClassName.SORTABLE_COLUMN_WRAPPER,
228
214
  ariaSort: getSortOrderLabel(intl, sortOrdered)
229
215
  }), /*#__PURE__*/React.createElement("div", {
230
- className: RendererCssClassName.SORTABLE_COLUMN_BUTTON,
231
- role: "button",
232
- tabIndex: onSorting ? 0 : -1,
233
- onClick: this.onClick,
234
- onKeyDown: this.onKeyPress,
235
- "aria-disabled": !onSorting
216
+ className: RendererCssClassName.SORTABLE_COLUMN
236
217
  }, children, /*#__PURE__*/React.createElement("figure", {
237
- "aria-hidden": true,
238
- className: "".concat(RendererCssClassName.SORTABLE_COLUMN_ICON, " ").concat(sortOrderedClassName)
218
+ className: "".concat(RendererCssClassName.SORTABLE_COLUMN_ICON_WRAPPER, " ").concat(sortOrderedClassName)
239
219
  }, /*#__PURE__*/React.createElement(SortingIcon, {
240
220
  isSortingAllowed: !!onSorting,
241
- sortOrdered: sortOrdered
221
+ sortOrdered: sortOrdered,
222
+ onClick: this.sort,
223
+ onKeyDown: this.onKeyPress
242
224
  }))));
243
225
  }
244
226
  }]);
@@ -49,6 +49,8 @@ var ExtensionRenderer = /*#__PURE__*/function (_React$Component) {
49
49
  _defineProperty(_assertThisInitialized(_this), "getNodeRenderer", memoizeOne(getNodeRenderer));
50
50
 
51
51
  _defineProperty(_assertThisInitialized(_this), "renderExtensionNode", function (extensionProvider) {
52
+ var _marks$find, _marks$find$attrs;
53
+
52
54
  var _this$props = _this.props,
53
55
  extensionHandlers = _this$props.extensionHandlers,
54
56
  rendererContext = _this$props.rendererContext,
@@ -58,14 +60,19 @@ var ExtensionRenderer = /*#__PURE__*/function (_React$Component) {
58
60
  content = _this$props.content,
59
61
  text = _this$props.text,
60
62
  type = _this$props.type,
61
- localId = _this$props.localId;
63
+ localId = _this$props.localId,
64
+ marks = _this$props.marks;
65
+ var fragmentLocalId = marks === null || marks === void 0 ? void 0 : (_marks$find = marks.find(function (m) {
66
+ return m.type.name === 'fragment';
67
+ })) === null || _marks$find === void 0 ? void 0 : (_marks$find$attrs = _marks$find.attrs) === null || _marks$find$attrs === void 0 ? void 0 : _marks$find$attrs.localId;
62
68
  var node = {
63
69
  type: type,
64
70
  extensionKey: extensionKey,
65
71
  extensionType: extensionType,
66
72
  parameters: parameters,
67
73
  content: content || text,
68
- localId: localId
74
+ localId: localId,
75
+ fragmentLocalId: fragmentLocalId
69
76
  };
70
77
  var result = null;
71
78
 
@@ -50,7 +50,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
50
50
  export var NORMAL_SEVERITY_THRESHOLD = 2000;
51
51
  export var DEGRADED_SEVERITY_THRESHOLD = 3000;
52
52
  var packageName = "@atlaskit/renderer";
53
- var packageVersion = "103.0.0";
53
+ var packageVersion = "103.0.2";
54
54
  export var Renderer = /*#__PURE__*/function (_PureComponent) {
55
55
  _inherits(Renderer, _PureComponent);
56
56
 
@@ -8,8 +8,9 @@ import { gridSize, fontFamily, fontSize, borderRadius } from '@atlaskit/theme/co
8
8
  import * as colors from '@atlaskit/theme/colors';
9
9
  import { headingSizes as headingSizesImport } from '@atlaskit/theme/typography';
10
10
  import { token } from '@atlaskit/tokens';
11
- 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';
11
+ import { tableSharedStyle, columnLayoutSharedStyle, blockquoteSharedStyles, headingsSharedStyles, ruleSharedStyles, whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, mediaSingleSharedStyle, TableSharedCssClassName, tableMarginTop, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, richMediaClassName, tasksAndDecisionsStyles, smartCardSharedStyles, tableCellPadding, textColorStyles, codeBlockInListSafariFix } from '@atlaskit/editor-common/styles';
12
12
  import { shadowClassNames } from '@atlaskit/editor-common/ui';
13
+ import { browser } from '@atlaskit/editor-common/utils';
13
14
  import { editorFontSize, blockNodesVerticalMargin, akEditorTableToolbar, akEditorTableToolbarDark, akEditorTableBorder, akEditorTableBorderDark, akEditorTableNumberColumnWidth, gridMediumMaxWidth, akEditorFullWidthLayoutWidth, akEditorStickyHeaderZIndex, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
14
15
  import { RendererCssClassName } from '../../consts';
15
16
  import { HeadingAnchorWrapperClassName } from '../../react/nodes/heading-anchor';
@@ -70,7 +71,7 @@ var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
70
71
  headingsCss = "\n /**\n * When the sort button is enabled we want the heading's copy link button\n * to reserve space so that it can prematurely wrap to avoid the button\n * being displayed underneath the sort button (hidden or obscured).\n *\n * The two buttons fight each other since the sort button is displayed\n * on hover of the <th /> and the copy link button is displayed on hover\n * of the heading.\n *\n * Note that this can break the WYSIWYG experience in the case where\n * a heading fills the width of the table cell and the only thing which\n * wraps is the copy link button. This is hopefully a rare fringe case.\n */\n .".concat(HeadingAnchorWrapperClassName, " {\n position: unset;\n }\n > {\n h1, h2, h3, h4, h5, h6 {\n margin-right: 30px;\n }\n }\n ");
71
72
  }
72
73
 
73
- return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .", " {\n padding: 0;\n\n .", " {\n width: 100%;\n height: 100%;\n cursor: pointer;\n padding: ", "px;\n border-width: 1.5px;\n border-style: solid;\n border-color: transparent;\n\n > *:first-child {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-of-type + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-of-type + span + * {\n margin-top: 0;\n }\n\n @supports selector(:focus-visible) {\n &:focus {\n outline: unset;\n }\n &:focus-visible {\n border-color: ", ";\n }\n }\n\n ", "\n }\n\n &.", "\n .", " {\n cursor: default;\n }\n\n .", " {\n margin: 0;\n opacity: 1;\n transition: opacity 0.2s ease-in-out;\n }\n\n .", " {\n opacity: 0;\n }\n\n &:hover {\n .", " {\n opacity: 1;\n }\n }\n }\n "])), RendererCssClassName.SORTABLE_COLUMN, RendererCssClassName.SORTABLE_COLUMN_BUTTON, tableCellPadding, token('color.border.focused', colors.B300), headingsCss, RendererCssClassName.SORTABLE_COLUMN_NOT_ALLOWED, RendererCssClassName.SORTABLE_COLUMN_BUTTON, RendererCssClassName.SORTABLE_COLUMN_ICON, RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, RendererCssClassName.SORTABLE_COLUMN_NO_ORDER);
74
+ return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .", " {\n padding: 0;\n\n .", " {\n width: 100%;\n height: 100%;\n padding: ", "px;\n border-width: 1.5px;\n border-style: solid;\n border-color: transparent;\n\n > *:first-child {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + *,\n > style:first-child + .ProseMirror-gapcursor + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + *,\n > style:first-child + .ProseMirror-gapcursor + span + * {\n margin-top: 0;\n }\n\n @supports selector(:focus-visible) {\n &:focus {\n outline: unset;\n }\n &:focus-visible {\n border-color: ", ";\n }\n }\n\n ", "\n }\n\n .", " {\n margin: 0;\n .", " {\n opacity: 1;\n transition: opacity 0.2s ease-in-out;\n }\n }\n\n .", " {\n .", " {\n opacity: 0;\n &:focus {\n opacity: 1;\n }\n }\n }\n\n &:hover {\n .", " {\n .", " {\n opacity: 1;\n }\n }\n }\n }\n "])), RendererCssClassName.SORTABLE_COLUMN_WRAPPER, RendererCssClassName.SORTABLE_COLUMN, tableCellPadding, token('color.border.focused', colors.B300), headingsCss, RendererCssClassName.SORTABLE_COLUMN_ICON_WRAPPER, RendererCssClassName.SORTABLE_COLUMN_ICON, RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, RendererCssClassName.SORTABLE_COLUMN_ICON, RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, RendererCssClassName.SORTABLE_COLUMN_ICON);
74
75
  };
75
76
 
76
77
  var fullPageStyles = function fullPageStyles(_ref3, _ref4) {
@@ -100,7 +101,7 @@ export var rendererStyles = function rendererStyles(wrapperProps) {
100
101
  var themeProps = {
101
102
  theme: theme
102
103
  };
103
- return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: 1.5rem;\n color: ", ";\n\n .", "::after {\n // we add a clearfix after ak-renderer-document in order to\n // contain internal floats (such as media images that are \"wrap-left\")\n // to just the renderer (and not spill outside of it)\n content: '';\n visibility: hidden;\n display: block;\n height: 0;\n clear: both;\n }\n\n ", "\n ", "\n\n & h1 {\n ", "\n }\n\n & h2 {\n ", "\n }\n\n & h3 {\n ", "\n }\n\n & h4 {\n ", "\n }\n\n & h5 {\n ", "\n }\n\n & h6 {\n ", "\n }\n\n & span.akActionMark {\n color: ", ";\n text-decoration: none;\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n\n &:active {\n color: ", ";\n }\n }\n\n & span.akActionMark {\n cursor: pointer;\n }\n\n & span[data-placeholder] {\n color: ", ";\n }\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", "\n\n & .UnknownBlock {\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n\n & span.date-node {\n background: ", ";\n border-radius: ", "px;\n color: ", ";\n padding: 2px 4px;\n margin: 0 1px;\n transition: background 0.3s;\n }\n\n & span.date-node-highlighted {\n background: ", ";\n color: ", ";\n }\n\n & .renderer-image {\n max-width: 100%;\n display: block;\n margin: ", "px 0;\n }\n\n .", ".rich-media-wrapped\n + .", ":not(.rich-media-wrapped) {\n clear: both;\n }\n\n & .code-block,\n & blockquote,\n & hr,\n & > div > div:not(.rich-media-wrapped),\n .", ".rich-media-wrapped\n + .rich-media-wrapped\n + *:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n .", ".image-align-start,\n .", ".image-center,\n .", ".image-align-end {\n clear: both;\n }\n\n & .rich-media-wrapped {\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n margin-top: 8px;\n }\n }\n\n ", "\n /* plugin styles */\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* Breakout for tables and extensions */\n .", " > {\n * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n * .", " {\n overflow-x: auto;\n }\n\n & .", ":first-child {\n margin-top: 0;\n }\n }\n\n .", " {\n .", " {\n margin-top: ", ";\n }\n\n .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n .", " {\n overflow-x: auto;\n }\n\n .", "\n .", " {\n display: flex;\n }\n }\n\n ", "\n\n .", " .", " {\n z-index: 0;\n transition: all 0.1s linear;\n display: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n /** Shadow overrides */\n &.", "::after,\n &.", "::before {\n top: ", "px;\n height: calc(100% - ", "px);\n z-index: ", ";\n }\n\n &\n .", ",\n &\n .", " {\n height: calc(100% - ", "px);\n }\n\n /**\n * A hack for making all the <th /> heights equal in case some have shorter\n * content than others.\n *\n * This is done to make sort buttons fill entire <th />.\n */\n table {\n height: 1px; /* will be ignored */\n ", ";\n margin-left: 0;\n margin-right: 0;\n }\n\n table tr:first-of-type {\n height: 100%;\n\n td,\n th {\n position: relative;\n }\n }\n\n table[data-number-column='true'] {\n .", " {\n background-color: ", ";\n border-right: 1px solid\n ", ";\n width: ", "px;\n text-align: center;\n color: ", ";\n font-size: ", ";\n }\n\n .fixed .", " {\n border-right: 0px none;\n }\n }\n }\n\n tr[data-header-row].fixed {\n position: fixed !important;\n display: flex;\n overflow: hidden;\n z-index: ", ";\n\n border-right: 1px solid\n ", ";\n border-bottom: 1px solid\n ", ";\n\n /* this is to compensate for the table border */\n transform: translateX(-1px);\n }\n\n .sticky > th {\n z-index: ", ";\n position: sticky !important;\n top: 0;\n }\n\n /* Make the number column header sticky */\n .sticky > td {\n position: sticky !important;\n top: 0;\n }\n\n /* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n .sticky th,\n .sticky td {\n box-shadow: 0px 1px\n ", ",\n 0px -0.5px ", ",\n inset -1px 0px ", ",\n 0px -1px ", ";\n }\n\n /* this will remove jumpiness caused in Chrome for sticky headers */\n .fixed + tr {\n min-height: 0px;\n }\n\n /*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n & .code-block {\n max-width: 100%;\n /* -ms- properties are necessary until MS supports the latest version of the grid spec */\n /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: auto 1fr;\n /* stylelint-enable */\n\n grid-template-columns: minmax(0, 1fr);\n position: relative;\n border-radius: ", "px;\n\n /*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n word-wrap: normal;\n\n & > span {\n /* stylelint-disable value-no-vendor-prefix */\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n /* stylelint-enable */\n grid-column: 1;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n\n &:hover button.copy-to-clipboard,\n .copy-to-clipboard:focus {\n opacity: 1;\n position: absolute;\n height: 32px;\n width: 32px;\n right: 6px;\n top: 4px;\n padding: 2px;\n }\n }\n\n ", "\n\n ", ";\n & [data-layout-section] {\n margin-top: ", "px;\n & > div + div {\n margin-left: ", "px;\n }\n\n @media screen and (max-width: ", "px) {\n & > div + div {\n margin-left: 0;\n }\n }\n }\n "])), editorFontSize(themeProps), themed({
104
+ return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: 1.5rem;\n color: ", ";\n\n .", "::after {\n // we add a clearfix after ak-renderer-document in order to\n // contain internal floats (such as media images that are \"wrap-left\")\n // to just the renderer (and not spill outside of it)\n content: '';\n visibility: hidden;\n display: block;\n height: 0;\n clear: both;\n }\n\n ", "\n ", "\n\n & h1 {\n ", "\n }\n\n & h2 {\n ", "\n }\n\n & h3 {\n ", "\n }\n\n & h4 {\n ", "\n }\n\n & h5 {\n ", "\n }\n\n & h6 {\n ", "\n }\n\n & span.akActionMark {\n color: ", ";\n text-decoration: none;\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n\n &:active {\n color: ", ";\n }\n }\n\n & span.akActionMark {\n cursor: pointer;\n }\n\n & span[data-placeholder] {\n color: ", ";\n }\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", "\n\n & .UnknownBlock {\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n\n & span.date-node {\n background: ", ";\n border-radius: ", "px;\n color: ", ";\n padding: 2px 4px;\n margin: 0 1px;\n transition: background 0.3s;\n }\n\n & span.date-node-highlighted {\n background: ", ";\n color: ", ";\n }\n\n & .renderer-image {\n max-width: 100%;\n display: block;\n margin: ", "px 0;\n }\n\n .", ".rich-media-wrapped\n + .", ":not(.rich-media-wrapped) {\n clear: both;\n }\n\n & .code-block,\n & blockquote,\n & hr,\n & > div > div:not(.rich-media-wrapped),\n .", ".rich-media-wrapped\n + .rich-media-wrapped\n + *:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n .", ".image-align-start,\n .", ".image-center,\n .", ".image-align-end {\n clear: both;\n }\n\n & .rich-media-wrapped {\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n margin-top: 8px;\n }\n }\n\n ", "\n /* plugin styles */\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* Breakout for tables and extensions */\n .", " > {\n * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n * .", " {\n overflow-x: auto;\n }\n\n & .", ":first-child {\n margin-top: 0;\n }\n }\n\n .", " {\n .", " {\n margin-top: ", ";\n }\n\n .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n .", " {\n overflow-x: auto;\n }\n\n .", "\n .", " {\n display: flex;\n }\n }\n\n ", "\n\n .", " .", " {\n z-index: 0;\n transition: all 0.1s linear;\n display: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n /** Shadow overrides */\n &.", "::after,\n &.", "::before {\n top: ", "px;\n height: calc(100% - ", "px);\n z-index: ", ";\n }\n\n &\n .", ",\n &\n .", " {\n height: calc(100% - ", "px);\n }\n\n /**\n * A hack for making all the <th /> heights equal in case some have shorter\n * content than others.\n *\n * This is done to make sort buttons fill entire <th />.\n */\n table {\n height: 1px; /* will be ignored */\n ", ";\n margin-left: 0;\n margin-right: 0;\n }\n\n table tr:first-of-type {\n height: 100%;\n\n td,\n th {\n position: relative;\n }\n }\n\n table[data-number-column='true'] {\n .", " {\n background-color: ", ";\n border-right: 1px solid\n ", ";\n width: ", "px;\n text-align: center;\n color: ", ";\n font-size: ", ";\n }\n\n .fixed .", " {\n border-right: 0px none;\n }\n }\n }\n\n tr[data-header-row].fixed {\n position: fixed !important;\n display: flex;\n overflow: hidden;\n z-index: ", ";\n\n border-right: 1px solid\n ", ";\n border-bottom: 1px solid\n ", ";\n\n /* this is to compensate for the table border */\n transform: translateX(-1px);\n }\n\n .sticky > th {\n z-index: ", ";\n position: sticky !important;\n top: 0;\n }\n\n /* Make the number column header sticky */\n .sticky > td {\n position: sticky !important;\n top: 0;\n }\n\n /* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n .sticky th,\n .sticky td {\n box-shadow: 0px 1px\n ", ",\n 0px -0.5px ", ",\n inset -1px 0px ", ",\n 0px -1px ", ";\n }\n\n /* this will remove jumpiness caused in Chrome for sticky headers */\n .fixed + tr {\n min-height: 0px;\n }\n\n /*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n & .code-block {\n max-width: 100%;\n /* -ms- properties are necessary until MS supports the latest version of the grid spec */\n /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: auto 1fr;\n /* stylelint-enable */\n\n grid-template-columns: minmax(0, 1fr);\n position: relative;\n border-radius: ", "px;\n\n /*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n word-wrap: normal;\n\n & > span {\n /* stylelint-disable value-no-vendor-prefix */\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n /* stylelint-enable */\n grid-column: 1;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n\n &:hover button.copy-to-clipboard,\n .copy-to-clipboard:focus {\n opacity: 1;\n position: absolute;\n height: 32px;\n width: 32px;\n right: 6px;\n top: 4px;\n padding: 2px;\n }\n }\n\n ", "\n\n ", ";\n & [data-layout-section] {\n margin-top: ", "px;\n & > div + div {\n margin-left: ", "px;\n }\n\n @media screen and (max-width: ", "px) {\n & > div + div {\n margin-left: 0;\n }\n }\n }\n\n & li {\n > .code-block {\n margin: ", " 0 0 0;\n }\n > .code-block:first-child {\n margin-top: 0;\n }\n\n > div:last-of-type.code-block {\n margin-bottom: ", ";\n }\n\n ", "\n }\n "])), editorFontSize(themeProps), themed({
104
105
  light: token('color.text', colors.N800),
105
106
  dark: token('color.text', '#B8C7E0')
106
107
  })(themeProps), RendererCssClassName.DOCUMENT, fullPageStyles(wrapperProps, themeProps), fullWidthStyles(wrapperProps), headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), token('color.link', colors.B400), token('color.link', colors.B300), token('color.link.pressed', colors.B500), colors.placeholderText(themeProps), whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles(themeProps), ruleSharedStyles(themeProps), paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, codeMarkSharedStyles(themeProps), shadowSharedStyle, dateSharedStyle, textColorStyles, tasksAndDecisionsStyles, smartCardSharedStyles, fontFamily(), relativeFontSizeToBase16(fontSize()), themed({
@@ -136,6 +137,6 @@ export var rendererStyles = function rendererStyles(wrapperProps) {
136
137
  })(themeProps), themed({
137
138
  light: token('color.border', akEditorTableToolbar),
138
139
  dark: token('color.border', akEditorTableToolbarDark)
139
- })(themeProps), borderRadius(), blockNodesVerticalMargin, getLightWeightCodeBlockStylesForRootRendererStyleSheet(), columnLayoutSharedStyle, gridSize() * 2.5, gridSize() * 4, gridMediumMaxWidth);
140
+ })(themeProps), borderRadius(), blockNodesVerticalMargin, getLightWeightCodeBlockStylesForRootRendererStyleSheet(), columnLayoutSharedStyle, gridSize() * 2.5, gridSize() * 4, gridMediumMaxWidth, blockNodesVerticalMargin, blockNodesVerticalMargin, browser.safari ? codeBlockInListSafariFix : '');
140
141
  };
141
142
  };
@@ -1,6 +1,6 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
2
 
3
- var _templateObject, _templateObject2;
3
+ var _templateObject, _templateObject2, _templateObject3;
4
4
 
5
5
  /** @jsx jsx */
6
6
  import { css, jsx } from '@emotion/react';
@@ -10,14 +10,9 @@ import { N20, N30 } from '@atlaskit/theme/colors';
10
10
  import { SortOrder } from '@atlaskit/editor-common/types';
11
11
  import { sortingIconMessages } from '../messages';
12
12
  import { injectIntl } from 'react-intl-next';
13
- import { token } from '@atlaskit/tokens'; // We use data url here because of this issue:
14
- // https://product-fabric.atlassian.net/browse/ED-8001
15
- // Remove this workaround if Firefox has fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=1664350
16
- // TODO: Quality ticket: https://product-fabric.atlassian.net/browse/DSP-4136
17
-
18
- export var TableSortIconDataUrl = "data:image/svg+xml;utf8,".concat(encodeURIComponent("<svg xmlns=\"http://www.w3.org/2000/svg\"><g fill=\"none\" fill-rule=\"evenodd\"><path d=\"M-8-6h24v24H-8z\"></path><path d=\"M3 8.509V1c0-.552.449-1 1-1 .552 0 1 .448 1 1V8.51l1.217-1.206a1.05 1.05 0 011.477 0 1.03 1.03 0 01.004 1.463l-.003.002-2.956 2.93a1.053 1.053 0 01-1.478 0L.305 8.767a1.03 1.03 0 01.001-1.464 1.05 1.05 0 011.477 0L3 8.508z\" fill=\"#42526E\"></path></g></svg>"));
19
- var TABLE_SORTING_ICON_CLASS = 'table-sorting-icon';
20
- export var StatusClassNames; // TODO: get design to check border
13
+ import { token } from '@atlaskit/tokens';
14
+ import { RendererCssClassName } from '../consts';
15
+ export var StatusClassNames;
21
16
 
22
17
  (function (StatusClassNames) {
23
18
  StatusClassNames["ASC"] = "sorting-icon-svg__asc";
@@ -26,23 +21,34 @@ export var StatusClassNames; // TODO: get design to check border
26
21
  StatusClassNames["SORTING_NOT_ALLOWED"] = "sorting-icon-svg__not-allowed";
27
22
  })(StatusClassNames || (StatusClassNames = {}));
28
23
 
29
- var wrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n display: flex;\n height: 28px;\n width: 28px;\n margin: 6px;\n right: 0;\n top: 0;\n border: 2px solid ", ";\n border-radius: ", "px;\n background-color: ", ";\n justify-content: center;\n align-items: center;\n\n &:hover {\n background-color: ", ";\n }\n\n &.", " {\n cursor: not-allowed;\n }\n"])), token('color.border.inverse', '#fff'), gridSize() / 2, token('color.background.neutral.subtle', N20), token('color.background.neutral.subtle.hovered', N30), StatusClassNames.SORTING_NOT_ALLOWED);
30
- var tableSortingIconStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 8px;\n height: 12px;\n transition: transform 0.3s cubic-bezier(0.15, 1, 0.3, 1);\n transform-origin: 50% 50%;\n background-image: url(", ");\n\n &.", " {\n transform: rotate(-180deg);\n }\n\n &.", "-inactive {\n opacity: 0.7;\n }\n"])), TableSortIconDataUrl, StatusClassNames.DESC, TABLE_SORTING_ICON_CLASS);
24
+ var buttonStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n display: flex;\n height: 28px;\n width: 28px;\n margin: 6px;\n right: 0;\n top: 0;\n border: 2px solid ", ";\n border-radius: ", "px;\n background-color: ", ";\n justify-content: center;\n align-items: center;\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n }\n\n &.", "__not-allowed {\n cursor: not-allowed;\n }\n"])), token('color.border', '#fff'), gridSize() / 2, token('elevation.surface.overlay', N20), token('elevation.surface.overlay.hovered', N30), token('elevation.surface.overlay.pressed', 'rgba(179, 212, 255, 0.6)'), RendererCssClassName.SORTABLE_COLUMN_ICON);
25
+ var iconWrapperStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 8px;\n height: 12px;\n transition: transform 0.3s cubic-bezier(0.15, 1, 0.3, 1);\n transform-origin: 50% 50%;\n display: flex;\n justify-content: center;\n\n &.", " {\n transform: rotate(-180deg);\n }\n\n &.", "-inactive {\n opacity: 0.7;\n }\n"])), StatusClassNames.DESC, RendererCssClassName.SORTABLE_COLUMN_ICON); // The icon is created with CSS due to the following Firefox issue: https://product-fabric.atlassian.net/browse/ED-8001
26
+ // The TL;DR is that svg's in tables mess up how HTML is copied in Firefox. Using a styled div instead solves the problem.
27
+ // For this reason, svg's should be avoided in tables until this issue is fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=1664350
28
+
29
+ var iconStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n height: 100%;\n width: 2px;\n border-radius: 50px;\n background: ", ";\n\n &::before,\n &::after {\n background: ", ";\n content: '';\n height: 2px;\n width: 6px;\n position: absolute;\n border-radius: 50px;\n }\n\n &::before {\n transform: rotate(45deg) translate(3.4px, 8.5px);\n }\n\n &::after {\n transform: rotate(-45deg) translate(-6.3px, 5.7px);\n }\n"])), token('color.icon', '#42526E'), token('color.icon', '#42526E'));
30
+
31
+ var getIconClassName = function getIconClassName(isSortingAllowed, sortOrdered) {
32
+ var activated = sortOrdered !== SortOrder.NO_ORDER;
33
+ var activeStatusClass = "".concat(RendererCssClassName.SORTABLE_COLUMN_ICON, "-").concat(activated ? 'active' : 'inactive');
34
+
35
+ if (!isSortingAllowed) {
36
+ return "".concat(StatusClassNames.SORTING_NOT_ALLOWED, " ").concat(activeStatusClass);
37
+ }
31
38
 
32
- var getClassName = function getClassName(status) {
33
- switch (status) {
39
+ switch (sortOrdered) {
34
40
  case SortOrder.ASC:
35
- return StatusClassNames.ASC;
41
+ return "".concat(StatusClassNames.ASC, " ").concat(activeStatusClass);
36
42
 
37
43
  case SortOrder.DESC:
38
- return StatusClassNames.DESC;
44
+ return "".concat(StatusClassNames.DESC, " ").concat(activeStatusClass);
39
45
 
40
46
  default:
41
- return StatusClassNames.NO_ORDER;
47
+ return "".concat(StatusClassNames.NO_ORDER, " ").concat(activeStatusClass);
42
48
  }
43
49
  };
44
50
 
45
- var getTooltipTitle = function getTooltipTitle(intl, isSortingAllowed, status) {
51
+ var getTooltipTitle = function getTooltipTitle(intl, isSortingAllowed, sortOrdered) {
46
52
  var noOrderLabel = sortingIconMessages.noOrderLabel,
47
53
  ascOrderLabel = sortingIconMessages.ascOrderLabel,
48
54
  descOrderLabel = sortingIconMessages.descOrderLabel,
@@ -52,7 +58,7 @@ var getTooltipTitle = function getTooltipTitle(intl, isSortingAllowed, status) {
52
58
  return intl.formatMessage(invalidLabel);
53
59
  }
54
60
 
55
- switch (status) {
61
+ switch (sortOrdered) {
56
62
  case SortOrder.NO_ORDER:
57
63
  return intl.formatMessage(noOrderLabel);
58
64
 
@@ -69,21 +75,43 @@ var getTooltipTitle = function getTooltipTitle(intl, isSortingAllowed, status) {
69
75
  var SortingIcon = function SortingIcon(_ref) {
70
76
  var isSortingAllowed = _ref.isSortingAllowed,
71
77
  sortOrdered = _ref.sortOrdered,
72
- intl = _ref.intl;
73
- var activated = sortOrdered !== SortOrder.NO_ORDER;
74
- var wrapperClassName = !isSortingAllowed ? StatusClassNames.SORTING_NOT_ALLOWED : '';
78
+ intl = _ref.intl,
79
+ onClick = _ref.onClick,
80
+ onKeyDown = _ref.onKeyDown;
81
+ var buttonClassName = "".concat(RendererCssClassName.SORTABLE_COLUMN_ICON).concat(isSortingAllowed ? '' : " ".concat(RendererCssClassName.SORTABLE_COLUMN_ICON, "__not-allowed"));
75
82
  var content = getTooltipTitle(intl, isSortingAllowed, sortOrdered);
83
+
84
+ var handleClick = function handleClick() {
85
+ if (isSortingAllowed) {
86
+ onClick();
87
+ }
88
+ };
89
+
90
+ var handleKeyDown = function handleKeyDown(event) {
91
+ if (isSortingAllowed) {
92
+ onKeyDown(event);
93
+ }
94
+ };
95
+
76
96
  return jsx(Tooltip, {
77
97
  delay: 0,
78
98
  content: content,
79
99
  position: "top"
80
- }, jsx("figure", {
81
- css: wrapperStyles,
82
- className: wrapperClassName
83
100
  }, jsx("div", {
84
- css: tableSortingIconStyles,
85
- className: "".concat(getClassName(sortOrdered), " ").concat(TABLE_SORTING_ICON_CLASS, "-").concat(activated ? 'active' : 'inactive')
86
- })));
101
+ css: buttonStyles,
102
+ className: buttonClassName,
103
+ role: "button",
104
+ tabIndex: isSortingAllowed ? 0 : -1,
105
+ "aria-label": "sort column",
106
+ "aria-disabled": !isSortingAllowed,
107
+ onClick: handleClick,
108
+ onKeyDown: handleKeyDown
109
+ }, jsx("div", {
110
+ css: iconWrapperStyles,
111
+ className: getIconClassName(isSortingAllowed, sortOrdered)
112
+ }, jsx("div", {
113
+ css: iconStyles
114
+ }))));
87
115
  };
88
116
 
89
117
  export default injectIntl(SortingIcon);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "103.0.0",
3
+ "version": "103.0.2",
4
4
  "sideEffects": false
5
5
  }