@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,46 +0,0 @@
1
- import React from 'react';
2
- import { Frame } from '../Frame';
3
- import Lozenge from '@atlaskit/lozenge';
4
- import { IconAndTitleLayout } from '../IconAndTitleLayout';
5
- import { LozengeWrapper } from '../IconAndTitleLayout/styled';
6
- export class InlineCardResolvedView extends React.Component {
7
- renderLozenge() {
8
- const {
9
- lozenge
10
- } = this.props;
11
-
12
- if (!lozenge) {
13
- return null;
14
- }
15
-
16
- return /*#__PURE__*/React.createElement(LozengeWrapper, null, /*#__PURE__*/React.createElement(Lozenge, {
17
- appearance: lozenge.appearance || 'default',
18
- isBold: lozenge.isBold
19
- }, lozenge.text));
20
- }
21
-
22
- render() {
23
- const {
24
- title = '',
25
- isSelected,
26
- onClick,
27
- icon,
28
- link,
29
- testId = 'inline-card-resolved-view',
30
- titleTextColor,
31
- titlePrefix
32
- } = this.props;
33
- return /*#__PURE__*/React.createElement(Frame, {
34
- testId: testId,
35
- link: link,
36
- isSelected: isSelected,
37
- onClick: onClick
38
- }, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
39
- emoji: titlePrefix,
40
- icon: icon,
41
- title: title,
42
- titleTextColor: titleTextColor
43
- }), this.renderLozenge());
44
- }
45
-
46
- }
@@ -1,48 +0,0 @@
1
- import React from 'react';
2
- import { Frame } from '../Frame';
3
- import Spinner from '@atlaskit/spinner';
4
- import { IconAndTitleLayout } from '../IconAndTitleLayout';
5
- import { SpinnerWrapper } from './styled';
6
- import { IconTitleWrapper, RightIconPositionWrapper } from '../IconAndTitleLayout/styled';
7
- export class InlineCardResolvingView extends React.Component {
8
- render() {
9
- const {
10
- url,
11
- onClick,
12
- isSelected,
13
- inlinePreloaderStyle,
14
- testId = 'inline-card-resolving-view',
15
- titleTextColor,
16
- withoutHover
17
- } = this.props;
18
-
19
- if (inlinePreloaderStyle === 'on-right-without-skeleton') {
20
- return /*#__PURE__*/React.createElement(Frame, {
21
- withoutBackground: true,
22
- withoutHover: withoutHover,
23
- testId: testId,
24
- onClick: onClick,
25
- isSelected: isSelected
26
- }, /*#__PURE__*/React.createElement(IconTitleWrapper, null, url, /*#__PURE__*/React.createElement(RightIconPositionWrapper, null, /*#__PURE__*/React.createElement(SpinnerWrapper, {
27
- className: "inline-resolving-spinner"
28
- }, /*#__PURE__*/React.createElement(Spinner, {
29
- size: 14
30
- })))));
31
- } else {
32
- return /*#__PURE__*/React.createElement(Frame, {
33
- testId: testId,
34
- onClick: onClick,
35
- isSelected: isSelected,
36
- withoutHover: withoutHover
37
- }, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
38
- title: url,
39
- titleTextColor: titleTextColor
40
- }, /*#__PURE__*/React.createElement(SpinnerWrapper, {
41
- className: "inline-resolving-spinner"
42
- }, /*#__PURE__*/React.createElement(Spinner, {
43
- size: 14
44
- }))));
45
- }
46
- }
47
-
48
- }
@@ -1,6 +0,0 @@
1
- import styled from '@emotion/styled';
2
- import { IconTitleWrapper } from '../IconAndTitleLayout/styled';
3
- export const SpinnerWrapper = styled(IconTitleWrapper)`
4
- vertical-align: text-top;
5
- margin-left: 2px;
6
- `;
@@ -1,66 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import Button from '@atlaskit/button/custom-theme-button';
3
- import LockIcon from '@atlaskit/icon/glyph/lock-filled';
4
- import { N500, R400 } from '@atlaskit/theme/colors';
5
- import React from 'react';
6
- import { FormattedMessage } from 'react-intl-next';
7
- import { messages } from '../../messages';
8
- import { Frame } from '../Frame';
9
- import { AKIconWrapper } from '../Icon';
10
- import { IconAndTitleLayout } from '../IconAndTitleLayout';
11
- import { IconStyledButton, LinkAppearance } from '../styled';
12
- const FallbackUnauthorizedIcon = /*#__PURE__*/React.createElement(AKIconWrapper, null, /*#__PURE__*/React.createElement(LockIcon, {
13
- label: "error",
14
- size: "small",
15
- primaryColor: R400
16
- }));
17
- export class InlineCardUnauthorizedView extends React.Component {
18
- constructor(...args) {
19
- super(...args);
20
-
21
- _defineProperty(this, "handleConnectAccount", event => {
22
- const {
23
- onAuthorise
24
- } = this.props;
25
- event.preventDefault();
26
- event.stopPropagation();
27
- return onAuthorise();
28
- });
29
-
30
- _defineProperty(this, "renderMessage", () => {
31
- const {
32
- onAuthorise,
33
- url
34
- } = this.props;
35
- const link = /*#__PURE__*/React.createElement(LinkAppearance, null, url);
36
- return !onAuthorise ? link : /*#__PURE__*/React.createElement(React.Fragment, null, link, ' - ', /*#__PURE__*/React.createElement(Button, {
37
- spacing: "none",
38
- appearance: "subtle-link",
39
- component: IconStyledButton,
40
- onClick: this.handleConnectAccount,
41
- testId: "button-connect-account"
42
- }, /*#__PURE__*/React.createElement(FormattedMessage, messages.connect_link_account)));
43
- });
44
- }
45
-
46
- render() {
47
- const {
48
- url,
49
- icon,
50
- onClick,
51
- isSelected,
52
- testId = 'inline-card-unauthorized-view'
53
- } = this.props;
54
- return /*#__PURE__*/React.createElement(Frame, {
55
- testId: testId,
56
- link: url,
57
- onClick: onClick,
58
- isSelected: isSelected
59
- }, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
60
- icon: icon ? icon : FallbackUnauthorizedIcon,
61
- title: this.renderMessage(),
62
- titleColor: N500
63
- }));
64
- }
65
-
66
- }
@@ -1,5 +0,0 @@
1
- export { InlineCardResolvingView } from './ResolvingView';
2
- export { InlineCardResolvedView } from './ResolvedView';
3
- export { InlineCardErroredView } from './ErroredView';
4
- export { InlineCardForbiddenView } from './ForbiddenView';
5
- export { InlineCardUnauthorizedView } from './UnauthorisedView';
@@ -1,39 +0,0 @@
1
- import styled from '@emotion/styled';
2
- import { B400, N200 } from '@atlaskit/theme/colors';
3
- import { themed } from '@atlaskit/theme/components';
4
- const LINK_COLOR_DARK = '#4794FF'; // By default buttons will hide overflow and ellipsis content instead of wrapping.
5
- // This basically turns the button back into inline content
6
-
7
- export const IconStyledButton = styled.span`
8
- text-align: initial !important;
9
- display: inline !important;
10
-
11
- &:hover {
12
- /* Remove the text-decoration to match other inline card hover states*/
13
- text-decoration: none !important;
14
- }
15
-
16
- > span {
17
- display: inline;
18
- > span {
19
- overflow: initial;
20
- text-overflow: initial;
21
- white-space: initial;
22
- }
23
- }
24
- `;
25
- export const NoLinkAppearance = styled.span`
26
- color: ${themed({
27
- light: N200,
28
- dark: LINK_COLOR_DARK
29
- })};
30
- `;
31
- export const LowercaseAppearance = styled.span`
32
- text-transform: lowercase;
33
- `;
34
- export const LinkAppearance = styled.span`
35
- color: ${themed({
36
- light: B400,
37
- dark: LINK_COLOR_DARK
38
- })};
39
- `;
@@ -1,11 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
- import { Frame } from '../InlineCard/Frame';
4
- export class CardLinkView extends React.PureComponent {
5
- render() {
6
- return /*#__PURE__*/React.createElement(Frame, _extends({
7
- withoutBackground: true
8
- }, this.props), this.props.link);
9
- }
10
-
11
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,7 +0,0 @@
1
- export { EmbedCardForbiddenView } from './EmbedCard/views/ForbiddenView';
2
- export { EmbedCardNotFoundView } from './EmbedCard/views/NotFoundView';
3
- export { EmbedCardResolvedView } from './EmbedCard/views/ResolvedView';
4
- export { EmbedCardUnauthorisedView } from './EmbedCard/views/UnauthorisedView';
5
- export { EmbedCardUnresolvedView } from './EmbedCard/views/UnresolvedView';
6
- export { ErroredView as EmbedCardErroredView } from './EmbedCard/views/ErroredView';
7
- export { embedHeaderHeight } from './EmbedCard/components/styled';
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { FormattedMessage } from 'react-intl-next';
3
- import { messages } from '../../messages';
4
- export var AuthorizeAction = function AuthorizeAction(handler) {
5
- return {
6
- id: 'connect-account',
7
- text: /*#__PURE__*/React.createElement(FormattedMessage, messages.connect_link_account_card),
8
- promise: function promise() {
9
- return new Promise(function (resolve) {
10
- return resolve(handler());
11
- });
12
- },
13
- buttonAppearance: 'default'
14
- };
15
- };
@@ -1,51 +0,0 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
- import React from 'react';
4
- import { FormattedMessage } from 'react-intl-next';
5
- import { downloadUrl } from '@atlaskit/media-common';
6
- import { messages } from '../../messages';
7
- export function downloadFunction(_x) {
8
- return _downloadFunction.apply(this, arguments);
9
- }
10
-
11
- function _downloadFunction() {
12
- _downloadFunction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
13
- var url;
14
- return _regeneratorRuntime.wrap(function _callee$(_context) {
15
- while (1) {
16
- switch (_context.prev = _context.next) {
17
- case 0:
18
- url = _ref.url;
19
-
20
- if (url) {
21
- _context.next = 3;
22
- break;
23
- }
24
-
25
- return _context.abrupt("return");
26
-
27
- case 3:
28
- downloadUrl(url);
29
-
30
- case 4:
31
- case "end":
32
- return _context.stop();
33
- }
34
- }
35
- }, _callee);
36
- }));
37
- return _downloadFunction.apply(this, arguments);
38
- }
39
-
40
- export var DownloadAction = function DownloadAction(_ref2) {
41
- var url = _ref2.url;
42
- return {
43
- id: 'download-content',
44
- text: /*#__PURE__*/React.createElement(FormattedMessage, messages.download),
45
- promise: function promise() {
46
- return downloadFunction({
47
- url: url
48
- });
49
- }
50
- };
51
- };
@@ -1,23 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
- import { FormattedMessage } from 'react-intl-next';
4
- import { messages } from '../../messages';
5
- export var ForbiddenAction = function ForbiddenAction(handler) {
6
- var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'connect-other-account';
7
- var message = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : messages.try_another_account;
8
- var context = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
9
- return {
10
- id: id,
11
- text: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, message, {
12
- values: {
13
- context: context
14
- }
15
- })),
16
- promise: function promise() {
17
- return new Promise(function (resolve) {
18
- return resolve(handler());
19
- });
20
- },
21
- buttonAppearance: 'default'
22
- };
23
- };
@@ -1,105 +0,0 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
- import _extends from "@babel/runtime/helpers/extends";
3
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
5
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
6
- var _excluded = ["popupMountPointId", "onClose"],
7
- _excluded2 = ["details"];
8
-
9
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10
-
11
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
12
-
13
- import React from 'react';
14
- import ReactDOM from 'react-dom';
15
- import { IntlProvider, FormattedMessage } from 'react-intl-next';
16
- import { messages } from '../../messages';
17
-
18
- /*
19
- Explanatory note:
20
- Actions don't have access to the react tree of whatever is rendered them
21
- (and this concept is fraught inside editor anyway) so we want to ensure
22
- it is mounting to a new unique place. This function manages that, including
23
- creating an element if it doesn't exist, as well as tidying up the react tree
24
- (but not the element) upon closing the modal.
25
-
26
- This may strike you as really uncomfortable as you read it, so I wanted to note
27
- that a) this was discussed and agreed upon, and b) it's definitely odd, and if
28
- you find an elegant solution around this, you should definitely feel free to
29
- refactor it.
30
- */
31
- export function previewFunction(_x) {
32
- return _previewFunction.apply(this, arguments);
33
- }
34
- /*
35
- Most of these are optional as we are being fault-tolerant
36
- However src, details, icon, title, and providerName are STRONGLY encouraged
37
- */
38
-
39
- function _previewFunction() {
40
- _previewFunction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
41
- var popupMountPointId, _onClose, rest, popupMountPoint, Modal;
42
-
43
- return _regeneratorRuntime.wrap(function _callee$(_context) {
44
- while (1) {
45
- switch (_context.prev = _context.next) {
46
- case 0:
47
- popupMountPointId = _ref.popupMountPointId, _onClose = _ref.onClose, rest = _objectWithoutProperties(_ref, _excluded);
48
- popupMountPoint = document.getElementById(popupMountPointId);
49
-
50
- if (!popupMountPoint) {
51
- popupMountPoint = document.createElement('div');
52
- popupMountPoint.id = popupMountPointId;
53
- popupMountPoint.setAttribute('data-testid', 'preview-modal');
54
- document.body.appendChild(popupMountPoint);
55
- }
56
-
57
- _context.next = 5;
58
- return import('../components/Modal');
59
-
60
- case 5:
61
- Modal = _context.sent;
62
- ReactDOM.render( /*#__PURE__*/React.createElement(IntlProvider, {
63
- locale: "en"
64
- }, /*#__PURE__*/React.createElement(Modal.default, _extends({}, rest, {
65
- onClose: function onClose() {
66
- if (popupMountPoint) {
67
- _onClose();
68
-
69
- ReactDOM.unmountComponentAtNode(popupMountPoint);
70
- }
71
- }
72
- }))), popupMountPoint);
73
-
74
- case 7:
75
- case "end":
76
- return _context.stop();
77
- }
78
- }
79
- }, _callee);
80
- }));
81
- return _previewFunction.apply(this, arguments);
82
- }
83
-
84
- export default (function (_ref2) {
85
- var details = _ref2.details,
86
- rest = _objectWithoutProperties(_ref2, _excluded2);
87
-
88
- return {
89
- id: 'preview-content',
90
- text: /*#__PURE__*/React.createElement(FormattedMessage, messages.preview),
91
- promise: function promise() {
92
- return previewFunction(_objectSpread({
93
- popupMountPointId: 'twp-editor-preview-iframe',
94
- providerName: 'Preview',
95
- closeLabel: 'Close Preview',
96
- showModal: true,
97
- iframeName: 'twp-editor-preview-iframe',
98
- onClose: function onClose() {},
99
- metadata: {
100
- items: details || []
101
- }
102
- }, rest));
103
- }
104
- };
105
- });
@@ -1,33 +0,0 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
- import React from 'react';
4
- import { FormattedMessage } from 'react-intl-next';
5
- import { messages } from '../../messages';
6
- export var RetryAction = function RetryAction(handler) {
7
- return {
8
- id: 'try-again',
9
- promise: function () {
10
- var _promise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
11
- return _regeneratorRuntime.wrap(function _callee$(_context) {
12
- while (1) {
13
- switch (_context.prev = _context.next) {
14
- case 0:
15
- return _context.abrupt("return", handler());
16
-
17
- case 1:
18
- case "end":
19
- return _context.stop();
20
- }
21
- }
22
- }, _callee);
23
- }));
24
-
25
- function promise() {
26
- return _promise.apply(this, arguments);
27
- }
28
-
29
- return promise;
30
- }(),
31
- text: /*#__PURE__*/React.createElement(FormattedMessage, messages.try_again)
32
- };
33
- };
@@ -1,50 +0,0 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
- import React from 'react';
4
- import { FormattedMessage } from 'react-intl-next';
5
- import { messages } from '../../messages';
6
- export function viewFunction(_x) {
7
- return _viewFunction.apply(this, arguments);
8
- }
9
-
10
- function _viewFunction() {
11
- _viewFunction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
12
- var url;
13
- return _regeneratorRuntime.wrap(function _callee$(_context) {
14
- while (1) {
15
- switch (_context.prev = _context.next) {
16
- case 0:
17
- url = _ref.url;
18
-
19
- if (url) {
20
- _context.next = 3;
21
- break;
22
- }
23
-
24
- return _context.abrupt("return");
25
-
26
- case 3:
27
- window.open(url, '_blank', 'noopener=yes');
28
-
29
- case 4:
30
- case "end":
31
- return _context.stop();
32
- }
33
- }
34
- }, _callee);
35
- }));
36
- return _viewFunction.apply(this, arguments);
37
- }
38
-
39
- export var ViewAction = function ViewAction(_ref2) {
40
- var url = _ref2.url;
41
- return {
42
- id: 'view-content',
43
- text: /*#__PURE__*/React.createElement(FormattedMessage, messages.view),
44
- promise: function promise() {
45
- return viewFunction({
46
- url: url
47
- });
48
- }
49
- };
50
- };
@@ -1,53 +0,0 @@
1
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
-
3
- /** @jsx jsx */
4
- import { jsx } from '@emotion/core';
5
- import { useState } from 'react';
6
- import Button from '@atlaskit/button/custom-theme-button';
7
- import { ActionIcon } from './ActionIcon';
8
- export var spinnerDelay = 1000;
9
- export var Action = function Action(_ref) {
10
- var promise = _ref.promise,
11
- text = _ref.text,
12
- _ref$buttonAppearance = _ref.buttonAppearance,
13
- buttonAppearance = _ref$buttonAppearance === void 0 ? 'default' : _ref$buttonAppearance,
14
- id = _ref.id;
15
-
16
- var _useState = useState('init'),
17
- _useState2 = _slicedToArray(_useState, 2),
18
- state = _useState2[0],
19
- setState = _useState2[1];
20
-
21
- return jsx(Button, {
22
- spacing: "compact",
23
- appearance: buttonAppearance,
24
- isLoading: state === 'loading',
25
- testId: "button-".concat(id),
26
- onClick: function onClick(event) {
27
- event.stopPropagation();
28
- event.preventDefault();
29
-
30
- if (state !== 'loading') {
31
- setState('loading');
32
- promise().then(function () {
33
- setState('success');
34
- setTimeout(function () {
35
- return setState('init');
36
- }, spinnerDelay);
37
- }).catch(function () {
38
- setState('failure');
39
- setTimeout(function () {
40
- return setState('init');
41
- }, spinnerDelay);
42
- });
43
- }
44
- }
45
- }, jsx("div", {
46
- css: {
47
- transition: 'opacity 0.3s',
48
- opacity: state !== 'init' ? 0 : 1
49
- }
50
- }, text), jsx(ActionIcon, {
51
- state: state
52
- }));
53
- };
@@ -1,42 +0,0 @@
1
- import React from 'react';
2
- import CheckIcon from '@atlaskit/icon/glyph/check';
3
- import CrossIcon from '@atlaskit/icon/glyph/cross';
4
-
5
- /*
6
- These styles are taken fro the spinner style for button. There was not an
7
- easy way to share tehm between the two components.
8
- */
9
- export var spinnerStyles = {
10
- display: 'flex',
11
- position: 'absolute',
12
- left: '50%',
13
- top: '50%',
14
- transform: 'translate(-50%, -50%)'
15
- };
16
- export var ActionIcon = function ActionIcon(_ref) {
17
- var state = _ref.state;
18
-
19
- switch (state) {
20
- case 'init':
21
- case 'loading':
22
- return null;
23
-
24
- case 'success':
25
- return /*#__PURE__*/React.createElement("div", {
26
- "data-testid": "check-icon",
27
- style: spinnerStyles
28
- }, /*#__PURE__*/React.createElement(CheckIcon, {
29
- size: "small",
30
- label: "check"
31
- }));
32
-
33
- case 'failure':
34
- return /*#__PURE__*/React.createElement("div", {
35
- "data-testid": "cross-icon",
36
- style: spinnerStyles
37
- }, /*#__PURE__*/React.createElement(CrossIcon, {
38
- size: "small",
39
- label: "check"
40
- }));
41
- }
42
- };
@@ -1,55 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
-
4
- /** @jsx jsx */
5
- import { jsx } from '@emotion/core';
6
- import { useState } from 'react';
7
- import Item from '@atlaskit/item';
8
- import DropList from '@atlaskit/droplist';
9
- import ButtonGroup from '@atlaskit/button/button-group';
10
- import Button from '@atlaskit/button/custom-theme-button';
11
- import { Action } from './Action';
12
- import { gs, mq } from '../utils';
13
- export var ActionList = function ActionList(_ref) {
14
- var items = _ref.items;
15
-
16
- var _useState = useState(false),
17
- _useState2 = _slicedToArray(_useState, 2),
18
- isOpen = _useState2[0],
19
- setOpen = _useState2[1];
20
-
21
- var actionsToShow = items.slice(0, 2);
22
- var actionsToList = items.slice(2, items.length);
23
- return jsx("div", {
24
- css: mq({
25
- display: 'flex',
26
- marginTop: [gs(2), 0]
27
- })
28
- }, jsx(ButtonGroup, null, actionsToShow.map(function (action) {
29
- return jsx(Action, _extends({
30
- key: action.id
31
- }, action));
32
- })), actionsToList.length ? jsx("div", {
33
- css: {
34
- marginLeft: gs(0.5)
35
- }
36
- }, jsx(DropList, {
37
- appearance: "default",
38
- position: "right top",
39
- isTriggerNotTabbable: true,
40
- onOpenChange: function onOpenChange() {
41
- return setOpen(true);
42
- },
43
- onClick: function onClick() {
44
- return setOpen(!isOpen);
45
- },
46
- isOpen: isOpen,
47
- trigger: jsx(Button, {
48
- spacing: "compact"
49
- }, "...")
50
- }, actionsToList.map(function (actionToList) {
51
- return jsx(Item, {
52
- key: actionToList.id
53
- }, actionToList.text);
54
- }))) : null);
55
- };