@atlaskit/media-ui 19.0.0 → 21.0.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 (284) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/cjs/MediaInlineCard/IconAndTitleLayout/styled.js +2 -2
  3. package/dist/cjs/classNames.js +0 -101
  4. package/dist/cjs/customMediaPlayer/analytics/utils/playbackAttributes.js +3 -7
  5. package/dist/cjs/index.js +0 -112
  6. package/dist/cjs/mime-type-icon.js +5 -3
  7. package/dist/cjs/util.js +1 -8
  8. package/dist/cjs/version.json +1 -1
  9. package/dist/es2019/MediaInlineCard/IconAndTitleLayout/styled.js +2 -4
  10. package/dist/es2019/classNames.js +1 -12
  11. package/dist/es2019/customMediaPlayer/analytics/utils/playbackAttributes.js +1 -2
  12. package/dist/es2019/index.js +0 -5
  13. package/dist/es2019/mime-type-icon.js +4 -3
  14. package/dist/es2019/util.js +1 -2
  15. package/dist/es2019/version.json +1 -1
  16. package/dist/esm/MediaInlineCard/IconAndTitleLayout/styled.js +2 -2
  17. package/dist/esm/classNames.js +1 -12
  18. package/dist/esm/customMediaPlayer/analytics/utils/playbackAttributes.js +1 -2
  19. package/dist/esm/index.js +0 -5
  20. package/dist/esm/mime-type-icon.js +5 -3
  21. package/dist/esm/util.js +1 -4
  22. package/dist/esm/version.json +1 -1
  23. package/dist/types/MediaInlineCard/Icon.d.ts +2 -2
  24. package/dist/types/MediaInlineCard/IconAndTitleLayout/styled.d.ts +9 -9
  25. package/dist/types/MediaInlineCard/LoadingView/styled.d.ts +3 -3
  26. package/dist/types/classNames.d.ts +0 -11
  27. package/dist/types/customMediaPlayer/getControlsWrapperClassName.d.ts +1 -1
  28. package/dist/types/customMediaPlayer/playPauseBlanket.d.ts +1 -1
  29. package/dist/types/customMediaPlayer/styled.d.ts +14 -14
  30. package/dist/types/index.d.ts +1 -10
  31. package/dist/types/mime-type-icon.d.ts +2 -1
  32. package/dist/types/modalSpinner.d.ts +2 -2
  33. package/dist/types/types.d.ts +0 -7
  34. package/dist/types/util.d.ts +0 -1
  35. package/package.json +7 -17
  36. package/dist/cjs/BlockCard/actions/AuthorizeAction.js +0 -29
  37. package/dist/cjs/BlockCard/actions/DownloadAction.js +0 -69
  38. package/dist/cjs/BlockCard/actions/ForbiddenAction.js +0 -38
  39. package/dist/cjs/BlockCard/actions/PreviewAction.js +0 -134
  40. package/dist/cjs/BlockCard/actions/RetryAction.js +0 -49
  41. package/dist/cjs/BlockCard/actions/ViewAction.js +0 -67
  42. package/dist/cjs/BlockCard/components/Action.js +0 -70
  43. package/dist/cjs/BlockCard/components/ActionIcon.js +0 -57
  44. package/dist/cjs/BlockCard/components/ActionList.js +0 -75
  45. package/dist/cjs/BlockCard/components/Byline.js +0 -46
  46. package/dist/cjs/BlockCard/components/CollaboratorList.js +0 -53
  47. package/dist/cjs/BlockCard/components/Content.js +0 -33
  48. package/dist/cjs/BlockCard/components/ContentFooter.js +0 -33
  49. package/dist/cjs/BlockCard/components/ContentHeader.js +0 -34
  50. package/dist/cjs/BlockCard/components/Emoji.js +0 -31
  51. package/dist/cjs/BlockCard/components/Frame.js +0 -95
  52. package/dist/cjs/BlockCard/components/Icon.js +0 -60
  53. package/dist/cjs/BlockCard/components/Link.js +0 -28
  54. package/dist/cjs/BlockCard/components/Metadata.js +0 -60
  55. package/dist/cjs/BlockCard/components/MetadataList.js +0 -43
  56. package/dist/cjs/BlockCard/components/Modal.js +0 -132
  57. package/dist/cjs/BlockCard/components/ModalHeader.js +0 -111
  58. package/dist/cjs/BlockCard/components/Name.js +0 -47
  59. package/dist/cjs/BlockCard/components/Provider.js +0 -49
  60. package/dist/cjs/BlockCard/components/Thumbnail.js +0 -71
  61. package/dist/cjs/BlockCard/components/UnresolvedText.js +0 -22
  62. package/dist/cjs/BlockCard/index.js +0 -79
  63. package/dist/cjs/BlockCard/utils/constants.js +0 -13
  64. package/dist/cjs/BlockCard/utils/handlers.js +0 -16
  65. package/dist/cjs/BlockCard/utils/index.js +0 -27
  66. package/dist/cjs/BlockCard/views/ErroredView.js +0 -100
  67. package/dist/cjs/BlockCard/views/ForbiddenView.js +0 -112
  68. package/dist/cjs/BlockCard/views/NotFoundView.js +0 -96
  69. package/dist/cjs/BlockCard/views/ResolvedView.js +0 -144
  70. package/dist/cjs/BlockCard/views/ResolvingView.js +0 -55
  71. package/dist/cjs/BlockCard/views/UnauthorizedView.js +0 -93
  72. package/dist/cjs/EmbedCard/components/ExpandedFrame.js +0 -93
  73. package/dist/cjs/EmbedCard/components/Frame.js +0 -65
  74. package/dist/cjs/EmbedCard/components/ImageIcon.js +0 -44
  75. package/dist/cjs/EmbedCard/components/styled.js +0 -187
  76. package/dist/cjs/EmbedCard/views/ErroredView.js +0 -66
  77. package/dist/cjs/EmbedCard/views/ForbiddenView.js +0 -85
  78. package/dist/cjs/EmbedCard/views/NotFoundView.js +0 -51
  79. package/dist/cjs/EmbedCard/views/ResolvedView.js +0 -75
  80. package/dist/cjs/EmbedCard/views/UnauthorisedView.js +0 -58
  81. package/dist/cjs/EmbedCard/views/UnresolvedView.js +0 -83
  82. package/dist/cjs/InlineCard/ErroredView/index.js +0 -122
  83. package/dist/cjs/InlineCard/ForbiddenView/index.js +0 -148
  84. package/dist/cjs/InlineCard/Frame/index.js +0 -71
  85. package/dist/cjs/InlineCard/Frame/styled.js +0 -96
  86. package/dist/cjs/InlineCard/Icon.js +0 -37
  87. package/dist/cjs/InlineCard/IconAndTitleLayout/index.js +0 -140
  88. package/dist/cjs/InlineCard/IconAndTitleLayout/styled.js +0 -76
  89. package/dist/cjs/InlineCard/ResolvedView/index.js +0 -88
  90. package/dist/cjs/InlineCard/ResolvingView/index.js +0 -91
  91. package/dist/cjs/InlineCard/ResolvingView/styled.js +0 -19
  92. package/dist/cjs/InlineCard/UnauthorisedView/index.js +0 -118
  93. package/dist/cjs/InlineCard/index.js +0 -45
  94. package/dist/cjs/InlineCard/styled.js +0 -43
  95. package/dist/cjs/LinkView/index.js +0 -51
  96. package/dist/cjs/common.js +0 -5
  97. package/dist/cjs/embeds.js +0 -61
  98. package/dist/es2019/BlockCard/actions/AuthorizeAction.js +0 -9
  99. package/dist/es2019/BlockCard/actions/DownloadAction.js +0 -22
  100. package/dist/es2019/BlockCard/actions/ForbiddenAction.js +0 -14
  101. package/dist/es2019/BlockCard/actions/PreviewAction.js +0 -70
  102. package/dist/es2019/BlockCard/actions/RetryAction.js +0 -8
  103. package/dist/es2019/BlockCard/actions/ViewAction.js +0 -21
  104. package/dist/es2019/BlockCard/components/Action.js +0 -42
  105. package/dist/es2019/BlockCard/components/ActionIcon.js +0 -42
  106. package/dist/es2019/BlockCard/components/ActionList.js +0 -42
  107. package/dist/es2019/BlockCard/components/Byline.js +0 -33
  108. package/dist/es2019/BlockCard/components/CollaboratorList.js +0 -36
  109. package/dist/es2019/BlockCard/components/Content.js +0 -18
  110. package/dist/es2019/BlockCard/components/ContentFooter.js +0 -18
  111. package/dist/es2019/BlockCard/components/ContentHeader.js +0 -21
  112. package/dist/es2019/BlockCard/components/Emoji.js +0 -18
  113. package/dist/es2019/BlockCard/components/Frame.js +0 -68
  114. package/dist/es2019/BlockCard/components/Icon.js +0 -42
  115. package/dist/es2019/BlockCard/components/Link.js +0 -17
  116. package/dist/es2019/BlockCard/components/Metadata.js +0 -46
  117. package/dist/es2019/BlockCard/components/MetadataList.js +0 -26
  118. package/dist/es2019/BlockCard/components/Modal.js +0 -94
  119. package/dist/es2019/BlockCard/components/ModalHeader.js +0 -86
  120. package/dist/es2019/BlockCard/components/Name.js +0 -31
  121. package/dist/es2019/BlockCard/components/Provider.js +0 -38
  122. package/dist/es2019/BlockCard/components/Thumbnail.js +0 -49
  123. package/dist/es2019/BlockCard/components/UnresolvedText.js +0 -13
  124. package/dist/es2019/BlockCard/index.js +0 -9
  125. package/dist/es2019/BlockCard/utils/constants.js +0 -4
  126. package/dist/es2019/BlockCard/utils/handlers.js +0 -7
  127. package/dist/es2019/BlockCard/utils/index.js +0 -9
  128. package/dist/es2019/BlockCard/views/ErroredView.js +0 -57
  129. package/dist/es2019/BlockCard/views/ForbiddenView.js +0 -72
  130. package/dist/es2019/BlockCard/views/NotFoundView.js +0 -56
  131. package/dist/es2019/BlockCard/views/ResolvedView.js +0 -97
  132. package/dist/es2019/BlockCard/views/ResolvingView.js +0 -31
  133. package/dist/es2019/BlockCard/views/UnauthorizedView.js +0 -56
  134. package/dist/es2019/EmbedCard/components/ExpandedFrame.js +0 -69
  135. package/dist/es2019/EmbedCard/components/Frame.js +0 -37
  136. package/dist/es2019/EmbedCard/components/ImageIcon.js +0 -28
  137. package/dist/es2019/EmbedCard/components/styled.js +0 -293
  138. package/dist/es2019/EmbedCard/views/ErroredView.js +0 -43
  139. package/dist/es2019/EmbedCard/views/ForbiddenView.js +0 -68
  140. package/dist/es2019/EmbedCard/views/NotFoundView.js +0 -33
  141. package/dist/es2019/EmbedCard/views/ResolvedView.js +0 -53
  142. package/dist/es2019/EmbedCard/views/UnauthorisedView.js +0 -40
  143. package/dist/es2019/EmbedCard/views/UnresolvedView.js +0 -67
  144. package/dist/es2019/InlineCard/ErroredView/index.js +0 -70
  145. package/dist/es2019/InlineCard/ForbiddenView/index.js +0 -98
  146. package/dist/es2019/InlineCard/Frame/index.js +0 -55
  147. package/dist/es2019/InlineCard/Frame/styled.js +0 -108
  148. package/dist/es2019/InlineCard/Icon.js +0 -62
  149. package/dist/es2019/InlineCard/IconAndTitleLayout/index.js +0 -99
  150. package/dist/es2019/InlineCard/IconAndTitleLayout/styled.js +0 -102
  151. package/dist/es2019/InlineCard/ResolvedView/index.js +0 -46
  152. package/dist/es2019/InlineCard/ResolvingView/index.js +0 -48
  153. package/dist/es2019/InlineCard/ResolvingView/styled.js +0 -6
  154. package/dist/es2019/InlineCard/UnauthorisedView/index.js +0 -66
  155. package/dist/es2019/InlineCard/index.js +0 -5
  156. package/dist/es2019/InlineCard/styled.js +0 -39
  157. package/dist/es2019/LinkView/index.js +0 -11
  158. package/dist/es2019/common.js +0 -1
  159. package/dist/es2019/embeds.js +0 -7
  160. package/dist/esm/BlockCard/actions/AuthorizeAction.js +0 -15
  161. package/dist/esm/BlockCard/actions/DownloadAction.js +0 -51
  162. package/dist/esm/BlockCard/actions/ForbiddenAction.js +0 -23
  163. package/dist/esm/BlockCard/actions/PreviewAction.js +0 -105
  164. package/dist/esm/BlockCard/actions/RetryAction.js +0 -33
  165. package/dist/esm/BlockCard/actions/ViewAction.js +0 -50
  166. package/dist/esm/BlockCard/components/Action.js +0 -53
  167. package/dist/esm/BlockCard/components/ActionIcon.js +0 -42
  168. package/dist/esm/BlockCard/components/ActionList.js +0 -55
  169. package/dist/esm/BlockCard/components/Byline.js +0 -34
  170. package/dist/esm/BlockCard/components/CollaboratorList.js +0 -39
  171. package/dist/esm/BlockCard/components/Content.js +0 -20
  172. package/dist/esm/BlockCard/components/ContentFooter.js +0 -20
  173. package/dist/esm/BlockCard/components/ContentHeader.js +0 -22
  174. package/dist/esm/BlockCard/components/Emoji.js +0 -17
  175. package/dist/esm/BlockCard/components/Frame.js +0 -75
  176. package/dist/esm/BlockCard/components/Icon.js +0 -42
  177. package/dist/esm/BlockCard/components/Link.js +0 -17
  178. package/dist/esm/BlockCard/components/Metadata.js +0 -45
  179. package/dist/esm/BlockCard/components/MetadataList.js +0 -27
  180. package/dist/esm/BlockCard/components/Modal.js +0 -125
  181. package/dist/esm/BlockCard/components/ModalHeader.js +0 -87
  182. package/dist/esm/BlockCard/components/Name.js +0 -33
  183. package/dist/esm/BlockCard/components/Provider.js +0 -37
  184. package/dist/esm/BlockCard/components/Thumbnail.js +0 -53
  185. package/dist/esm/BlockCard/components/UnresolvedText.js +0 -12
  186. package/dist/esm/BlockCard/index.js +0 -9
  187. package/dist/esm/BlockCard/utils/constants.js +0 -4
  188. package/dist/esm/BlockCard/utils/handlers.js +0 -7
  189. package/dist/esm/BlockCard/utils/index.js +0 -14
  190. package/dist/esm/BlockCard/views/ErroredView.js +0 -73
  191. package/dist/esm/BlockCard/views/ForbiddenView.js +0 -82
  192. package/dist/esm/BlockCard/views/NotFoundView.js +0 -70
  193. package/dist/esm/BlockCard/views/ResolvedView.js +0 -112
  194. package/dist/esm/BlockCard/views/ResolvingView.js +0 -34
  195. package/dist/esm/BlockCard/views/UnauthorizedView.js +0 -71
  196. package/dist/esm/EmbedCard/components/ExpandedFrame.js +0 -79
  197. package/dist/esm/EmbedCard/components/Frame.js +0 -45
  198. package/dist/esm/EmbedCard/components/ImageIcon.js +0 -30
  199. package/dist/esm/EmbedCard/components/styled.js +0 -117
  200. package/dist/esm/EmbedCard/views/ErroredView.js +0 -46
  201. package/dist/esm/EmbedCard/views/ForbiddenView.js +0 -67
  202. package/dist/esm/EmbedCard/views/NotFoundView.js +0 -33
  203. package/dist/esm/EmbedCard/views/ResolvedView.js +0 -55
  204. package/dist/esm/EmbedCard/views/UnauthorisedView.js +0 -40
  205. package/dist/esm/EmbedCard/views/UnresolvedView.js +0 -66
  206. package/dist/esm/InlineCard/ErroredView/index.js +0 -96
  207. package/dist/esm/InlineCard/ForbiddenView/index.js +0 -122
  208. package/dist/esm/InlineCard/Frame/index.js +0 -53
  209. package/dist/esm/InlineCard/Frame/styled.js +0 -79
  210. package/dist/esm/InlineCard/Icon.js +0 -18
  211. package/dist/esm/InlineCard/IconAndTitleLayout/index.js +0 -122
  212. package/dist/esm/InlineCard/IconAndTitleLayout/styled.js +0 -36
  213. package/dist/esm/InlineCard/ResolvedView/index.js +0 -70
  214. package/dist/esm/InlineCard/ResolvingView/index.js +0 -72
  215. package/dist/esm/InlineCard/ResolvingView/styled.js +0 -7
  216. package/dist/esm/InlineCard/UnauthorisedView/index.js +0 -92
  217. package/dist/esm/InlineCard/index.js +0 -5
  218. package/dist/esm/InlineCard/styled.js +0 -20
  219. package/dist/esm/LinkView/index.js +0 -35
  220. package/dist/esm/common.js +0 -1
  221. package/dist/esm/embeds.js +0 -7
  222. package/dist/types/BlockCard/actions/AuthorizeAction.d.ts +0 -2
  223. package/dist/types/BlockCard/actions/DownloadAction.d.ts +0 -8
  224. package/dist/types/BlockCard/actions/ForbiddenAction.d.ts +0 -2
  225. package/dist/types/BlockCard/actions/PreviewAction.d.ts +0 -26
  226. package/dist/types/BlockCard/actions/RetryAction.d.ts +0 -2
  227. package/dist/types/BlockCard/actions/ViewAction.d.ts +0 -8
  228. package/dist/types/BlockCard/components/Action.d.ts +0 -11
  229. package/dist/types/BlockCard/components/ActionIcon.d.ts +0 -12
  230. package/dist/types/BlockCard/components/ActionList.d.ts +0 -6
  231. package/dist/types/BlockCard/components/Byline.d.ts +0 -8
  232. package/dist/types/BlockCard/components/CollaboratorList.d.ts +0 -13
  233. package/dist/types/BlockCard/components/Content.d.ts +0 -7
  234. package/dist/types/BlockCard/components/ContentFooter.d.ts +0 -7
  235. package/dist/types/BlockCard/components/ContentHeader.d.ts +0 -8
  236. package/dist/types/BlockCard/components/Emoji.d.ts +0 -5
  237. package/dist/types/BlockCard/components/Frame.d.ts +0 -14
  238. package/dist/types/BlockCard/components/Icon.d.ts +0 -9
  239. package/dist/types/BlockCard/components/Link.d.ts +0 -7
  240. package/dist/types/BlockCard/components/Metadata.d.ts +0 -8
  241. package/dist/types/BlockCard/components/MetadataList.d.ts +0 -8
  242. package/dist/types/BlockCard/components/Modal.d.ts +0 -28
  243. package/dist/types/BlockCard/components/ModalHeader.d.ts +0 -17
  244. package/dist/types/BlockCard/components/Name.d.ts +0 -10
  245. package/dist/types/BlockCard/components/Provider.d.ts +0 -6
  246. package/dist/types/BlockCard/components/Thumbnail.d.ts +0 -9
  247. package/dist/types/BlockCard/components/UnresolvedText.d.ts +0 -6
  248. package/dist/types/BlockCard/index.d.ts +0 -10
  249. package/dist/types/BlockCard/utils/constants.d.ts +0 -3
  250. package/dist/types/BlockCard/utils/handlers.d.ts +0 -2
  251. package/dist/types/BlockCard/utils/index.d.ts +0 -5
  252. package/dist/types/BlockCard/views/ErroredView.d.ts +0 -12
  253. package/dist/types/BlockCard/views/ForbiddenView.d.ts +0 -21
  254. package/dist/types/BlockCard/views/NotFoundView.d.ts +0 -15
  255. package/dist/types/BlockCard/views/ResolvedView.d.ts +0 -32
  256. package/dist/types/BlockCard/views/ResolvingView.d.ts +0 -8
  257. package/dist/types/BlockCard/views/UnauthorizedView.d.ts +0 -17
  258. package/dist/types/EmbedCard/components/ExpandedFrame.d.ts +0 -23
  259. package/dist/types/EmbedCard/components/Frame.d.ts +0 -7
  260. package/dist/types/EmbedCard/components/ImageIcon.d.ts +0 -9
  261. package/dist/types/EmbedCard/components/styled.d.ts +0 -42
  262. package/dist/types/EmbedCard/views/ErroredView.d.ts +0 -8
  263. package/dist/types/EmbedCard/views/ForbiddenView.d.ts +0 -13
  264. package/dist/types/EmbedCard/views/NotFoundView.d.ts +0 -11
  265. package/dist/types/EmbedCard/views/ResolvedView.d.ts +0 -27
  266. package/dist/types/EmbedCard/views/UnauthorisedView.d.ts +0 -12
  267. package/dist/types/EmbedCard/views/UnresolvedView.d.ts +0 -18
  268. package/dist/types/InlineCard/ErroredView/index.d.ts +0 -21
  269. package/dist/types/InlineCard/ForbiddenView/index.d.ts +0 -25
  270. package/dist/types/InlineCard/Frame/index.d.ts +0 -16
  271. package/dist/types/InlineCard/Frame/styled.d.ts +0 -8
  272. package/dist/types/InlineCard/Icon.d.ts +0 -4
  273. package/dist/types/InlineCard/IconAndTitleLayout/index.d.ts +0 -19
  274. package/dist/types/InlineCard/IconAndTitleLayout/styled.d.ts +0 -13
  275. package/dist/types/InlineCard/ResolvedView/index.d.ts +0 -26
  276. package/dist/types/InlineCard/ResolvingView/index.d.ts +0 -18
  277. package/dist/types/InlineCard/ResolvingView/styled.d.ts +0 -6
  278. package/dist/types/InlineCard/UnauthorisedView/index.d.ts +0 -20
  279. package/dist/types/InlineCard/index.d.ts +0 -10
  280. package/dist/types/InlineCard/styled.d.ts +0 -5
  281. package/dist/types/LinkView/index.d.ts +0 -5
  282. package/dist/types/common.d.ts +0 -6
  283. package/dist/types/embeds.d.ts +0 -13
  284. package/embeds/package.json +0 -7
@@ -1,67 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
-
3
- /** @jsx jsx */
4
- import { jsx } from '@emotion/core';
5
- import Button from '@atlaskit/button/custom-theme-button';
6
- import { fontSize } from '@atlaskit/theme/constants';
7
- import { FormattedMessage } from 'react-intl-next';
8
- import { messages } from '../../messages';
9
- import { gs as gridSize } from '../../BlockCard/utils';
10
- export const EmbedCardUnresolvedView = ({
11
- image,
12
- title,
13
- description,
14
- button,
15
- context,
16
- onClick,
17
- testId
18
- }) => {
19
- return jsx("div", {
20
- css: {
21
- display: 'flex',
22
- flexDirection: 'column',
23
- alignItems: 'center',
24
- justifyContent: 'center',
25
- paddingTop: gridSize(4.5),
26
- paddingBottom: gridSize(6)
27
- },
28
- "data-testid": `${testId}-unresolved-container`
29
- }, jsx("img", {
30
- src: image,
31
- css: {
32
- height: gridSize(14),
33
- marginBottom: gridSize(4)
34
- }
35
- }), jsx("span", {
36
- css: {
37
- fontSize: gridSize(2.5),
38
- marginBottom: gridSize(1.5),
39
- width: gridSize(50),
40
- textAlign: 'center'
41
- }
42
- }, jsx(FormattedMessage, _extends({}, messages[title], {
43
- values: {
44
- context
45
- }
46
- }))), jsx("span", {
47
- css: {
48
- fontSize: fontSize(),
49
- marginBottom: gridSize(2.5),
50
- textAlign: 'center',
51
- width: gridSize(50),
52
- lineHeight: gridSize(3)
53
- }
54
- }, jsx(FormattedMessage, _extends({}, messages[description], {
55
- values: {
56
- context
57
- }
58
- }))), button && jsx(Button, {
59
- testId: `button-${button.testId || testId}`,
60
- appearance: button.appearance,
61
- onClick: onClick
62
- }, jsx(FormattedMessage, _extends({}, messages[button.text], {
63
- values: {
64
- context
65
- }
66
- }))));
67
- };
@@ -1,70 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import React from 'react';
3
- import { R300 } from '@atlaskit/theme/colors';
4
- import ErrorIcon from '@atlaskit/icon/glyph/error';
5
- import Button from '@atlaskit/button/custom-theme-button';
6
- import { Frame } from '../Frame';
7
- import { IconAndTitleLayout } from '../IconAndTitleLayout';
8
- import { AKIconWrapper } from '../Icon';
9
- import { messages } from '../../messages';
10
- import { FormattedMessage } from 'react-intl-next';
11
- import { LinkAppearance, IconStyledButton, LowercaseAppearance, NoLinkAppearance } from '../styled';
12
- export class InlineCardErroredView extends React.Component {
13
- constructor(...args) {
14
- super(...args);
15
-
16
- _defineProperty(this, "handleRetry", event => {
17
- const {
18
- onRetry
19
- } = this.props;
20
-
21
- if (onRetry) {
22
- event.preventDefault();
23
- event.stopPropagation();
24
- onRetry();
25
- }
26
- });
27
-
28
- _defineProperty(this, "renderMessage", () => {
29
- const {
30
- onRetry,
31
- url,
32
- message
33
- } = this.props;
34
- const link = /*#__PURE__*/React.createElement(LinkAppearance, null, url);
35
- const errorMessage = /*#__PURE__*/React.createElement(NoLinkAppearance, null, message);
36
- return !onRetry ? /*#__PURE__*/React.createElement(React.Fragment, null, link, " - ", errorMessage) : /*#__PURE__*/React.createElement(React.Fragment, null, link, " - ", errorMessage, ",\xA0", /*#__PURE__*/React.createElement(Button, {
37
- spacing: "none",
38
- appearance: "subtle-link",
39
- component: IconStyledButton,
40
- onClick: this.handleRetry
41
- }, /*#__PURE__*/React.createElement(FormattedMessage, messages.try_again, formattedMessage => {
42
- return /*#__PURE__*/React.createElement(LowercaseAppearance, null, formattedMessage);
43
- })));
44
- });
45
- }
46
-
47
- render() {
48
- const {
49
- url,
50
- onClick,
51
- isSelected,
52
- testId = 'inline-card-errored-view',
53
- icon
54
- } = this.props;
55
- return /*#__PURE__*/React.createElement(Frame, {
56
- testId: testId,
57
- link: url,
58
- onClick: onClick,
59
- isSelected: isSelected
60
- }, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
61
- icon: icon || /*#__PURE__*/React.createElement(AKIconWrapper, null, /*#__PURE__*/React.createElement(ErrorIcon, {
62
- label: "error",
63
- size: "small",
64
- primaryColor: R300
65
- })),
66
- title: this.renderMessage()
67
- }));
68
- }
69
-
70
- }
@@ -1,98 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
- import React from 'react';
4
- import { R400, N500 } from '@atlaskit/theme/colors';
5
- import LockIcon from '@atlaskit/icon/glyph/lock-filled';
6
- import Button from '@atlaskit/button/custom-theme-button';
7
- import { Frame } from '../Frame';
8
- import { IconAndTitleLayout } from '../IconAndTitleLayout';
9
- import { AKIconWrapper } from '../Icon';
10
- import { messages } from '../../messages';
11
- import { FormattedMessage } from 'react-intl-next';
12
- import { IconStyledButton, LowercaseAppearance, LinkAppearance } from '../styled';
13
- const FallbackForbiddenIcon = /*#__PURE__*/React.createElement(AKIconWrapper, null, /*#__PURE__*/React.createElement(LockIcon, {
14
- label: "error",
15
- size: "small",
16
- primaryColor: R400
17
- }));
18
- export class InlineCardForbiddenView extends React.Component {
19
- constructor(...args) {
20
- super(...args);
21
-
22
- _defineProperty(this, "handleRetry", event => {
23
- const {
24
- onAuthorise
25
- } = this.props;
26
- event.preventDefault();
27
- event.stopPropagation();
28
-
29
- if (onAuthorise) {
30
- onAuthorise();
31
- } else {
32
- var _this$props, _this$props$requestAc, _this$props$requestAc2;
33
-
34
- (_this$props = this.props) === null || _this$props === void 0 ? void 0 : (_this$props$requestAc = _this$props.requestAccessContext) === null || _this$props$requestAc === void 0 ? void 0 : (_this$props$requestAc2 = _this$props$requestAc.action) === null || _this$props$requestAc2 === void 0 ? void 0 : _this$props$requestAc2.promise();
35
- }
36
- });
37
-
38
- _defineProperty(this, "renderForbiddenAccessMessage", () => {
39
- var _this$props2, _this$props2$requestA;
40
-
41
- if ((_this$props2 = this.props) !== null && _this$props2 !== void 0 && (_this$props2$requestA = _this$props2.requestAccessContext) !== null && _this$props2$requestA !== void 0 && _this$props2$requestA.callToActionMessageKey) {
42
- const {
43
- callToActionMessageKey
44
- } = this.props.requestAccessContext;
45
- return /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages[callToActionMessageKey], {
46
- values: {
47
- context: this.props.context
48
- }
49
- }));
50
- }
51
-
52
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.invalid_permissions, formattedMessage => {
53
- return /*#__PURE__*/React.createElement(React.Fragment, null, formattedMessage, ", ");
54
- }), /*#__PURE__*/React.createElement(FormattedMessage, messages.try_another_account, formattedMessage => {
55
- return /*#__PURE__*/React.createElement(LowercaseAppearance, null, formattedMessage);
56
- }));
57
- });
58
-
59
- _defineProperty(this, "renderMessage", () => {
60
- var _this$props3, _this$props3$requestA;
61
-
62
- const {
63
- url,
64
- onAuthorise
65
- } = this.props;
66
- const link = /*#__PURE__*/React.createElement(LinkAppearance, null, url);
67
- const hasRequestAccessContextMessage = (_this$props3 = this.props) === null || _this$props3 === void 0 ? void 0 : (_this$props3$requestA = _this$props3.requestAccessContext) === null || _this$props3$requestA === void 0 ? void 0 : _this$props3$requestA.callToActionMessageKey;
68
- return !onAuthorise && !hasRequestAccessContextMessage ? link : /*#__PURE__*/React.createElement(React.Fragment, null, link, ' - ', /*#__PURE__*/React.createElement(Button, {
69
- spacing: "none",
70
- appearance: "subtle-link",
71
- onClick: this.handleRetry,
72
- component: IconStyledButton,
73
- testId: "button-connect-other-account"
74
- }, this.renderForbiddenAccessMessage()));
75
- });
76
- }
77
-
78
- render() {
79
- const {
80
- url,
81
- icon,
82
- onClick,
83
- isSelected,
84
- testId = 'inline-card-forbidden-view'
85
- } = this.props;
86
- return /*#__PURE__*/React.createElement(Frame, {
87
- testId: testId,
88
- link: url,
89
- onClick: onClick,
90
- isSelected: isSelected
91
- }, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
92
- icon: icon ? icon : FallbackForbiddenIcon,
93
- title: this.renderMessage(),
94
- titleColor: N500
95
- }));
96
- }
97
-
98
- }
@@ -1,55 +0,0 @@
1
- import React, { useCallback } from 'react';
2
- import { useGlobalTheme } from '@atlaskit/theme/components';
3
- import { Wrapper } from './styled';
4
- export const Frame = props => {
5
- const {
6
- isSelected,
7
- children,
8
- onClick,
9
- link,
10
- withoutBackground,
11
- withoutHover,
12
- testId,
13
- className
14
- } = props;
15
- const handleClick = useCallback(event => {
16
- if (onClick) {
17
- event.preventDefault();
18
- event.stopPropagation();
19
- onClick(event);
20
- }
21
- }, [onClick]);
22
- const handleKeyPress = useCallback(event => {
23
- if (event.key !== ' ' && event.key !== 'Enter') {
24
- return;
25
- }
26
-
27
- if (onClick) {
28
- event.preventDefault();
29
- event.stopPropagation();
30
- onClick(event);
31
- }
32
- }, [onClick]); // prevent default on mousedown to avoid inline card losing focus
33
-
34
- const handleMouseDown = useCallback(e => {
35
- e.preventDefault();
36
- }, []);
37
- const isInteractive = Boolean(onClick); // TODO Theming doesn't work right now in editor. Required React context does not trickle down atm.
38
- // It will be worked as part of https://product-fabric.atlassian.net/jira/servicedesk/projects/DTR/queues/issue/DTR-154
39
-
40
- return /*#__PURE__*/React.createElement(Wrapper, {
41
- theme: useGlobalTheme(),
42
- href: link,
43
- withoutBackground: withoutBackground,
44
- withoutHover: withoutHover,
45
- isSelected: isSelected,
46
- isInteractive: isInteractive,
47
- tabIndex: isInteractive ? 0 : undefined,
48
- role: isInteractive ? 'button' : undefined,
49
- onClick: handleClick,
50
- onMouseDown: handleMouseDown,
51
- onKeyPress: handleKeyPress,
52
- "data-testid": testId,
53
- className: className
54
- }, children);
55
- };
@@ -1,108 +0,0 @@
1
- import styled from '@emotion/styled';
2
- import { B100, B400, B50, N20 } from '@atlaskit/theme/colors';
3
- import { borderRadius as akBorderRadius } from '@atlaskit/theme/constants';
4
- import { e100 } from '@atlaskit/theme/elevation';
5
- import { themed } from '@atlaskit/theme/components';
6
- import { TitleWrapperClassName } from '../IconAndTitleLayout/styled';
7
- const BACKGROUND_COLOR_DARK = '#262B31';
8
- const selected = `
9
- cursor: pointer;
10
- box-shadow: 0 0 0 2px ${B100};
11
- outline: none;
12
- user-select: none;
13
- &, :hover, :focus, :active {
14
- text-decoration: none;
15
- }
16
- `;
17
-
18
- const isInteractive = ({
19
- isInteractive
20
- }) => {
21
- if (isInteractive) {
22
- return `
23
- cursor: pointer;
24
- :hover {
25
- background-color: ${themed({
26
- light: N20,
27
- dark: BACKGROUND_COLOR_DARK
28
- })};
29
- text-decoration: none;
30
- }
31
- :active {
32
- background-color: ${themed({
33
- light: B50,
34
- dark: BACKGROUND_COLOR_DARK
35
- })};
36
- text-decoration: none;
37
- }
38
- :focus {
39
- ${selected}
40
- text-decoration: none;
41
- }
42
- `;
43
- } else {
44
- return '';
45
- }
46
- };
47
-
48
- const isSelected = ({
49
- isSelected
50
- }) => {
51
- if (isSelected) {
52
- return selected;
53
- } else {
54
- return 'user-select: text';
55
- }
56
- };
57
-
58
- const withoutHover = ({
59
- withoutHover
60
- }) => {
61
- return withoutHover ? `
62
- &:hover {
63
- text-decoration: none;
64
- }
65
- ` : '';
66
- };
67
- /*
68
- Inline smart cards should have the following layout:
69
- ------------------------------------
70
- | icon | title | action OR lozenge |
71
- ------------------------------------
72
- The aim is to ensure (1) all children are
73
- in line with each other, (2) are vertically
74
- centered.
75
- */
76
- // NB: `padding` consistent with @mentions.
77
- // NB: `display: inline` required for `box-decoration-break` to work.
78
- // NB: `box-decoration-break` required for retaining properties (border-radius) on wrap.
79
-
80
-
81
- export const Wrapper = styled.a`
82
- line-height: 16px;
83
- padding: 1px 0.24em 2px 0.24em;
84
- ${props => props.withoutBackground ? `padding-left: 0; margin-left:-2px;` : ''}
85
- display: inline;
86
- box-decoration-break: clone;
87
- border-radius: ${akBorderRadius()}px;
88
- color: ${themed({
89
- light: B400,
90
- dark: '#4794FF'
91
- })};
92
- background-color: ${props => props.withoutBackground ? '' : themed({
93
- light: 'white',
94
- dark: BACKGROUND_COLOR_DARK
95
- })};
96
- ${props => props.withoutBackground ? '' : e100()};
97
- ${props => isInteractive(props)}
98
- ${props => isSelected(props)};
99
- ${props => withoutHover(props)}
100
- transition: 0.1s all ease-in-out;
101
- -moz-user-select: none;
102
-
103
- &:hover span.${TitleWrapperClassName} {
104
- text-decoration: ${({
105
- withoutHover
106
- }) => withoutHover ? 'none' : 'underline'};
107
- }
108
- `;
@@ -1,62 +0,0 @@
1
- import styled from '@emotion/styled';
2
- import { keyframes } from '@emotion/core';
3
- const placeholderShimmer = keyframes`
4
- 0% {
5
- background-position: -20px 0;
6
- }
7
-
8
- 100% {
9
- background-position: 20px 0;
10
- }
11
- `; // TODO: Figure out a more scalable/responsive solution
12
- // for vertical alignment.
13
- // Current rationale: vertically positioned at the top of
14
- // the smart card container (when set to 0). Offset this
15
- // to position it with appropriate whitespace from the top.
16
-
17
- export const Icon = styled.img`
18
- height: 14px;
19
- width: 14px;
20
- margin-right: 4px;
21
- border-radius: 2px;
22
- user-select: none;
23
- position: absolute;
24
- top: 50%;
25
- left: 50%;
26
- transform: translate(-50%, -50%);
27
- `; // Used for 'untrue' icons which claim to be 16x16 but
28
- // are less than that in height/width.
29
- // TODO: Replace this override with proper AtlasKit solution.
30
-
31
- export const AKIconWrapper = styled.span`
32
- margin-right: -2px;
33
- `;
34
- export const Shimmer = styled.span`
35
- height: 14px;
36
- width: 14px;
37
- margin-right: 4px;
38
- border-radius: 2px;
39
- user-select: none;
40
- position: absolute;
41
- top: 50%;
42
- left: 50%;
43
- transform: translate(-50%, -50%);
44
-
45
- background: #f6f7f8;
46
- background-image: linear-gradient(
47
- to right,
48
- #f6f7f8 0%,
49
- #edeef1 20%,
50
- #f6f7f8 40%,
51
- #f6f7f8 100%
52
- );
53
- background-repeat: no-repeat;
54
- background-size: 40px 14px;
55
- display: inline-block;
56
-
57
- animation-duration: 1s;
58
- animation-fill-mode: forwards;
59
- animation-iteration-count: infinite;
60
- animation-name: ${placeholderShimmer};
61
- animation-timing-function: linear;
62
- `;
@@ -1,99 +0,0 @@
1
- import React from 'react';
2
- import ImageLoader from 'react-render-image';
3
- import { Icon, Shimmer } from '../Icon';
4
- import { IconEmptyWrapper, IconPositionWrapper, IconTitleWrapper, IconWrapper, TitleWrapper, EmojiWrapper, TitleWrapperClassName } from './styled';
5
- import LinkIcon from '@atlaskit/icon/glyph/link';
6
- export class IconAndTitleLayout extends React.Component {
7
- renderAtlaskitIcon() {
8
- const {
9
- icon,
10
- emoji
11
- } = this.props;
12
-
13
- if (emoji) {
14
- return /*#__PURE__*/React.createElement(EmojiWrapper, null, emoji);
15
- }
16
-
17
- if (!icon || typeof icon === 'string') {
18
- return null;
19
- }
20
-
21
- return /*#__PURE__*/React.createElement(IconWrapper, null, icon);
22
- }
23
-
24
- renderImageIcon(errored, testId) {
25
- const {
26
- icon: url
27
- } = this.props;
28
-
29
- if (!url || typeof url !== 'string') {
30
- return null;
31
- }
32
-
33
- return /*#__PURE__*/React.createElement(ImageLoader, {
34
- src: url,
35
- loaded: /*#__PURE__*/React.createElement(Icon, {
36
- className: "smart-link-icon",
37
- src: url,
38
- "data-testid": `${testId}-image`
39
- }),
40
- errored: errored,
41
- loading: /*#__PURE__*/React.createElement(Shimmer, {
42
- "data-testid": `${testId}-loading`
43
- })
44
- });
45
- }
46
-
47
- renderIconPlaceholder(testId) {
48
- const {
49
- defaultIcon
50
- } = this.props;
51
-
52
- if (defaultIcon) {
53
- return /*#__PURE__*/React.createElement(IconWrapper, null, defaultIcon);
54
- }
55
-
56
- return /*#__PURE__*/React.createElement(IconWrapper, null, /*#__PURE__*/React.createElement(LinkIcon, {
57
- label: "link",
58
- size: "small",
59
- testId: `${testId}-default`
60
- }));
61
- }
62
-
63
- renderIcon(testId) {
64
- // We render two kinds of icons here:
65
- // - Image: acquired from either DAC or Teamwork Platform Apps;
66
- // - Atlaskit Icon: an Atlaskit SVG;
67
- // Each of these are scaled down to 12x12.
68
- const icon = this.renderAtlaskitIcon();
69
-
70
- if (icon) {
71
- return icon;
72
- }
73
-
74
- const placeholder = this.renderIconPlaceholder(testId);
75
- const image = this.renderImageIcon(placeholder, testId);
76
- return image || placeholder;
77
- }
78
-
79
- render() {
80
- const {
81
- children,
82
- title,
83
- titleColor,
84
- titleTextColor,
85
- testId = 'inline-card-icon-and-title'
86
- } = this.props;
87
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconTitleWrapper, {
88
- style: {
89
- color: titleColor
90
- }
91
- }, /*#__PURE__*/React.createElement(IconPositionWrapper, null, children || /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconEmptyWrapper, null), this.renderIcon(testId))), /*#__PURE__*/React.createElement(TitleWrapper, {
92
- style: {
93
- color: titleTextColor
94
- },
95
- className: TitleWrapperClassName
96
- }, title)));
97
- }
98
-
99
- }
@@ -1,102 +0,0 @@
1
- import styled from '@emotion/styled'; // TODO: remove this override behaviour for @atlaskit/icon-object
2
-
3
- export const IconObjectOverrides = `
4
- & > span {
5
- height: 16px;
6
- width: 14px;
7
- position: absolute;
8
- top: 0;
9
- left: 0;
10
- line-height: 14px;
11
- & > svg {
12
- position: absolute;
13
- top: 50%;
14
- left: 50%;
15
- transform: translate(-50%, -50%);
16
- }
17
- }
18
- `; // TODO: remove this override behaviour for @atlaskit/icon
19
-
20
- export const IconOverrides = `
21
- & > * > span {
22
- height: 16px;
23
- width: 14px;
24
- position: absolute;
25
- top: 0;
26
- left: 0;
27
- & > svg {
28
- position: absolute;
29
- top: 50%;
30
- left: 50%;
31
- transform: translate(-50%, -50%);
32
- }
33
- }
34
- `; // Wraps all icons represented in Inline Links. Icons have three sources/types:
35
- // - JSON-LD: from the generator.icon property coming back from ORS.
36
- // - @atlaskit/icon: for lock icons, unauthorized, etc.
37
- // - @atlaskit/icon-object: for object icons, e.g. repository, branch, etc.
38
- // NB: the first set of overrides style icons imported from @atlaskit/icon-object correctly.
39
- // NB: the second set of overrides style icons imported from @atlaskit/icon correctly.
40
-
41
- export const IconWrapper = styled.span`
42
- user-select: none;
43
- ${IconOverrides}
44
- ${IconObjectOverrides}
45
- `; // Wraps all emoji in Inline Links similar to icon
46
-
47
- export const EmojiWrapper = styled.span`
48
- display: inline-block;
49
- margin-right: 2px;
50
- user-select: none;
51
- ${IconOverrides}
52
- ${IconObjectOverrides}
53
- `; // The main 'wrapping' element, title of the content.
54
- // NB: `white-space` adds little whitespace before wrapping.
55
- // NB: `hyphens` enables hyphenation on word break.
56
-
57
- export const IconTitleWrapper = styled.span`
58
- hyphens: auto;
59
- white-space: pre-wrap;
60
- overflow-wrap: break-word;
61
- word-break: break-word;
62
- `; // TODO: Replace overrides with proper AtlasKit solution.
63
-
64
- export const LozengeWrapper = styled.span`
65
- display: inline-block;
66
- vertical-align: 1px;
67
- & > span {
68
- margin-left: 4px;
69
- padding: 2px 0 2px 0;
70
- }
71
- `; // TODO: Replace overrides with proper AtlasKit solution.
72
-
73
- export const LozengeBlockWrapper = styled.span`
74
- & > span {
75
- margin-left: 4px;
76
- padding: 2px 0 2px 0;
77
- }
78
- `;
79
- export const RightIconPositionWrapper = styled.span`
80
- margin-left: 2px;
81
- margin-right: 4px;
82
- position: relative;
83
- display: inline-block;
84
- `; // The following components are used to absolutely position icons in the vertical center.
85
- // - IconPositionWrapper: the `relative` parent which has no height in itself.
86
- // - IconEmptyWrapper: the child which forces `IconPositionWrapper` to have a height.
87
-
88
- export const IconPositionWrapper = styled.span`
89
- margin-right: 4px;
90
- position: relative;
91
- display: inline-block;
92
- `;
93
- export const IconEmptyWrapper = styled.span`
94
- width: 14px;
95
- height: 100%;
96
- display: inline-block;
97
- opacity: 0;
98
- `; // With emotion it's not possible to use reference to `TitleWrapper` as part of a selector,
99
- // To achieve same result we use classname instead.
100
-
101
- export const TitleWrapperClassName = 'smart-link-title-wrapper';
102
- export const TitleWrapper = styled.span``;