@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,70 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
- import ReactDOM from 'react-dom';
4
- import { IntlProvider, FormattedMessage } from 'react-intl-next';
5
- import { messages } from '../../messages';
6
-
7
- /*
8
- Explanatory note:
9
- Actions don't have access to the react tree of whatever is rendered them
10
- (and this concept is fraught inside editor anyway) so we want to ensure
11
- it is mounting to a new unique place. This function manages that, including
12
- creating an element if it doesn't exist, as well as tidying up the react tree
13
- (but not the element) upon closing the modal.
14
-
15
- This may strike you as really uncomfortable as you read it, so I wanted to note
16
- that a) this was discussed and agreed upon, and b) it's definitely odd, and if
17
- you find an elegant solution around this, you should definitely feel free to
18
- refactor it.
19
- */
20
- export async function previewFunction({
21
- popupMountPointId,
22
- onClose,
23
- ...rest
24
- }) {
25
- let popupMountPoint;
26
- popupMountPoint = document.getElementById(popupMountPointId);
27
-
28
- if (!popupMountPoint) {
29
- popupMountPoint = document.createElement('div');
30
- popupMountPoint.id = popupMountPointId;
31
- popupMountPoint.setAttribute('data-testid', 'preview-modal');
32
- document.body.appendChild(popupMountPoint);
33
- }
34
-
35
- let Modal = await import('../components/Modal');
36
- ReactDOM.render( /*#__PURE__*/React.createElement(IntlProvider, {
37
- locale: "en"
38
- }, /*#__PURE__*/React.createElement(Modal.default, _extends({}, rest, {
39
- onClose: () => {
40
- if (popupMountPoint) {
41
- onClose();
42
- ReactDOM.unmountComponentAtNode(popupMountPoint);
43
- }
44
- }
45
- }))), popupMountPoint);
46
- }
47
- /*
48
- Most of these are optional as we are being fault-tolerant
49
- However src, details, icon, title, and providerName are STRONGLY encouraged
50
- */
51
-
52
- export default (({
53
- details,
54
- ...rest
55
- }) => ({
56
- id: 'preview-content',
57
- text: /*#__PURE__*/React.createElement(FormattedMessage, messages.preview),
58
- promise: () => previewFunction({
59
- popupMountPointId: 'twp-editor-preview-iframe',
60
- providerName: 'Preview',
61
- closeLabel: 'Close Preview',
62
- showModal: true,
63
- iframeName: 'twp-editor-preview-iframe',
64
- onClose: () => {},
65
- metadata: {
66
- items: details || []
67
- },
68
- ...rest
69
- })
70
- }));
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import { FormattedMessage } from 'react-intl-next';
3
- import { messages } from '../../messages';
4
- export const RetryAction = handler => ({
5
- id: 'try-again',
6
- promise: async () => handler(),
7
- text: /*#__PURE__*/React.createElement(FormattedMessage, messages.try_again)
8
- });
@@ -1,21 +0,0 @@
1
- import React from 'react';
2
- import { FormattedMessage } from 'react-intl-next';
3
- import { messages } from '../../messages';
4
- export async function viewFunction({
5
- url
6
- }) {
7
- if (!url) {
8
- return;
9
- }
10
-
11
- window.open(url, '_blank', 'noopener=yes');
12
- }
13
- export const ViewAction = ({
14
- url
15
- }) => ({
16
- id: 'view-content',
17
- text: /*#__PURE__*/React.createElement(FormattedMessage, messages.view),
18
- promise: () => viewFunction({
19
- url
20
- })
21
- });
@@ -1,42 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/core';
3
- import { useState } from 'react';
4
- import Button from '@atlaskit/button/custom-theme-button';
5
- import { ActionIcon } from './ActionIcon';
6
- export const spinnerDelay = 1000;
7
- export const Action = ({
8
- promise,
9
- text,
10
- buttonAppearance = 'default',
11
- id
12
- }) => {
13
- const [state, setState] = useState('init');
14
- return jsx(Button, {
15
- spacing: "compact",
16
- appearance: buttonAppearance,
17
- isLoading: state === 'loading',
18
- testId: `button-${id}`,
19
- onClick: event => {
20
- event.stopPropagation();
21
- event.preventDefault();
22
-
23
- if (state !== 'loading') {
24
- setState('loading');
25
- promise().then(() => {
26
- setState('success');
27
- setTimeout(() => setState('init'), spinnerDelay);
28
- }).catch(() => {
29
- setState('failure');
30
- setTimeout(() => setState('init'), spinnerDelay);
31
- });
32
- }
33
- }
34
- }, jsx("div", {
35
- css: {
36
- transition: 'opacity 0.3s',
37
- opacity: state !== 'init' ? 0 : 1
38
- }
39
- }, text), jsx(ActionIcon, {
40
- state: state
41
- }));
42
- };
@@ -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 const spinnerStyles = {
10
- display: 'flex',
11
- position: 'absolute',
12
- left: '50%',
13
- top: '50%',
14
- transform: 'translate(-50%, -50%)'
15
- };
16
- export const ActionIcon = ({
17
- 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,42 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
-
3
- /** @jsx jsx */
4
- import { jsx } from '@emotion/core';
5
- import { useState } from 'react';
6
- import Item from '@atlaskit/item';
7
- import DropList from '@atlaskit/droplist';
8
- import ButtonGroup from '@atlaskit/button/button-group';
9
- import Button from '@atlaskit/button/custom-theme-button';
10
- import { Action } from './Action';
11
- import { gs, mq } from '../utils';
12
- export const ActionList = ({
13
- items
14
- }) => {
15
- const [isOpen, setOpen] = useState(false);
16
- const actionsToShow = items.slice(0, 2);
17
- const actionsToList = items.slice(2, items.length);
18
- return jsx("div", {
19
- css: mq({
20
- display: 'flex',
21
- marginTop: [gs(2), 0]
22
- })
23
- }, jsx(ButtonGroup, null, actionsToShow.map(action => jsx(Action, _extends({
24
- key: action.id
25
- }, action)))), actionsToList.length ? jsx("div", {
26
- css: {
27
- marginLeft: gs(0.5)
28
- }
29
- }, jsx(DropList, {
30
- appearance: "default",
31
- position: "right top",
32
- isTriggerNotTabbable: true,
33
- onOpenChange: () => setOpen(true),
34
- onClick: () => setOpen(!isOpen),
35
- isOpen: isOpen,
36
- trigger: jsx(Button, {
37
- spacing: "compact"
38
- }, "...")
39
- }, actionsToList.map(actionToList => jsx(Item, {
40
- key: actionToList.id
41
- }, actionToList.text)))) : null);
42
- };
@@ -1,33 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/core';
3
- import { N300 } from '@atlaskit/theme/colors';
4
- import { gs, mq } from '../utils';
5
- export const Byline = ({
6
- text,
7
- children,
8
- testId,
9
- className
10
- }) => jsx("span", {
11
- css: mq({
12
- fontSize: gs(1.5),
13
- lineHeight: gs(2.5),
14
- color: `${N300}`,
15
- fontWeight: 'normal',
16
- marginTop: gs(0.5),
17
- // Spec: only allow two lines MAX to be shown.
18
- display: '-webkit-box',
19
- overflow: 'hidden',
20
- textOverflow: 'ellipsis',
21
- WebkitLineClamp: 2,
22
- WebkitBoxOrient: 'vertical',
23
- wordBreak: 'break-word',
24
- // Fallback options.
25
- maxHeight: gs(5),
26
- whiteSpace: 'pre-line',
27
- // EDM-713: fixes copy-paste from renderer to editor for Firefox
28
- // due to HTML its unwrapping behaviour on paste.
29
- MozUserSelect: 'none'
30
- }),
31
- "data-testid": testId,
32
- className: className
33
- }, text || children);
@@ -1,36 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/core';
3
- import AvatarGroup from '@atlaskit/avatar-group';
4
- import { mq } from '../utils';
5
- export const CollaboratorList = ({
6
- items,
7
- handleAvatarClick = () => {},
8
- handleMoreAvatarsClick = () => {},
9
- testId = 'collaborator-list'
10
- }) => {
11
- if (items.length === 0) {
12
- return null;
13
- }
14
-
15
- return jsx("span", {
16
- css: mq({
17
- display: ['none', 'inherit']
18
- })
19
- }, jsx(AvatarGroup, {
20
- maxCount: 4,
21
- appearance: "stack",
22
- size: "small",
23
- data: items,
24
- onAvatarClick: event => {
25
- event.stopPropagation();
26
- event.preventDefault();
27
- handleAvatarClick(event);
28
- },
29
- onMoreClick: event => {
30
- event.stopPropagation();
31
- event.preventDefault();
32
- handleMoreAvatarsClick(event);
33
- },
34
- testId: testId
35
- }));
36
- };
@@ -1,18 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/core';
3
- import { gs, mq } from '../utils';
4
- export const blockCardContentClassName = 'block-card-content';
5
- export const Content = ({
6
- children,
7
- isCompact = false
8
- }) => jsx("div", {
9
- css: mq({
10
- padding: isCompact ? gs(1) : gs(2),
11
- display: 'flex',
12
- flexDirection: 'column',
13
- justifyContent: isCompact ? 'unset' : ['unset', 'space-between'],
14
- flexGrow: 1
15
- }),
16
- "data-trello-do-not-use-override": "block-card-content",
17
- className: blockCardContentClassName
18
- }, children);
@@ -1,18 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/core';
3
- import { gs, mq } from '../utils';
4
- export const contentFooterClassName = 'smart-link-content-footer';
5
- export const ContentFooter = ({
6
- children,
7
- hasSpaceBetween = false
8
- }) => jsx("div", {
9
- css: mq({
10
- display: 'flex',
11
- flexDirection: ['column', 'row'],
12
- flexGrow: [1, 'unset'],
13
- justifyContent: [hasSpaceBetween ? 'space-between' : 'flex-end', 'space-between'],
14
- alignItems: ['unset', 'center'],
15
- marginTop: [gs(1), gs(1.5)]
16
- }),
17
- className: contentFooterClassName
18
- }, children);
@@ -1,21 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/core';
3
- export const blockCardContentHeaderClassName = 'block-card-content-header';
4
- export const ContentHeader = ({
5
- onClick,
6
- link,
7
- children
8
- }) => jsx("a", {
9
- onClick: onClick,
10
- href: link,
11
- target: "_blank",
12
- css: {
13
- display: 'flex',
14
- alignItems: 'flex-start',
15
- // EDM-713: fixes copy-paste from renderer to editor for Firefox
16
- // due to HTML its unwrapping behaviour on paste.
17
- MozUserSelect: 'none'
18
- },
19
- "data-trello-do-not-use-override": "block-card-content-header",
20
- className: blockCardContentHeaderClassName
21
- }, children);
@@ -1,18 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/core';
3
- import React from 'react';
4
- import { gs } from '../utils';
5
- export const Emoji = ({
6
- emoji
7
- }) => {
8
- return jsx("span", {
9
- css: {
10
- height: gs(2.5),
11
- width: gs(2),
12
- display: 'flex',
13
- alignItems: 'center',
14
- justifyContent: 'center',
15
- marginTop: '-2px'
16
- }
17
- }, emoji);
18
- };
@@ -1,68 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/core';
3
- import React from 'react';
4
- import { N20A, N30A, B200, N40A, N50A } from '@atlaskit/theme/colors';
5
- import { gs, br, mq } from '../utils';
6
- export const Frame = (props = {
7
- isSelected: false,
8
- isHoverable: false,
9
- isFluidHeight: false
10
- }) => props.compact ? jsx(CompactFrame, props) : jsx(ExpandedFrame, props);
11
- const sharedFrameStyles = {
12
- maxWidth: gs(95),
13
- width: '100%',
14
- display: 'flex',
15
- backgroundColor: 'white'
16
- };
17
- export const ExpandedFrame = ({
18
- children,
19
- isSelected,
20
- isHoverable,
21
- testId,
22
- className,
23
- isFluidHeight
24
- }) => {
25
- return jsx("div", {
26
- css: mq({ ...sharedFrameStyles,
27
- '&:hover': isHoverable ? {
28
- backgroundColor: N20A,
29
- cursor: 'pointer'
30
- } : undefined,
31
- minHeight: isFluidHeight ? 0 : [gs(21), gs(15)],
32
- borderRadius: isSelected ? br() : br(0.5),
33
- border: `2px solid ${isSelected ? B200 : 'transparent'}`,
34
- justifyContent: 'space-between',
35
- overflow: 'hidden',
36
- boxShadow: `0 1px 1px ${N50A}, 0 0 1px 1px ${N40A};`
37
- }),
38
- "data-testid": testId,
39
- className: className,
40
- "data-trello-do-not-use-override": testId
41
- }, children);
42
- };
43
- export const CompactFrame = ({
44
- children,
45
- isHoverable,
46
- isSelected,
47
- testId,
48
- className,
49
- inheritDimensions
50
- }) => {
51
- return jsx("div", {
52
- css: mq({ ...sharedFrameStyles,
53
- '&:hover': isHoverable ? {
54
- backgroundColor: N30A
55
- } : undefined,
56
- borderRadius: isSelected ? br() : br(0.5),
57
- border: isSelected ? `2px solid ${B200}` : '',
58
- justifyContent: 'center',
59
- alignItems: 'center',
60
- height: inheritDimensions ? '100%' : gs(5),
61
- backgroundColor: N20A,
62
- width: ['calc(100% - 16px)', '100%'],
63
- padding: [`0px ${gs(1)}`, '0']
64
- }),
65
- "data-testid": testId,
66
- className: className
67
- }, children);
68
- };
@@ -1,42 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/core';
3
- import React from 'react';
4
- import ImageLoader from 'react-render-image';
5
- import LinkIcon from '@atlaskit/icon/glyph/link';
6
- import { gs } from '../utils';
7
- export const blockCardIconImageClassName = 'block-card-icon-image';
8
- export const Icon = ({
9
- url,
10
- icon,
11
- defaultIcon,
12
- testId = 'block-card-icon'
13
- }) => {
14
- const placeholder = defaultIcon || jsx(LinkIcon, {
15
- label: "link",
16
- size: "small",
17
- testId: `${testId}-default`
18
- });
19
- const image = url && jsx(ImageLoader, {
20
- src: url,
21
- loaded: jsx("img", {
22
- css: {
23
- height: gs(2),
24
- width: gs(2)
25
- },
26
- src: url,
27
- "data-testid": `${testId}-image`
28
- }),
29
- errored: placeholder
30
- });
31
- return jsx("span", {
32
- css: {
33
- height: gs(2.5),
34
- width: gs(2),
35
- display: 'flex',
36
- alignItems: 'center',
37
- justifyContent: 'center'
38
- },
39
- "data-testid": testId,
40
- className: blockCardIconImageClassName
41
- }, icon || image || placeholder);
42
- };
@@ -1,17 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/core';
3
- import { B400 } from '@atlaskit/theme/colors';
4
- export const Link = ({
5
- url,
6
- testId = 'block-card',
7
- className
8
- }) => {
9
- return jsx("span", {
10
- "data-testid": `${testId}-link`,
11
- className: className,
12
- css: {
13
- color: B400,
14
- wordBreak: 'break-all'
15
- }
16
- }, url);
17
- };
@@ -1,46 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/core';
3
- import Tooltip from '@atlaskit/tooltip';
4
- import { gs } from '../utils';
5
- import { N300 } from '@atlaskit/theme/colors';
6
- export const Metadata = ({
7
- text,
8
- icon,
9
- iconUrl,
10
- tooltip
11
- }) => {
12
- let metadataIcon = icon || null;
13
-
14
- if (!metadataIcon && iconUrl) {
15
- metadataIcon = jsx("img", {
16
- src: iconUrl,
17
- css: {
18
- width: gs(1),
19
- height: gs(1)
20
- }
21
- });
22
- }
23
-
24
- const metadata = jsx("div", {
25
- css: {
26
- display: 'flex',
27
- alignItems: 'center',
28
- marginRight: gs(0.5)
29
- }
30
- }, metadataIcon, jsx("span", {
31
- css: {
32
- fontSize: gs(1.5),
33
- color: `${N300}`,
34
- marginRight: gs(0.5),
35
- marginLeft: '2px'
36
- }
37
- }, text));
38
-
39
- if (tooltip) {
40
- return jsx(Tooltip, {
41
- content: tooltip
42
- }, metadata);
43
- }
44
-
45
- return metadata;
46
- };
@@ -1,26 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
-
3
- /** @jsx jsx */
4
- import { jsx } from '@emotion/core';
5
- import { Metadata } from './Metadata';
6
- import { gs } from '../utils';
7
- export const metadataListClassName = 'smart-link-metadata-list';
8
- export const MetadataList = ({
9
- items,
10
- testId
11
- }) => {
12
- return jsx("div", {
13
- css: {
14
- display: 'flex',
15
- marginTop: gs(0.5),
16
- alignItems: 'center',
17
- '&:last-child': {
18
- marginRight: '0px'
19
- }
20
- },
21
- "data-testid": testId,
22
- className: metadataListClassName
23
- }, items.map(item => jsx(Metadata, _extends({
24
- key: item.text
25
- }, item))));
26
- };
@@ -1,94 +0,0 @@
1
- /* TODO: (from codemod)
2
- We have converted this file as best we could but you might still need
3
- to manually complete migrating this usage of ModalDialog.
4
-
5
- This file uses one or more of the following ModalDialog props: 'components', 'header',
6
- 'footer', 'body'. These props have been removed as part of moving to
7
- a compositional API.
8
-
9
- The render props that used to be exposed by the custom component APIs are
10
- now accessible using the 'useModal' hook instead: 'testId', 'titleId', and 'onClose'.
11
-
12
- We are also no longer exposing 'appearance' as render prop, so this needs to be
13
- manually passed to your custom components.
14
-
15
- For a complete guide on customization using the new compositional API, refer to the docs at
16
- https://atlassian.design/components/modal-dialog/examples#customizing-modal-dialog. */
17
- import React, { useState } from 'react';
18
- import ModalDialog, { ModalTransition, ModalBody } from '@atlaskit/modal-dialog';
19
- import { Header } from './ModalHeader';
20
- import { getIframeSandboxAttribute } from '../../util';
21
- const iframeStyles = {
22
- width: `100%`,
23
- height: 'calc(100vh - 248px)'
24
- };
25
-
26
- class ModalWithErrorBoundary extends React.Component {
27
- componentDidCatch(error, errorInfo) {
28
- if (this.props.onOpenFailed) {
29
- this.props.onOpenFailed(error, errorInfo);
30
- }
31
- }
32
-
33
- render() {
34
- return /*#__PURE__*/React.createElement(Modal, this.props);
35
- }
36
-
37
- }
38
-
39
- const Modal = ({
40
- onClose,
41
- onOpen,
42
- src,
43
- testId,
44
- showModal,
45
- providerName,
46
- metadata,
47
- icon,
48
- closeLabel,
49
- iframeName,
50
- title,
51
- url,
52
- download,
53
- byline,
54
- isTrusted = false,
55
- onViewActionClick,
56
- onDownloadActionClick
57
- }) => {
58
- let [isOpen, setIsOpen] = useState(showModal);
59
- const sandbox = getIframeSandboxAttribute(isTrusted);
60
- return /*#__PURE__*/React.createElement(ModalTransition, null, isOpen && /*#__PURE__*/React.createElement(ModalDialog, {
61
- height: "100%",
62
- width: "large",
63
- testId: testId,
64
- onOpenComplete: onOpen,
65
- onClose: () => {
66
- setIsOpen(false);
67
- },
68
- onCloseComplete: onClose
69
- }, /*#__PURE__*/React.createElement(Header, {
70
- providerName: providerName,
71
- icon: icon,
72
- metadata: metadata,
73
- url: url,
74
- title: title,
75
- label: closeLabel,
76
- download: download,
77
- byline: byline,
78
- onViewActionClick: onViewActionClick,
79
- onDownloadActionClick: onDownloadActionClick
80
- }), /*#__PURE__*/React.createElement(ModalBody, null, src ? /*#__PURE__*/React.createElement("iframe", {
81
- style: iframeStyles,
82
- name: iframeName,
83
- frameBorder: 0,
84
- src: src,
85
- sandbox: sandbox
86
- }) : /*#__PURE__*/React.createElement("iframe", {
87
- style: iframeStyles,
88
- name: iframeName,
89
- frameBorder: 0,
90
- sandbox: sandbox
91
- }))));
92
- };
93
-
94
- export default ModalWithErrorBoundary;