@atlaskit/media-ui 22.2.4 → 22.3.1

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 (194) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/MediaButton.js +12 -29
  3. package/dist/cjs/MediaInlineCard/ErroredView/index.js +6 -35
  4. package/dist/cjs/MediaInlineCard/Frame/index.js +4 -27
  5. package/dist/cjs/MediaInlineCard/Frame/styled.js +5 -18
  6. package/dist/cjs/MediaInlineCard/Icon.js +3 -10
  7. package/dist/cjs/MediaInlineCard/IconAndTitleLayout/index.js +8 -38
  8. package/dist/cjs/MediaInlineCard/IconAndTitleLayout/styled.js +15 -33
  9. package/dist/cjs/MediaInlineCard/LoadedView/index.js +8 -24
  10. package/dist/cjs/MediaInlineCard/LoadingView/index.js +6 -26
  11. package/dist/cjs/MediaInlineCard/LoadingView/styled.js +0 -6
  12. package/dist/cjs/MediaInlineCard/index.js +0 -3
  13. package/dist/cjs/MediaInlineCard/styled.js +1 -10
  14. package/dist/cjs/browser.js +1 -5
  15. package/dist/cjs/camera.js +14 -36
  16. package/dist/cjs/codeViewer.js +1 -46
  17. package/dist/cjs/customMediaPlayer/analytics/events/screen/customMediaPlayer.js +0 -7
  18. package/dist/cjs/customMediaPlayer/analytics/events/track/playCount.js +0 -7
  19. package/dist/cjs/customMediaPlayer/analytics/events/track/played.js +0 -7
  20. package/dist/cjs/customMediaPlayer/analytics/events/ui/mediaButtonClicked.js +0 -6
  21. package/dist/cjs/customMediaPlayer/analytics/events/ui/playPauseBlanketClicked.js +0 -6
  22. package/dist/cjs/customMediaPlayer/analytics/events/ui/playbackSpeedChanged.js +0 -6
  23. package/dist/cjs/customMediaPlayer/analytics/events/ui/shortcutPressed.js +0 -6
  24. package/dist/cjs/customMediaPlayer/analytics/events/ui/timeRangeNavigated.js +0 -6
  25. package/dist/cjs/customMediaPlayer/analytics/index.js +0 -9
  26. package/dist/cjs/customMediaPlayer/analytics/utils/analytics.js +4 -8
  27. package/dist/cjs/customMediaPlayer/analytics/utils/playbackAttributes.js +10 -12
  28. package/dist/cjs/customMediaPlayer/fullscreen.js +4 -20
  29. package/dist/cjs/customMediaPlayer/getControlsWrapperClassName.js +0 -3
  30. package/dist/cjs/customMediaPlayer/icons.js +0 -8
  31. package/dist/cjs/customMediaPlayer/index.js +54 -157
  32. package/dist/cjs/customMediaPlayer/playPauseBlanket.js +0 -6
  33. package/dist/cjs/customMediaPlayer/playbackSpeedControls.js +7 -45
  34. package/dist/cjs/customMediaPlayer/simultaneousPlayManager.js +0 -4
  35. package/dist/cjs/customMediaPlayer/styled.js +0 -43
  36. package/dist/cjs/customMediaPlayer/timeRange.js +24 -55
  37. package/dist/cjs/customMediaPlayer/timeSaver.js +5 -12
  38. package/dist/cjs/ellipsify.js +4 -25
  39. package/dist/cjs/errorIcon.js +1 -5
  40. package/dist/cjs/formatDate.js +6 -12
  41. package/dist/cjs/formatDuration.js +0 -5
  42. package/dist/cjs/humanReadableSize.js +1 -6
  43. package/dist/cjs/i18n/cs.js +0 -1
  44. package/dist/cjs/i18n/da.js +0 -1
  45. package/dist/cjs/i18n/de.js +0 -1
  46. package/dist/cjs/i18n/en.js +0 -1
  47. package/dist/cjs/i18n/en_GB.js +0 -1
  48. package/dist/cjs/i18n/en_ZZ.js +0 -1
  49. package/dist/cjs/i18n/es.js +0 -1
  50. package/dist/cjs/i18n/et.js +0 -1
  51. package/dist/cjs/i18n/fi.js +0 -1
  52. package/dist/cjs/i18n/fr.js +0 -1
  53. package/dist/cjs/i18n/hu.js +0 -1
  54. package/dist/cjs/i18n/index.js +0 -30
  55. package/dist/cjs/i18n/it.js +0 -1
  56. package/dist/cjs/i18n/ja.js +0 -1
  57. package/dist/cjs/i18n/ko.js +0 -1
  58. package/dist/cjs/i18n/nb.js +0 -1
  59. package/dist/cjs/i18n/nl.js +0 -1
  60. package/dist/cjs/i18n/pl.js +0 -1
  61. package/dist/cjs/i18n/pt_BR.js +0 -1
  62. package/dist/cjs/i18n/pt_PT.js +0 -1
  63. package/dist/cjs/i18n/ru.js +0 -1
  64. package/dist/cjs/i18n/sk.js +0 -1
  65. package/dist/cjs/i18n/sv.js +0 -1
  66. package/dist/cjs/i18n/th.js +0 -1
  67. package/dist/cjs/i18n/tr.js +0 -1
  68. package/dist/cjs/i18n/uk.js +0 -1
  69. package/dist/cjs/i18n/vi.js +0 -1
  70. package/dist/cjs/i18n/zh.js +0 -1
  71. package/dist/cjs/i18n/zh_TW.js +0 -1
  72. package/dist/cjs/imageMetaData/imageOrientationUtil.js +1 -5
  73. package/dist/cjs/imageMetaData/index.js +8 -50
  74. package/dist/cjs/imageMetaData/metatags.js +0 -23
  75. package/dist/cjs/imageMetaData/parseJPEG.js +1 -18
  76. package/dist/cjs/imageMetaData/parsePNG.js +0 -30
  77. package/dist/cjs/imageMetaData/parsePNGXMP.js +0 -4
  78. package/dist/cjs/imageMetaData/types.js +0 -5
  79. package/dist/cjs/inactivityDetector/inactivityDetector.js +5 -34
  80. package/dist/cjs/inactivityDetector/styled.js +0 -8
  81. package/dist/cjs/index.js +0 -29
  82. package/dist/cjs/intersectionObserver.js +0 -2
  83. package/dist/cjs/locales.js +0 -5
  84. package/dist/cjs/media-type-icon.js +3 -35
  85. package/dist/cjs/mediaImage/index.js +32 -63
  86. package/dist/cjs/mediaImage/styled.js +2 -13
  87. package/dist/cjs/messages.js +0 -2
  88. package/dist/cjs/mime-type-icon.js +13 -18
  89. package/dist/cjs/mixins.js +0 -11
  90. package/dist/cjs/modalSpinner.js +1 -15
  91. package/dist/cjs/shortcut.js +3 -25
  92. package/dist/cjs/truncateText.js +12 -33
  93. package/dist/cjs/util.js +16 -72
  94. package/dist/cjs/version.json +1 -1
  95. package/dist/es2019/MediaButton.js +8 -11
  96. package/dist/es2019/MediaInlineCard/ErroredView/index.js +1 -5
  97. package/dist/es2019/MediaInlineCard/Frame/index.js +0 -8
  98. package/dist/es2019/MediaInlineCard/Frame/styled.js +5 -8
  99. package/dist/es2019/MediaInlineCard/Icon.js +6 -4
  100. package/dist/es2019/MediaInlineCard/IconAndTitleLayout/index.js +1 -16
  101. package/dist/es2019/MediaInlineCard/IconAndTitleLayout/styled.js +19 -13
  102. package/dist/es2019/MediaInlineCard/LoadedView/index.js +0 -1
  103. package/dist/es2019/MediaInlineCard/LoadingView/index.js +0 -2
  104. package/dist/es2019/MediaInlineCard/styled.js +1 -2
  105. package/dist/es2019/browser.js +1 -5
  106. package/dist/es2019/camera.js +9 -52
  107. package/dist/es2019/codeViewer.js +1 -42
  108. package/dist/es2019/customMediaPlayer/analytics/utils/analytics.js +4 -2
  109. package/dist/es2019/customMediaPlayer/fullscreen.js +4 -9
  110. package/dist/es2019/customMediaPlayer/icons.js +0 -4
  111. package/dist/es2019/customMediaPlayer/index.js +9 -85
  112. package/dist/es2019/customMediaPlayer/playbackSpeedControls.js +14 -20
  113. package/dist/es2019/customMediaPlayer/simultaneousPlayManager.js +0 -4
  114. package/dist/es2019/customMediaPlayer/timeRange.js +12 -29
  115. package/dist/es2019/customMediaPlayer/timeSaver.js +5 -9
  116. package/dist/es2019/ellipsify.js +0 -8
  117. package/dist/es2019/formatDuration.js +0 -3
  118. package/dist/es2019/humanReadableSize.js +3 -2
  119. package/dist/es2019/imageMetaData/imageOrientationUtil.js +1 -2
  120. package/dist/es2019/imageMetaData/index.js +10 -24
  121. package/dist/es2019/imageMetaData/metatags.js +4 -4
  122. package/dist/es2019/imageMetaData/parseJPEG.js +0 -3
  123. package/dist/es2019/imageMetaData/parsePNG.js +5 -10
  124. package/dist/es2019/imageMetaData/parsePNGXMP.js +0 -3
  125. package/dist/es2019/imageMetaData/types.js +0 -5
  126. package/dist/es2019/inactivityDetector/inactivityDetector.js +5 -15
  127. package/dist/es2019/inactivityDetector/styled.js +0 -2
  128. package/dist/es2019/media-type-icon.js +0 -2
  129. package/dist/es2019/mediaImage/index.js +15 -27
  130. package/dist/es2019/mediaImage/styled.js +2 -1
  131. package/dist/es2019/mime-type-icon.js +5 -5
  132. package/dist/es2019/shortcut.js +0 -9
  133. package/dist/es2019/truncateText.js +1 -9
  134. package/dist/es2019/util.js +14 -26
  135. package/dist/es2019/version.json +1 -1
  136. package/dist/esm/MediaButton.js +12 -22
  137. package/dist/esm/MediaInlineCard/ErroredView/index.js +6 -19
  138. package/dist/esm/MediaInlineCard/Frame/index.js +4 -21
  139. package/dist/esm/MediaInlineCard/Frame/styled.js +5 -11
  140. package/dist/esm/MediaInlineCard/Icon.js +4 -4
  141. package/dist/esm/MediaInlineCard/IconAndTitleLayout/index.js +8 -26
  142. package/dist/esm/MediaInlineCard/IconAndTitleLayout/styled.js +17 -13
  143. package/dist/esm/MediaInlineCard/LoadedView/index.js +8 -16
  144. package/dist/esm/MediaInlineCard/LoadingView/index.js +6 -15
  145. package/dist/esm/MediaInlineCard/LoadingView/styled.js +0 -2
  146. package/dist/esm/MediaInlineCard/styled.js +1 -4
  147. package/dist/esm/browser.js +1 -5
  148. package/dist/esm/camera.js +14 -31
  149. package/dist/esm/codeViewer.js +1 -42
  150. package/dist/esm/customMediaPlayer/analytics/events/screen/customMediaPlayer.js +0 -3
  151. package/dist/esm/customMediaPlayer/analytics/events/track/playCount.js +0 -3
  152. package/dist/esm/customMediaPlayer/analytics/events/track/played.js +0 -3
  153. package/dist/esm/customMediaPlayer/analytics/events/ui/mediaButtonClicked.js +0 -3
  154. package/dist/esm/customMediaPlayer/analytics/events/ui/playPauseBlanketClicked.js +0 -3
  155. package/dist/esm/customMediaPlayer/analytics/events/ui/playbackSpeedChanged.js +0 -3
  156. package/dist/esm/customMediaPlayer/analytics/events/ui/shortcutPressed.js +0 -3
  157. package/dist/esm/customMediaPlayer/analytics/events/ui/timeRangeNavigated.js +0 -3
  158. package/dist/esm/customMediaPlayer/analytics/utils/analytics.js +4 -2
  159. package/dist/esm/customMediaPlayer/analytics/utils/playbackAttributes.js +10 -10
  160. package/dist/esm/customMediaPlayer/fullscreen.js +4 -9
  161. package/dist/esm/customMediaPlayer/icons.js +0 -4
  162. package/dist/esm/customMediaPlayer/index.js +54 -153
  163. package/dist/esm/customMediaPlayer/playPauseBlanket.js +0 -2
  164. package/dist/esm/customMediaPlayer/playbackSpeedControls.js +7 -30
  165. package/dist/esm/customMediaPlayer/simultaneousPlayManager.js +0 -4
  166. package/dist/esm/customMediaPlayer/styled.js +0 -2
  167. package/dist/esm/customMediaPlayer/timeRange.js +24 -51
  168. package/dist/esm/customMediaPlayer/timeSaver.js +5 -10
  169. package/dist/esm/ellipsify.js +4 -14
  170. package/dist/esm/formatDate.js +6 -6
  171. package/dist/esm/formatDuration.js +0 -3
  172. package/dist/esm/humanReadableSize.js +3 -2
  173. package/dist/esm/imageMetaData/imageOrientationUtil.js +1 -2
  174. package/dist/esm/imageMetaData/index.js +8 -40
  175. package/dist/esm/imageMetaData/metatags.js +0 -15
  176. package/dist/esm/imageMetaData/parseJPEG.js +1 -8
  177. package/dist/esm/imageMetaData/parsePNG.js +0 -21
  178. package/dist/esm/imageMetaData/parsePNGXMP.js +0 -3
  179. package/dist/esm/imageMetaData/types.js +0 -5
  180. package/dist/esm/inactivityDetector/inactivityDetector.js +5 -25
  181. package/dist/esm/inactivityDetector/styled.js +0 -4
  182. package/dist/esm/media-type-icon.js +3 -13
  183. package/dist/esm/mediaImage/index.js +32 -52
  184. package/dist/esm/mediaImage/styled.js +2 -6
  185. package/dist/esm/mime-type-icon.js +13 -13
  186. package/dist/esm/mixins.js +0 -2
  187. package/dist/esm/modalSpinner.js +1 -3
  188. package/dist/esm/shortcut.js +3 -19
  189. package/dist/esm/truncateText.js +12 -22
  190. package/dist/esm/util.js +16 -46
  191. package/dist/esm/version.json +1 -1
  192. package/dist/types/mediaImage/index.d.ts +1 -1
  193. package/package.json +4 -4
  194. package/report.api.md +16 -1
@@ -1,24 +1,20 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
-
3
2
  var _templateObject;
4
-
5
- import { token } from '@atlaskit/tokens';
6
3
  import styled from '@emotion/styled';
7
4
  import { B300, N30A, N40A, N900 } from '@atlaskit/theme/colors';
8
5
  import { borderRadius as akBorderRadius } from '@atlaskit/theme/constants';
9
- var FONT_COLOR = token('color.text', N900);
10
- var BACKGROUND_COLOR = token('color.background.neutral', N30A);
11
- var selected = "\n cursor: pointer;\n box-shadow: 0 0 0 1px ".concat(token('color.border.selected', B300), ";\n outline: none;\n user-select: none;\n border-color: transparent;\n &, :hover, :focus, :active {\n text-decoration: none;\n }\n");
12
-
6
+ var FONT_COLOR = "var(--ds-text, ".concat(N900, ")");
7
+ var BACKGROUND_COLOR = "var(--ds-background-neutral, ".concat(N30A, ")");
8
+ var selected = "\n cursor: pointer;\n box-shadow: 0 0 0 1px ".concat("var(--ds-border-selected, ".concat(B300, ")"), ";\n outline: none;\n user-select: none;\n border-color: transparent;\n &, :hover, :focus, :active {\n text-decoration: none;\n }\n");
13
9
  var isSelected = function isSelected(_ref) {
14
10
  var isSelected = _ref.isSelected;
15
-
16
11
  if (isSelected) {
17
12
  return selected;
18
13
  } else {
19
14
  return 'user-select: text';
20
15
  }
21
16
  };
17
+
22
18
  /*
23
19
  Media Inline cards should have the following layout:
24
20
  -----------------
@@ -31,8 +27,6 @@ var isSelected = function isSelected(_ref) {
31
27
  // NB: `padding` consistent with @mentions.
32
28
  // NB: `display: inline` required for `box-decoration-break` to work.
33
29
  // NB: `box-decoration-break` required for retaining properties (border-radius) on wrap.
34
-
35
-
36
30
  export var Wrapper = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n line-height: 16px;\n padding: 2px 4px 2px 4px;\n box-decoration-break: clone;\n display: inline;\n border-radius: ", "px;\n color: ", ";\n background-color: ", ";\n ", ";\n transition: 0.1s all ease-in-out;\n -moz-user-select: none;\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n }\n"])), akBorderRadius(), FONT_COLOR, BACKGROUND_COLOR, function (props) {
37
31
  return isSelected(props);
38
- }, token('color.background.neutral.hovered', N40A));
32
+ }, "var(--ds-background-neutral-hovered, ".concat(N40A, ")"));
@@ -1,15 +1,15 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
-
3
2
  var _templateObject, _templateObject2;
3
+ import styled from '@emotion/styled';
4
4
 
5
- import styled from '@emotion/styled'; // TODO: Figure out a more scalable/responsive solution
5
+ // TODO: Figure out a more scalable/responsive solution
6
6
  // for vertical alignment.
7
7
  // Current rationale: vertically positioned at the top of
8
8
  // the smart card container (when set to 0). Offset this
9
9
  // to position it with appropriate whitespace from the top.
10
+ export var Icon = styled.img(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 14px;\n width: 14px;\n margin-right: 4px;\n border-radius: 2px;\n user-select: none;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n"])));
10
11
 
11
- export var Icon = styled.img(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 14px;\n width: 14px;\n margin-right: 4px;\n border-radius: 2px;\n user-select: none;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n"]))); // Used for 'untrue' icons which claim to be 16x16 but
12
+ // Used for 'untrue' icons which claim to be 16x16 but
12
13
  // are less than that in height/width.
13
14
  // TODO: Replace this override with proper AtlasKit solution.
14
-
15
15
  export var AKIconWrapper = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-right: -2px;\n"])));
@@ -3,55 +3,42 @@ import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _inherits from "@babel/runtime/helpers/inherits";
4
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
-
7
6
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
8
-
9
7
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10
-
11
8
  import React from 'react';
12
9
  import ImageLoader from 'react-render-image';
13
10
  import { Icon } from '../Icon';
14
11
  import { IconEmptyWrapper, IconPositionWrapper, IconTitleWrapper, IconWrapper, TitleWrapper, EmojiWrapper } from './styled';
15
12
  import LinkIcon from '@atlaskit/icon/glyph/link';
16
- import { token } from '@atlaskit/tokens';
17
13
  import { N900 } from '@atlaskit/theme/colors';
18
14
  export var IconAndTitleLayout = /*#__PURE__*/function (_React$Component) {
19
15
  _inherits(IconAndTitleLayout, _React$Component);
20
-
21
16
  var _super = _createSuper(IconAndTitleLayout);
22
-
23
17
  function IconAndTitleLayout() {
24
18
  _classCallCheck(this, IconAndTitleLayout);
25
-
26
19
  return _super.apply(this, arguments);
27
20
  }
28
-
29
21
  _createClass(IconAndTitleLayout, [{
30
22
  key: "renderAtlaskitIcon",
31
23
  value: function renderAtlaskitIcon() {
32
24
  var _this$props = this.props,
33
- icon = _this$props.icon,
34
- emoji = _this$props.emoji;
35
-
25
+ icon = _this$props.icon,
26
+ emoji = _this$props.emoji;
36
27
  if (emoji) {
37
28
  return /*#__PURE__*/React.createElement(EmojiWrapper, null, emoji);
38
29
  }
39
-
40
30
  if (!icon || typeof icon === 'string') {
41
31
  return null;
42
32
  }
43
-
44
33
  return /*#__PURE__*/React.createElement(IconWrapper, null, icon);
45
34
  }
46
35
  }, {
47
36
  key: "renderImageIcon",
48
37
  value: function renderImageIcon(errored, testId) {
49
38
  var url = this.props.icon;
50
-
51
39
  if (!url || typeof url !== 'string') {
52
40
  return null;
53
41
  }
54
-
55
42
  return /*#__PURE__*/React.createElement(ImageLoader, {
56
43
  src: url,
57
44
  loaded: /*#__PURE__*/React.createElement(Icon, {
@@ -66,11 +53,9 @@ export var IconAndTitleLayout = /*#__PURE__*/function (_React$Component) {
66
53
  key: "renderIconPlaceholder",
67
54
  value: function renderIconPlaceholder(testId) {
68
55
  var defaultIcon = this.props.defaultIcon;
69
-
70
56
  if (defaultIcon) {
71
57
  return /*#__PURE__*/React.createElement(IconWrapper, null, defaultIcon);
72
58
  }
73
-
74
59
  return /*#__PURE__*/React.createElement(IconWrapper, null, /*#__PURE__*/React.createElement(LinkIcon, {
75
60
  label: "link",
76
61
  size: "small",
@@ -85,11 +70,9 @@ export var IconAndTitleLayout = /*#__PURE__*/function (_React$Component) {
85
70
  // - Atlaskit Icon: an Atlaskit SVG;
86
71
  // Each of these are scaled down to 12x12.
87
72
  var icon = this.renderAtlaskitIcon();
88
-
89
73
  if (icon) {
90
74
  return icon;
91
75
  }
92
-
93
76
  var placeholder = this.renderIconPlaceholder(testId);
94
77
  var image = this.renderImageIcon(placeholder, testId);
95
78
  return image || placeholder;
@@ -98,18 +81,17 @@ export var IconAndTitleLayout = /*#__PURE__*/function (_React$Component) {
98
81
  key: "render",
99
82
  value: function render() {
100
83
  var _this$props2 = this.props,
101
- children = _this$props2.children,
102
- title = _this$props2.title,
103
- titleColor = _this$props2.titleColor,
104
- _this$props2$testId = _this$props2.testId,
105
- testId = _this$props2$testId === void 0 ? 'media-inline-card-icon-and-title' : _this$props2$testId;
84
+ children = _this$props2.children,
85
+ title = _this$props2.title,
86
+ titleColor = _this$props2.titleColor,
87
+ _this$props2$testId = _this$props2.testId,
88
+ testId = _this$props2$testId === void 0 ? 'media-inline-card-icon-and-title' : _this$props2$testId;
106
89
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconTitleWrapper, {
107
90
  style: {
108
- color: titleColor || token('color.text', N900)
91
+ color: titleColor || "var(--ds-text, ".concat(N900, ")")
109
92
  }
110
93
  }, /*#__PURE__*/React.createElement(IconPositionWrapper, null, children || /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconEmptyWrapper, null), this.renderIcon(testId))), /*#__PURE__*/React.createElement(TitleWrapper, null, title)));
111
94
  }
112
95
  }]);
113
-
114
96
  return IconAndTitleLayout;
115
97
  }(React.Component);
@@ -1,33 +1,37 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
-
3
2
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
3
+ import styled from '@emotion/styled';
4
4
 
5
- import styled from '@emotion/styled'; // TODO: remove this override behaviour for @atlaskit/icon-object
6
-
7
- export var IconObjectOverrides = "\n & > span {\n height: 16px;\n width: 14px;\n position: absolute;\n top: 0;\n left: 0;\n line-height: 14px;\n & > svg {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n }\n"; // TODO: remove this override behaviour for @atlaskit/icon
5
+ // TODO: remove this override behaviour for @atlaskit/icon-object
6
+ export var IconObjectOverrides = "\n & > span {\n height: 16px;\n width: 14px;\n position: absolute;\n top: 0;\n left: 0;\n line-height: 14px;\n & > svg {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n }\n";
7
+ // TODO: remove this override behaviour for @atlaskit/icon
8
+ export var IconOverrides = "\n & > * > span {\n height: 16px;\n width: 14px;\n position: absolute;\n top: 0;\n left: 0;\n & > svg {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n }\n";
8
9
 
9
- export var IconOverrides = "\n & > * > span {\n height: 16px;\n width: 14px;\n position: absolute;\n top: 0;\n left: 0;\n & > svg {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n }\n"; // Wraps all icons represented in Inline Links. Icons have three sources/types:
10
+ // Wraps all icons represented in Inline Links. Icons have three sources/types:
10
11
  // - JSON-LD: from the generator.icon property coming back from ORS.
11
12
  // - @atlaskit/icon: for lock icons, unauthorized, etc.
12
13
  // - @atlaskit/icon-object: for object icons, e.g. repository, branch, etc.
13
14
  // NB: the first set of overrides style icons imported from @atlaskit/icon-object correctly.
14
15
  // NB: the second set of overrides style icons imported from @atlaskit/icon correctly.
16
+ export var IconWrapper = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n user-select: none;\n ", "\n ", "\n"])), IconOverrides, IconObjectOverrides);
15
17
 
16
- export var IconWrapper = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n user-select: none;\n ", "\n ", "\n"])), IconOverrides, IconObjectOverrides); // Wraps all emoji in Inline Links similar to icon
18
+ // Wraps all emoji in Inline Links similar to icon
19
+ export var EmojiWrapper = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: inline-block;\n margin-right: 2px;\n user-select: none;\n ", "\n ", "\n"])), IconOverrides, IconObjectOverrides);
17
20
 
18
- export var EmojiWrapper = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: inline-block;\n margin-right: 2px;\n user-select: none;\n ", "\n ", "\n"])), IconOverrides, IconObjectOverrides); // The main 'wrapping' element, title of the content.
21
+ // The main 'wrapping' element, title of the content.
19
22
  // NB: `white-space` adds little whitespace before wrapping.
20
23
  // NB: `word-break` line breaks as soon as an overflow takes place.
24
+ export var IconTitleWrapper = styled.span(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n white-space: pre-wrap;\n word-break: break-all;\n"])));
21
25
 
22
- export var IconTitleWrapper = styled.span(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n white-space: pre-wrap;\n word-break: break-all;\n"]))); // TODO: Replace overrides with proper AtlasKit solution.
23
-
24
- export var LozengeWrapper = styled.span(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: inline-block;\n vertical-align: 1px;\n & > span {\n margin-left: 4px;\n padding: 2px 0 2px 0;\n }\n"]))); // TODO: Replace overrides with proper AtlasKit solution.
25
-
26
+ // TODO: Replace overrides with proper AtlasKit solution.
27
+ export var LozengeWrapper = styled.span(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: inline-block;\n vertical-align: 1px;\n & > span {\n margin-left: 4px;\n padding: 2px 0 2px 0;\n }\n"])));
28
+ // TODO: Replace overrides with proper AtlasKit solution.
26
29
  export var LozengeBlockWrapper = styled.span(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n & > span {\n margin-left: 4px;\n padding: 2px 0 2px 0;\n }\n"])));
27
- export var RightIconPositionWrapper = styled.span(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin-left: 2px;\n margin-right: 4px;\n position: relative;\n display: inline-block;\n"]))); // The following components are used to absolutely position icons in the vertical center.
30
+ export var RightIconPositionWrapper = styled.span(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin-left: 2px;\n margin-right: 4px;\n position: relative;\n display: inline-block;\n"])));
31
+
32
+ // The following components are used to absolutely position icons in the vertical center.
28
33
  // - IconPositionWrapper: the `relative` parent which has no height in itself.
29
34
  // - IconEmptyWrapper: the child which forces `IconPositionWrapper` to have a height.
30
-
31
35
  export var IconPositionWrapper = styled.span(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin-right: 4px;\n position: relative;\n display: inline-block;\n"])));
32
36
  export var IconEmptyWrapper = styled.span(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n width: 14px;\n height: 100%;\n display: inline-block;\n opacity: 0;\n"])));
33
37
  export var TitleWrapper = styled.span(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n ::selection {\n background: none;\n }\n"])));
@@ -3,37 +3,30 @@ import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _inherits from "@babel/runtime/helpers/inherits";
4
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
-
7
6
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
8
-
9
7
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10
-
11
8
  import React from 'react';
12
9
  import { Frame } from '../Frame';
13
10
  import { IconAndTitleLayout } from '../IconAndTitleLayout';
14
11
  export var MediaInlineCardLoadedView = /*#__PURE__*/function (_React$Component) {
15
12
  _inherits(MediaInlineCardLoadedView, _React$Component);
16
-
17
13
  var _super = _createSuper(MediaInlineCardLoadedView);
18
-
19
14
  function MediaInlineCardLoadedView() {
20
15
  _classCallCheck(this, MediaInlineCardLoadedView);
21
-
22
16
  return _super.apply(this, arguments);
23
17
  }
24
-
25
18
  _createClass(MediaInlineCardLoadedView, [{
26
19
  key: "render",
27
20
  value: function render() {
28
21
  var _this$props = this.props,
29
- _this$props$title = _this$props.title,
30
- title = _this$props$title === void 0 ? '' : _this$props$title,
31
- isSelected = _this$props.isSelected,
32
- onClick = _this$props.onClick,
33
- icon = _this$props.icon,
34
- _this$props$testId = _this$props.testId,
35
- testId = _this$props$testId === void 0 ? 'media-inline-card-loaded-view' : _this$props$testId,
36
- titlePrefix = _this$props.titlePrefix;
22
+ _this$props$title = _this$props.title,
23
+ title = _this$props$title === void 0 ? '' : _this$props$title,
24
+ isSelected = _this$props.isSelected,
25
+ onClick = _this$props.onClick,
26
+ icon = _this$props.icon,
27
+ _this$props$testId = _this$props.testId,
28
+ testId = _this$props$testId === void 0 ? 'media-inline-card-loaded-view' : _this$props$testId,
29
+ titlePrefix = _this$props.titlePrefix;
37
30
  return /*#__PURE__*/React.createElement(Frame, {
38
31
  testId: testId,
39
32
  isSelected: isSelected,
@@ -45,6 +38,5 @@ export var MediaInlineCardLoadedView = /*#__PURE__*/function (_React$Component)
45
38
  }));
46
39
  }
47
40
  }]);
48
-
49
41
  return MediaInlineCardLoadedView;
50
42
  }(React.Component);
@@ -3,11 +3,8 @@ import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _inherits from "@babel/runtime/helpers/inherits";
4
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
-
7
6
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
8
-
9
7
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10
-
11
8
  import React from 'react';
12
9
  import { Frame } from '../Frame';
13
10
  import Spinner from '@atlaskit/spinner';
@@ -16,26 +13,21 @@ import { SpinnerWrapper } from './styled';
16
13
  import { IconTitleWrapper, RightIconPositionWrapper } from '../IconAndTitleLayout/styled';
17
14
  export var MediaInlineCardLoadingView = /*#__PURE__*/function (_React$Component) {
18
15
  _inherits(MediaInlineCardLoadingView, _React$Component);
19
-
20
16
  var _super = _createSuper(MediaInlineCardLoadingView);
21
-
22
17
  function MediaInlineCardLoadingView() {
23
18
  _classCallCheck(this, MediaInlineCardLoadingView);
24
-
25
19
  return _super.apply(this, arguments);
26
20
  }
27
-
28
21
  _createClass(MediaInlineCardLoadingView, [{
29
22
  key: "render",
30
23
  value: function render() {
31
24
  var _this$props = this.props,
32
- message = _this$props.message,
33
- onClick = _this$props.onClick,
34
- isSelected = _this$props.isSelected,
35
- inlinePreloaderStyle = _this$props.inlinePreloaderStyle,
36
- _this$props$testId = _this$props.testId,
37
- testId = _this$props$testId === void 0 ? 'media-inline-card-loading-view' : _this$props$testId;
38
-
25
+ message = _this$props.message,
26
+ onClick = _this$props.onClick,
27
+ isSelected = _this$props.isSelected,
28
+ inlinePreloaderStyle = _this$props.inlinePreloaderStyle,
29
+ _this$props$testId = _this$props.testId,
30
+ testId = _this$props$testId === void 0 ? 'media-inline-card-loading-view' : _this$props$testId;
39
31
  if (inlinePreloaderStyle === 'on-right-without-skeleton') {
40
32
  return /*#__PURE__*/React.createElement(Frame, {
41
33
  testId: testId,
@@ -61,6 +53,5 @@ export var MediaInlineCardLoadingView = /*#__PURE__*/function (_React$Component)
61
53
  }
62
54
  }
63
55
  }]);
64
-
65
56
  return MediaInlineCardLoadingView;
66
57
  }(React.Component);
@@ -1,7 +1,5 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
-
3
2
  var _templateObject;
4
-
5
3
  import styled from '@emotion/styled';
6
4
  import { IconTitleWrapper } from '../IconAndTitleLayout/styled';
7
5
  export var SpinnerWrapper = styled(IconTitleWrapper)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n vertical-align: baseline;\n margin-left: 2px;\n"])));
@@ -1,8 +1,5 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
-
3
2
  var _templateObject;
4
-
5
- import { token } from '@atlaskit/tokens';
6
3
  import styled from '@emotion/styled';
7
4
  import { N200 } from '@atlaskit/theme/colors';
8
- export var NoLinkAppearance = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n"])), token('color.text.subtlest', N200));
5
+ export var NoLinkAppearance = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n"])), "var(--ds-text-subtlest, ".concat(N200, ")"));
@@ -1,16 +1,14 @@
1
1
  var webkitSupported;
2
+
2
3
  /*
3
4
  * Function to get the whether the browser is webkit supported. Mocked optional navigator purely for testing purposes
4
5
  * Memoization so that the browser is only calculated if it's not cached already
5
6
  */
6
-
7
7
  export function isWebkitSupported(mockedNavigator) {
8
8
  var navigatorUsed = mockedNavigator !== undefined ? mockedNavigator : navigator;
9
-
10
9
  if (mockedNavigator !== undefined) {
11
10
  webkitSupported = undefined;
12
11
  }
13
-
14
12
  if (webkitSupported === undefined) {
15
13
  if (typeof navigatorUsed !== 'undefined') {
16
14
  var ieEdge = /Edge\/(\d+)/.exec(navigatorUsed.userAgent);
@@ -22,9 +20,7 @@ export function isWebkitSupported(mockedNavigator) {
22
20
  var browser_supported = !ie && !opera && !firefox;
23
21
  return browser_supported;
24
22
  }
25
-
26
23
  return false;
27
24
  }
28
-
29
25
  return webkitSupported;
30
26
  }
@@ -3,42 +3,37 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
3
3
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
4
4
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
5
5
  import _createClass from "@babel/runtime/helpers/createClass";
6
-
7
6
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
8
-
9
7
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10
-
11
8
  export var Vector2 = /*#__PURE__*/function () {
12
9
  function Vector2(x, y) {
13
10
  _classCallCheck(this, Vector2);
14
-
15
11
  this.x = x;
16
12
  this.y = y;
17
13
  }
18
-
19
14
  _createClass(Vector2, [{
20
15
  key: "add",
21
16
  value: function add(_ref) {
22
17
  var thatX = _ref.x,
23
- thatY = _ref.y;
18
+ thatY = _ref.y;
24
19
  var thisX = this.x,
25
- thisY = this.y;
20
+ thisY = this.y;
26
21
  return new Vector2(thisX + thatX, thisY + thatY);
27
22
  }
28
23
  }, {
29
24
  key: "sub",
30
25
  value: function sub(_ref2) {
31
26
  var thatX = _ref2.x,
32
- thatY = _ref2.y;
27
+ thatY = _ref2.y;
33
28
  var thisX = this.x,
34
- thisY = this.y;
29
+ thisY = this.y;
35
30
  return new Vector2(thisX - thatX, thisY - thatY);
36
31
  }
37
32
  }, {
38
33
  key: "scaled",
39
34
  value: function scaled(scalar) {
40
35
  var x = this.x,
41
- y = this.y;
36
+ y = this.y;
42
37
  return new Vector2(x * scalar, y * scalar);
43
38
  }
44
39
  }, {
@@ -62,17 +57,14 @@ export var Vector2 = /*#__PURE__*/function () {
62
57
  return "[".concat(this.x, ", ").concat(this.y, "]");
63
58
  }
64
59
  }]);
65
-
66
60
  return Vector2;
67
61
  }();
68
62
  export var Rectangle = /*#__PURE__*/function () {
69
63
  function Rectangle(width, height) {
70
64
  _classCallCheck(this, Rectangle);
71
-
72
65
  this.width = width;
73
66
  this.height = height;
74
67
  }
75
-
76
68
  _createClass(Rectangle, [{
77
69
  key: "aspectRatio",
78
70
  get: function get() {
@@ -97,18 +89,18 @@ export var Rectangle = /*#__PURE__*/function () {
97
89
  key: "flipped",
98
90
  value: function flipped() {
99
91
  return new Rectangle(this.height, this.width);
100
- } // Computes the scaling factor that needs to be applied to this
92
+ }
93
+
94
+ // Computes the scaling factor that needs to be applied to this
101
95
  // Rectangle so that it
102
96
  // - is fully visible inside of the containing Rectangle
103
97
  // - is the LARGEST possible size
104
98
  // - maintains the original aspect ratio (no distortion)
105
-
106
99
  }, {
107
100
  key: "scaleToFit",
108
101
  value: function scaleToFit(containing) {
109
102
  var widthRatio = containing.width / this.width;
110
103
  var heightRatio = containing.height / this.height;
111
-
112
104
  if (widthRatio <= heightRatio) {
113
105
  return widthRatio;
114
106
  } else {
@@ -119,18 +111,18 @@ export var Rectangle = /*#__PURE__*/function () {
119
111
  key: "scaleToFitLargestSide",
120
112
  value: function scaleToFitLargestSide(containing) {
121
113
  return this.scaleToFit(containing);
122
- } // Computes the scaling factor that needs to be applied to this
114
+ }
115
+
116
+ // Computes the scaling factor that needs to be applied to this
123
117
  // Rectangle so that it
124
118
  // - is fully visible inside of the containing Rectangle
125
119
  // - is the SMALLEST possible size
126
120
  // - maintains the original aspect ratio (no distortion)
127
-
128
121
  }, {
129
122
  key: "scaleToFitSmallestSide",
130
123
  value: function scaleToFitSmallestSide(containing) {
131
124
  var widthRatio = containing.width / this.width;
132
125
  var heightRatio = containing.height / this.height;
133
-
134
126
  if (widthRatio >= heightRatio) {
135
127
  return widthRatio;
136
128
  } else {
@@ -143,19 +135,14 @@ export var Rectangle = /*#__PURE__*/function () {
143
135
  return new Rectangle(this.width, this.height);
144
136
  }
145
137
  }]);
146
-
147
138
  return Rectangle;
148
139
  }();
149
140
  export var Bounds = /*#__PURE__*/function (_Rectangle) {
150
141
  _inherits(Bounds, _Rectangle);
151
-
152
142
  var _super = _createSuper(Bounds);
153
-
154
143
  function Bounds(x, y, width, height) {
155
144
  var _this;
156
-
157
145
  _classCallCheck(this, Bounds);
158
-
159
146
  _this = _super.call(this, width, height);
160
147
  _this.x = x;
161
148
  _this.y = y;
@@ -163,7 +150,6 @@ export var Bounds = /*#__PURE__*/function (_Rectangle) {
163
150
  _this.height = height;
164
151
  return _this;
165
152
  }
166
-
167
153
  _createClass(Bounds, [{
168
154
  key: "origin",
169
155
  get: function get() {
@@ -260,17 +246,14 @@ export var Bounds = /*#__PURE__*/function (_Rectangle) {
260
246
  return this.x === bounds.x && this.y === bounds.y && this.width === bounds.width && this.height === bounds.height;
261
247
  }
262
248
  }]);
263
-
264
249
  return Bounds;
265
250
  }(Rectangle);
266
251
  export var Camera = /*#__PURE__*/function () {
267
252
  function Camera(viewport, originalImg) {
268
253
  _classCallCheck(this, Camera);
269
-
270
254
  this.viewport = viewport;
271
255
  this.originalImg = originalImg;
272
256
  }
273
-
274
257
  _createClass(Camera, [{
275
258
  key: "resizedViewport",
276
259
  value: function resizedViewport(newViewport) {
@@ -280,9 +263,10 @@ export var Camera = /*#__PURE__*/function () {
280
263
  key: "scaleToFit",
281
264
  get: function get() {
282
265
  return this.originalImg.scaleToFitLargestSide(this.viewport);
283
- } // If the image is smaller than or equal to the viewport, it won't be scaled.
284
- // If the image is larger than the viewport, it will be scaled down to fit.
266
+ }
285
267
 
268
+ // If the image is smaller than or equal to the viewport, it won't be scaled.
269
+ // If the image is larger than the viewport, it will be scaled down to fit.
286
270
  }, {
287
271
  key: "scaleDownToFit",
288
272
  get: function get() {
@@ -305,6 +289,5 @@ export var Camera = /*#__PURE__*/function () {
305
289
  return prevOffset.add(viewport.center).scaled(newScale / prevScale).sub(viewport.center);
306
290
  }
307
291
  }]);
308
-
309
292
  return Camera;
310
293
  }();