@atlaskit/smart-card 19.1.15 → 19.1.18

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 (156) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/cjs/extractors/block/index.js +2 -1
  3. package/dist/cjs/extractors/common/actions/extractPreviewAction.js +2 -1
  4. package/dist/cjs/i18n/cs.js +29 -115
  5. package/dist/cjs/i18n/da.js +31 -116
  6. package/dist/cjs/i18n/de.js +30 -116
  7. package/dist/cjs/i18n/en.js +29 -115
  8. package/dist/cjs/i18n/en_GB.js +29 -115
  9. package/dist/cjs/i18n/en_ZZ.js +10 -129
  10. package/dist/cjs/i18n/es.js +29 -115
  11. package/dist/cjs/i18n/fi.js +29 -115
  12. package/dist/cjs/i18n/fr.js +30 -116
  13. package/dist/cjs/i18n/hu.js +30 -116
  14. package/dist/cjs/i18n/it.js +29 -115
  15. package/dist/cjs/i18n/ja.js +29 -115
  16. package/dist/cjs/i18n/ko.js +29 -115
  17. package/dist/cjs/i18n/nb.js +30 -116
  18. package/dist/cjs/i18n/nl.js +29 -115
  19. package/dist/cjs/i18n/pl.js +30 -116
  20. package/dist/cjs/i18n/pt_BR.js +29 -115
  21. package/dist/cjs/i18n/ru.js +30 -116
  22. package/dist/cjs/i18n/sv.js +29 -115
  23. package/dist/cjs/i18n/th.js +29 -115
  24. package/dist/cjs/i18n/tr.js +30 -116
  25. package/dist/cjs/i18n/uk.js +29 -115
  26. package/dist/cjs/i18n/vi.js +29 -115
  27. package/dist/cjs/i18n/zh.js +30 -116
  28. package/dist/cjs/i18n/zh_TW.js +29 -115
  29. package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +12 -12
  30. package/dist/cjs/state/hooks-external/useSmartLinkActions.js +2 -1
  31. package/dist/cjs/utils/analytics/analytics.js +8 -4
  32. package/dist/cjs/version.json +1 -1
  33. package/dist/cjs/view/CardWithUrl/component-lazy/LazyFallback.js +4 -2
  34. package/dist/cjs/view/CardWithUrl/loader.js +4 -2
  35. package/dist/cjs/view/FlexibleCard/components/elements/date-time/index.js +3 -2
  36. package/dist/cjs/view/HoverCard/components/hover-card-content.js +125 -0
  37. package/dist/cjs/view/HoverCard/index.js +22 -89
  38. package/dist/cjs/view/HoverCard/utils.js +3 -1
  39. package/dist/cjs/view/LinkView/index.js +1 -1
  40. package/dist/es2019/extractors/block/index.js +2 -1
  41. package/dist/es2019/extractors/common/actions/extractPreviewAction.js +2 -2
  42. package/dist/es2019/i18n/cs.js +29 -115
  43. package/dist/es2019/i18n/da.js +31 -116
  44. package/dist/es2019/i18n/de.js +30 -116
  45. package/dist/es2019/i18n/en.js +29 -115
  46. package/dist/es2019/i18n/en_GB.js +29 -115
  47. package/dist/es2019/i18n/en_ZZ.js +10 -129
  48. package/dist/es2019/i18n/es.js +29 -115
  49. package/dist/es2019/i18n/fi.js +29 -115
  50. package/dist/es2019/i18n/fr.js +30 -116
  51. package/dist/es2019/i18n/hu.js +30 -116
  52. package/dist/es2019/i18n/it.js +29 -115
  53. package/dist/es2019/i18n/ja.js +29 -115
  54. package/dist/es2019/i18n/ko.js +29 -115
  55. package/dist/es2019/i18n/nb.js +30 -116
  56. package/dist/es2019/i18n/nl.js +29 -115
  57. package/dist/es2019/i18n/pl.js +30 -116
  58. package/dist/es2019/i18n/pt_BR.js +29 -115
  59. package/dist/es2019/i18n/ru.js +30 -116
  60. package/dist/es2019/i18n/sv.js +29 -115
  61. package/dist/es2019/i18n/th.js +29 -115
  62. package/dist/es2019/i18n/tr.js +30 -116
  63. package/dist/es2019/i18n/uk.js +29 -115
  64. package/dist/es2019/i18n/vi.js +29 -115
  65. package/dist/es2019/i18n/zh.js +30 -116
  66. package/dist/es2019/i18n/zh_TW.js +29 -115
  67. package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +4 -4
  68. package/dist/es2019/state/hooks-external/useSmartLinkActions.js +2 -1
  69. package/dist/es2019/utils/analytics/analytics.js +8 -4
  70. package/dist/es2019/version.json +1 -1
  71. package/dist/es2019/view/CardWithUrl/component-lazy/LazyFallback.js +13 -9
  72. package/dist/es2019/view/CardWithUrl/loader.js +4 -2
  73. package/dist/es2019/view/FlexibleCard/components/elements/date-time/index.js +3 -2
  74. package/dist/es2019/view/HoverCard/components/hover-card-content.js +85 -0
  75. package/dist/es2019/view/HoverCard/index.js +23 -78
  76. package/dist/es2019/view/HoverCard/utils.js +1 -0
  77. package/dist/es2019/view/LinkView/index.js +1 -1
  78. package/dist/esm/extractors/block/index.js +2 -1
  79. package/dist/esm/extractors/common/actions/extractPreviewAction.js +2 -1
  80. package/dist/esm/i18n/cs.js +29 -115
  81. package/dist/esm/i18n/da.js +31 -116
  82. package/dist/esm/i18n/de.js +30 -116
  83. package/dist/esm/i18n/en.js +29 -115
  84. package/dist/esm/i18n/en_GB.js +29 -115
  85. package/dist/esm/i18n/en_ZZ.js +10 -129
  86. package/dist/esm/i18n/es.js +29 -115
  87. package/dist/esm/i18n/fi.js +29 -115
  88. package/dist/esm/i18n/fr.js +30 -116
  89. package/dist/esm/i18n/hu.js +30 -116
  90. package/dist/esm/i18n/it.js +29 -115
  91. package/dist/esm/i18n/ja.js +29 -115
  92. package/dist/esm/i18n/ko.js +29 -115
  93. package/dist/esm/i18n/nb.js +30 -116
  94. package/dist/esm/i18n/nl.js +29 -115
  95. package/dist/esm/i18n/pl.js +30 -116
  96. package/dist/esm/i18n/pt_BR.js +29 -115
  97. package/dist/esm/i18n/ru.js +30 -116
  98. package/dist/esm/i18n/sv.js +29 -115
  99. package/dist/esm/i18n/th.js +29 -115
  100. package/dist/esm/i18n/tr.js +30 -116
  101. package/dist/esm/i18n/uk.js +29 -115
  102. package/dist/esm/i18n/vi.js +29 -115
  103. package/dist/esm/i18n/zh.js +30 -116
  104. package/dist/esm/i18n/zh_TW.js +29 -115
  105. package/dist/esm/state/analytics/useSmartLinkAnalytics.js +12 -12
  106. package/dist/esm/state/hooks-external/useSmartLinkActions.js +2 -1
  107. package/dist/esm/utils/analytics/analytics.js +8 -4
  108. package/dist/esm/version.json +1 -1
  109. package/dist/esm/view/CardWithUrl/component-lazy/LazyFallback.js +4 -2
  110. package/dist/esm/view/CardWithUrl/loader.js +4 -2
  111. package/dist/esm/view/FlexibleCard/components/elements/date-time/index.js +3 -2
  112. package/dist/esm/view/HoverCard/components/hover-card-content.js +99 -0
  113. package/dist/esm/view/HoverCard/index.js +25 -87
  114. package/dist/esm/view/HoverCard/utils.js +1 -0
  115. package/dist/esm/view/LinkView/index.js +1 -1
  116. package/dist/types/extractors/block/types.d.ts +2 -0
  117. package/dist/types/extractors/common/actions/extractPreviewAction.d.ts +2 -1
  118. package/dist/types/i18n/cs.d.ts +28 -114
  119. package/dist/types/i18n/da.d.ts +28 -113
  120. package/dist/types/i18n/de.d.ts +28 -114
  121. package/dist/types/i18n/en.d.ts +28 -114
  122. package/dist/types/i18n/en_GB.d.ts +28 -114
  123. package/dist/types/i18n/en_ZZ.d.ts +9 -128
  124. package/dist/types/i18n/es.d.ts +28 -114
  125. package/dist/types/i18n/fi.d.ts +28 -114
  126. package/dist/types/i18n/fr.d.ts +28 -114
  127. package/dist/types/i18n/hu.d.ts +28 -114
  128. package/dist/types/i18n/it.d.ts +28 -114
  129. package/dist/types/i18n/ja.d.ts +28 -114
  130. package/dist/types/i18n/ko.d.ts +28 -114
  131. package/dist/types/i18n/nb.d.ts +28 -114
  132. package/dist/types/i18n/nl.d.ts +28 -114
  133. package/dist/types/i18n/pl.d.ts +28 -114
  134. package/dist/types/i18n/pt_BR.d.ts +28 -114
  135. package/dist/types/i18n/ru.d.ts +28 -114
  136. package/dist/types/i18n/sv.d.ts +28 -114
  137. package/dist/types/i18n/th.d.ts +28 -114
  138. package/dist/types/i18n/tr.d.ts +28 -114
  139. package/dist/types/i18n/uk.d.ts +28 -114
  140. package/dist/types/i18n/vi.d.ts +28 -114
  141. package/dist/types/i18n/zh.d.ts +28 -114
  142. package/dist/types/i18n/zh_TW.d.ts +28 -114
  143. package/dist/types/state/actions/index.d.ts +2 -1
  144. package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +2 -2
  145. package/dist/types/state/hooks/useSmartLink.d.ts +3 -3
  146. package/dist/types/state/hooks-external/useSmartLinkActions.d.ts +2 -2
  147. package/dist/types/utils/analytics/analytics.d.ts +4 -4
  148. package/dist/types/view/Card/index.d.ts +1 -1
  149. package/dist/types/view/Card/types.d.ts +1 -0
  150. package/dist/types/view/CardWithUrl/types.d.ts +1 -0
  151. package/dist/types/view/FlexibleCard/components/elements/date-time/types.d.ts +4 -0
  152. package/dist/types/view/HoverCard/components/hover-card-content.d.ts +4 -0
  153. package/dist/types/view/HoverCard/types.d.ts +12 -0
  154. package/dist/types/view/HoverCard/utils.d.ts +1 -0
  155. package/dist/types/view/LinkView/index.d.ts +4 -1
  156. package/package.json +1 -1
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.default = void 0;
11
+
12
+ var _react = _interopRequireWildcard(require("react"));
13
+
14
+ var _extractMetadata2 = require("../../../extractors/hover/extractMetadata");
15
+
16
+ var _utils = require("../utils");
17
+
18
+ var _extractPreview = _interopRequireDefault(require("../../../extractors/flexible/extract-preview"));
19
+
20
+ var _constants = require("../../../constants");
21
+
22
+ var _FlexibleCard = _interopRequireDefault(require("../../FlexibleCard"));
23
+
24
+ var _blocks = require("../../FlexibleCard/components/blocks");
25
+
26
+ var _utils2 = require("../../../utils");
27
+
28
+ var _shortcut = _interopRequireDefault(require("@atlaskit/icon/glyph/shortcut"));
29
+
30
+ var _helpers = require("../../../state/helpers");
31
+
32
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
33
+
34
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
35
+
36
+ var flexibleUiOptions = {
37
+ hideElevation: true,
38
+ size: _constants.SmartLinkSize.Large,
39
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
40
+ theme: _constants.SmartLinkTheme.Black
41
+ };
42
+
43
+ var getOpenAction = function getOpenAction(url, analytics) {
44
+ return {
45
+ name: _constants.ActionName.CustomAction,
46
+ icon: /*#__PURE__*/_react.default.createElement(_shortcut.default, {
47
+ label: "open in new tab",
48
+ size: "medium"
49
+ }),
50
+ iconPosition: 'before',
51
+ onClick: function onClick() {
52
+ window.open(url, '_blank');
53
+ analytics.ui.hoverCardOpenLinkClickedEvent('card');
54
+ },
55
+ testId: 'hover-card-open-button'
56
+ };
57
+ };
58
+
59
+ var toFooterActions = function toFooterActions(cardActions) {
60
+ return cardActions.map(function (action) {
61
+ return {
62
+ content: action.text,
63
+ name: _constants.ActionName.CustomAction,
64
+ onClick: function onClick() {
65
+ return action.invoke();
66
+ },
67
+ testId: action.id
68
+ };
69
+ });
70
+ };
71
+
72
+ var HoverCardContent = function HoverCardContent(_ref) {
73
+ var _cardState$details;
74
+
75
+ var analytics = _ref.analytics,
76
+ _ref$cardActions = _ref.cardActions,
77
+ cardActions = _ref$cardActions === void 0 ? [] : _ref$cardActions,
78
+ cardState = _ref.cardState,
79
+ onResolve = _ref.onResolve,
80
+ renderers = _ref.renderers,
81
+ url = _ref.url;
82
+ (0, _react.useEffect)(function () {
83
+ // Since hover preview only render on resolved status,
84
+ // there is no need to check for statuses.
85
+ analytics.ui.renderSuccessEvent(_utils.HOVER_CARD_ANALYTICS_DISPLAY, cardState.status);
86
+ }, [analytics.ui, cardState.status]);
87
+ var extensionKey = (0, _react.useMemo)(function () {
88
+ return (0, _helpers.getExtensionKey)(cardState.details);
89
+ }, [cardState.details]);
90
+ var onClick = (0, _react.useCallback)(function (event) {
91
+ var isModifierKeyPressed = (0, _utils2.isSpecialEvent)(event);
92
+ analytics.ui.cardClickedEvent(undefined, _utils.HOVER_CARD_ANALYTICS_DISPLAY, cardState.status, undefined, undefined, isModifierKeyPressed);
93
+ }, [cardState.status, analytics.ui]);
94
+ var titleActions = (0, _react.useMemo)(function () {
95
+ return [getOpenAction(url, analytics)];
96
+ }, [url, analytics]);
97
+ var footerActions = (0, _react.useMemo)(function () {
98
+ return toFooterActions(cardActions);
99
+ }, [cardActions]); //TODO: EDM-3224 deleted simulated and use real JsonLd
100
+
101
+ var _extractMetadata = (0, _extractMetadata2.extractMetadata)((0, _utils.getSimulatedMetadata)(extensionKey)),
102
+ primary = _extractMetadata.primary,
103
+ secondary = _extractMetadata.secondary;
104
+
105
+ var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
106
+ var body = data && (0, _extractPreview.default)(data) ? /*#__PURE__*/_react.default.createElement(_blocks.PreviewBlock, null) : /*#__PURE__*/_react.default.createElement(_blocks.SnippetBlock, null);
107
+ return /*#__PURE__*/_react.default.createElement(_FlexibleCard.default, {
108
+ cardState: cardState,
109
+ onClick: onClick,
110
+ onResolve: onResolve,
111
+ renderers: renderers,
112
+ ui: flexibleUiOptions,
113
+ url: url
114
+ }, /*#__PURE__*/_react.default.createElement(_blocks.TitleBlock, {
115
+ actions: titleActions
116
+ }), /*#__PURE__*/_react.default.createElement(_blocks.MetadataBlock, {
117
+ primary: primary,
118
+ secondary: secondary
119
+ }), body, /*#__PURE__*/_react.default.createElement(_blocks.FooterBlock, {
120
+ actions: footerActions
121
+ }));
122
+ };
123
+
124
+ var _default = HoverCardContent;
125
+ exports.default = _default;
@@ -17,20 +17,12 @@ var _core = require("@emotion/core");
17
17
 
18
18
  var _react = _interopRequireWildcard(require("react"));
19
19
 
20
- var _blocks = require("../FlexibleCard/components/blocks");
21
-
22
- var _Card = require("../Card");
23
-
24
20
  var _popup = _interopRequireDefault(require("@atlaskit/popup"));
25
21
 
26
- var _constants = require("../../constants");
27
-
28
22
  var _useSmartLinkActions = require("../../state/hooks-external/useSmartLinkActions");
29
23
 
30
24
  var _styled = require("./styled");
31
25
 
32
- var _shortcut = _interopRequireDefault(require("@atlaskit/icon/glyph/shortcut"));
33
-
34
26
  var _analyticsNext = require("@atlaskit/analytics-next");
35
27
 
36
28
  var _analytics = require("../../utils/analytics");
@@ -39,14 +31,12 @@ var _store = require("../../state/store");
39
31
 
40
32
  var _analytics2 = require("../../state/analytics");
41
33
 
42
- var _helpers = require("../../state/helpers");
34
+ var _renderers = require("../../state/renderers");
43
35
 
44
- var _extractMetadata = require("../../extractors/hover/extractMetadata");
36
+ var _hoverCardContent = _interopRequireDefault(require("./components/hover-card-content"));
45
37
 
46
38
  var _utils = require("./utils");
47
39
 
48
- var _extractPreview = _interopRequireDefault(require("../../extractors/flexible/extract-preview"));
49
-
50
40
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
51
41
 
52
42
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -70,14 +60,9 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
70
60
  var fadeOutTimeoutId = (0, _react.useRef)();
71
61
  var fadeInTimeoutId = (0, _react.useRef)();
72
62
  var cardOpenTime = (0, _react.useRef)();
63
+ var renderers = (0, _renderers.useSmartLinkRenderers)();
73
64
  var linkState = (0, _store.useSmartCardState)(url);
74
65
  var analytics = (0, _analytics2.useSmartLinkAnalytics)(url, analyticsHandler, id);
75
- var extensionKey = (0, _react.useMemo)(function () {
76
- return (0, _helpers.getExtensionKey)(linkState.details);
77
- }, [linkState]);
78
- var definitionId = (0, _react.useMemo)(function () {
79
- return (0, _helpers.getDefinitionId)(linkState.details);
80
- }, [linkState]);
81
66
  var initHideCard = (0, _react.useCallback)(function () {
82
67
  if (fadeInTimeoutId.current) {
83
68
  clearTimeout(fadeInTimeoutId.current);
@@ -87,12 +72,12 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
87
72
  //Check its previously open to avoid firing events when moving between the child and hover card components
88
73
  if (isOpen === true && cardOpenTime.current) {
89
74
  var hoverTime = Date.now() - cardOpenTime.current;
90
- analytics.ui.hoverCardDismissedEvent('card', hoverTime, definitionId, extensionKey, 'mouse_hover');
75
+ analytics.ui.hoverCardDismissedEvent('card', hoverTime, 'mouse_hover');
91
76
  }
92
77
 
93
78
  setIsOpen(false);
94
79
  }, delay);
95
- }, [delay, isOpen, definitionId, extensionKey, analytics]);
80
+ }, [delay, isOpen, analytics.ui]);
96
81
  var initShowCard = (0, _react.useCallback)(function () {
97
82
  if (fadeOutTimeoutId.current) {
98
83
  clearTimeout(fadeOutTimeoutId.current);
@@ -102,78 +87,17 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
102
87
  //Check if its previously closed to avoid firing events when moving between the child and hover card components
103
88
  if (isOpen === false) {
104
89
  cardOpenTime.current = Date.now();
105
- analytics.ui.hoverCardViewedEvent('card', definitionId, extensionKey, 'mouse_hover');
90
+ analytics.ui.hoverCardViewedEvent('card', 'mouse_hover');
106
91
  }
107
92
 
108
93
  setIsOpen(true);
109
94
  }, delay);
110
- }, [delay, isOpen, definitionId, extensionKey, analytics]);
95
+ }, [delay, isOpen, analytics.ui]);
111
96
  var linkActions = (0, _useSmartLinkActions.useSmartLinkActions)({
112
97
  url: url,
113
- appearance: 'block',
98
+ appearance: _utils.HOVER_CARD_ANALYTICS_DISPLAY,
114
99
  analyticsHandler: analyticsHandler
115
100
  });
116
- var smartlinkActions = (0, _react.useMemo)(function () {
117
- return linkActions.map(function (action) {
118
- return {
119
- content: action.text,
120
- name: _constants.ActionName.CustomAction,
121
- onClick: function onClick() {
122
- return action.invoke();
123
- },
124
- testId: action.id
125
- };
126
- });
127
- }, [linkActions]);
128
- var openAction = (0, _react.useMemo)(function () {
129
- return {
130
- name: _constants.ActionName.CustomAction,
131
- icon: (0, _core.jsx)(_shortcut.default, {
132
- label: "open in new tab",
133
- size: "medium"
134
- }),
135
- iconPosition: 'before',
136
- onClick: function onClick() {
137
- window.open(url, '_blank');
138
- analytics.ui.hoverCardOpenLinkClickedEvent('card', definitionId, extensionKey);
139
- },
140
- testId: 'hover-card-open-button'
141
- };
142
- }, [url, definitionId, extensionKey, analytics]);
143
-
144
- var CardComponent = function CardComponent(_ref2) {
145
- var _linkState$details;
146
-
147
- var update = _ref2.update;
148
- //TODO: EDM-3224 deleted simulated and use real JsonLd
149
- var metadataElements = (0, _extractMetadata.extractMetadata)((0, _utils.getSimulatedMetadata)(extensionKey));
150
- var linkData = (_linkState$details = linkState.details) === null || _linkState$details === void 0 ? void 0 : _linkState$details.data;
151
- var content = (0, _extractPreview.default)(linkData) ? (0, _core.jsx)(_blocks.PreviewBlock, null) : (0, _core.jsx)(_blocks.SnippetBlock, null);
152
- return (0, _core.jsx)("div", {
153
- onMouseEnter: initShowCard,
154
- onMouseLeave: initHideCard,
155
- css: _styled.HoverCardContainer
156
- }, (0, _core.jsx)(_Card.Card, {
157
- id: id,
158
- appearance: "block",
159
- url: url,
160
- ui: {
161
- hideElevation: true,
162
- size: _constants.SmartLinkSize.Large,
163
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
164
- theme: _constants.SmartLinkTheme.Black
165
- },
166
- onResolve: update
167
- }, (0, _core.jsx)(_blocks.TitleBlock, {
168
- actions: [openAction]
169
- }), (0, _core.jsx)(_blocks.MetadataBlock, {
170
- primary: metadataElements.primary,
171
- secondary: metadataElements.secondary
172
- }), content, (0, _core.jsx)(_blocks.FooterBlock, {
173
- actions: smartlinkActions
174
- })));
175
- };
176
-
177
101
  var onClose = (0, _react.useCallback)(function () {
178
102
  return setIsOpen(false);
179
103
  }, []);
@@ -182,11 +106,20 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
182
106
  isOpen: isOpen,
183
107
  onClose: onClose,
184
108
  placement: "bottom-start",
185
- content: function content(_ref3) {
186
- var update = _ref3.update;
187
- return (0, _core.jsx)(CardComponent, {
188
- update: update
189
- });
109
+ content: function content(_ref2) {
110
+ var update = _ref2.update;
111
+ return (0, _core.jsx)("div", {
112
+ onMouseEnter: initShowCard,
113
+ onMouseLeave: initHideCard,
114
+ css: _styled.HoverCardContainer
115
+ }, (0, _core.jsx)(_hoverCardContent.default, {
116
+ analytics: analytics,
117
+ cardActions: linkActions,
118
+ cardState: linkState,
119
+ onResolve: update,
120
+ renderers: renderers,
121
+ url: url
122
+ }));
190
123
  },
191
124
  trigger: function trigger(triggerProps) {
192
125
  return (0, _core.jsx)("span", (0, _extends2.default)({}, triggerProps, {
@@ -3,7 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getSimulatedMetadata = void 0;
6
+ exports.getSimulatedMetadata = exports.HOVER_CARD_ANALYTICS_DISPLAY = void 0;
7
+ var HOVER_CARD_ANALYTICS_DISPLAY = 'flexible';
8
+ exports.HOVER_CARD_ANALYTICS_DISPLAY = HOVER_CARD_ANALYTICS_DISPLAY;
7
9
 
8
10
  var getSimulatedMetadata = function getSimulatedMetadata() {
9
11
  var extensionKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
@@ -42,7 +42,7 @@ var CardLinkView = /*#__PURE__*/function (_React$PureComponent) {
42
42
  value: function render() {
43
43
  return /*#__PURE__*/_react.default.createElement(_Frame.Frame, (0, _extends2.default)({
44
44
  withoutBackground: true
45
- }, this.props), this.props.link);
45
+ }, this.props), this.props.placeholder || this.props.link);
46
46
  }
47
47
  }]);
48
48
  return CardLinkView;
@@ -36,10 +36,11 @@ export const extractBlockActions = (props, jsonLd, opts, platform) => {
36
36
  handleInvoke,
37
37
  handleAnalytics,
38
38
  extensionKey,
39
+ source,
39
40
  testId
40
41
  } = opts;
41
42
  const actions = extractActions(jsonLd, handleInvoke);
42
- const previewAction = extractPreviewAction(extensionKey, props, jsonLd, handleInvoke, handleAnalytics, testId, platform); // The previewAction should always be the last action
43
+ const previewAction = extractPreviewAction(extensionKey, props, jsonLd, handleInvoke, handleAnalytics, testId, platform, source); // The previewAction should always be the last action
43
44
 
44
45
  if (previewAction) {
45
46
  actions.push(previewAction);
@@ -40,7 +40,7 @@ const getInvokeOpts = (key, action, source) => ({
40
40
  }
41
41
  });
42
42
 
43
- export const extractPreviewAction = (extensionKey = 'empty-object-provider', viewProps, jsonLd, handleInvoke, handleAnalytics, testId, platform) => {
43
+ export const extractPreviewAction = (extensionKey = 'empty-object-provider', viewProps, jsonLd, handleInvoke, handleAnalytics, testId, platform, source) => {
44
44
  // Extract metadata from view props & raw JSON-LD.
45
45
  const metadataFromJsonLd = getMetadataFromJsonLd(jsonLd, platform);
46
46
  const metadataFromViewProps = getMetadataFromResolvedProps(viewProps);
@@ -68,7 +68,7 @@ export const extractPreviewAction = (extensionKey = 'empty-object-provider', vie
68
68
  }); // Setup props to go through proper Redux 'invocation' flow
69
69
  // for analytics, further state management if required in future.
70
70
 
71
- const previewActionProps = getInvokeOpts(key, 'PreviewAction', 'block'); // - Promise invoked by the action invocation handler; open preview.
71
+ const previewActionProps = getInvokeOpts(key, 'PreviewAction', source !== null && source !== void 0 ? source : 'block'); // - Promise invoked by the action invocation handler; open preview.
72
72
 
73
73
  previewActionProps.action.promise = previewAction.promise; // - Promise invoked on click of `Preview` on block card; trigger above promise.
74
74
 
@@ -6,152 +6,66 @@
6
6
  */
7
7
  //Czech
8
8
  export default {
9
- 'fabric.linking.cannot_connect': 'Nelze se připojit, zkuste to znovu.',
10
- 'fabric.linking.cannot_find_link': 'Nepodařilo se najít odkaz.',
11
- 'fabric.linking.join_to_view': 'Chcete-li si zobrazit tento požadavek, připojte se ke službě {context}.',
12
- 'fabric.linking.create_on': 'Vytvořeno {context}',
13
- 'fabric.linking.created_by': 'Vytvořil(a) {context}',
14
- 'fabric.linking.delete': 'Odstranit',
15
- 'fabric.linking.edit': 'Upravit',
16
- 'fabric.linking.forbidden_access': 'Přístup byl odepřen',
17
- 'fabric.linking.restricted_link': 'Omezený odkaz, zkuste jiný účet.',
18
- 'fabric.linking.modified_on': 'Aktualizováno {context}',
19
- 'fabric.linking.pending_request': 'Vaše žádost o přístup čeká na vyřízení.',
20
- 'fabric.linking.priority_blocker': 'Blokující',
21
- 'fabric.linking.priority_critical': 'Kritická',
22
- 'fabric.linking.priority_high': 'Vysoká',
23
- 'fabric.linking.priority_highest': 'Nejvyšší',
24
- 'fabric.linking.priority_low': 'Nízká',
25
- 'fabric.linking.priority_lowest': 'Nejnižší',
26
- 'fabric.linking.priority_major': 'Vysoká',
27
- 'fabric.linking.priority_medium': 'Střední',
28
- 'fabric.linking.priority_minor': 'Nízká',
29
- 'fabric.linking.priority_trivial': 'Triviální',
30
- 'fabric.linking.priority_undefined': 'Nedefinováno',
31
- 'fabric.linking.request_access_to_view': 'Chcete-li si zobrazit tento požadavek, požádejte o přístup ke službě {context}.',
32
- 'fabric.linking.request_denied': 'Vaše žádost o přístup byla odmítnuta.',
33
- 'fabric.linking.updated_by': 'Upravil(a) {context}',
34
- 'fabric.linking.accounts': 'Účty',
35
9
  'fabric.linking.actions': 'Akce',
36
10
  'fabric.linking.add_account': 'Přidat účet',
37
- 'fabric.linking.annotate': 'Přidat poznámku',
38
- 'fabric.linking.annotate.confirmation.close.anyway': 'Přesto zavřít',
39
- 'fabric.linking.annotate.confirmation.content': 'Máte nějaké neuložené změny. Opravdu chcete odejít?',
40
- 'fabric.linking.annotate.confirmation.heading': 'Neuložené změny',
41
- 'fabric.linking.annotate.tool.arrow': 'Šipka',
42
- 'fabric.linking.annotate.tool.blur': 'Rozostření',
43
- 'fabric.linking.annotate.tool.brush': 'Štětec',
44
- 'fabric.linking.annotate.tool.color': 'Barva',
45
- 'fabric.linking.annotate.tool.line.thickness': 'Tloušťka čáry',
46
- 'fabric.linking.annotate.tool.shape': 'Tvar',
47
- 'fabric.linking.annotate.tool.text': 'Text',
48
- 'fabric.linking.archive': 'archivovat',
49
- 'fabric.linking.audio': 'zvuk',
50
11
  'fabric.linking.cancel': 'Zrušit',
51
- 'fabric.linking.cant_preview_file_type': 'Nemůžeme zobrazit náhled tohoto typu souboru.',
52
- 'fabric.linking.cant_retrieve_files': 'Jejda! Nepodařilo se nám načíst žádné soubory.',
53
- 'fabric.linking.cant_retrieve_gifs': 'Nepodařilo se nám dohledat žádné GIFy.',
54
- 'fabric.linking.change_view': 'Změnit zobrazení',
55
- 'fabric.linking.check_your_network': 'Zkontrolujte své připojení k síti.',
12
+ 'fabric.linking.cannot_connect': 'Nelze se připojit, zkuste to znovu.',
13
+ 'fabric.linking.cannot_find_link': 'Nepodařilo se najít odkaz.',
56
14
  'fabric.linking.click_to_join': 'Připojte se k {context}',
57
15
  'fabric.linking.click_to_join_description': 'Byli jste schváleni, takže se můžete okamžitě připojit k řešení {context}.',
58
16
  'fabric.linking.close': 'Zavřít',
59
- 'fabric.linking.close_and_reopen': 'Zkuste tento soubor zavřít a znovu otevřít.',
60
17
  'fabric.linking.connect_account_description': 'Otevřeme novou stránku, abychom vám pomohli připojit váš {name} účet.',
61
18
  'fabric.linking.connect_link_account': 'Pokud chcete zobrazit náhled, připojte svůj účet',
62
19
  'fabric.linking.connect_link_account_card_view': 'Připojit',
63
20
  'fabric.linking.connect_link_account_card_view_description': 'Pokud chcete zobrazit náhled tohoto odkazu, připojte svůj účet {context}.',
64
21
  'fabric.linking.connect_link_account_card_view_name': 'Připojte svůj účet {context}',
65
22
  'fabric.linking.connect_to': 'Připojit k {name}',
66
- 'fabric.linking.could_not_load_editor': 'Editor se nepodařilo načíst.',
67
- 'fabric.linking.could_not_save_image': 'Obrázek se nepodařilo uložit.',
68
- 'fabric.linking.couldnt_generate_encrypted_entry_preview': 'Náhled souborů chráněných šifrováním nebo heslem nelze zobrazit.',
69
- 'fabric.linking.couldnt_generate_preview': 'Náhled tohoto souboru se nepodařilo vytvořit.',
70
- 'fabric.linking.couldnt_load_file': 'Soubor se nepodařilo načíst.',
71
23
  'fabric.linking.couldnt_load_link': 'Tento odkaz se z neznámého důvodu nepodařilo načíst.',
72
- 'fabric.linking.creating_preview': 'Vytváří se náhled…',
73
- 'fabric.linking.default_avatars': 'Výchozí avatary',
74
- 'fabric.linking.disable_fullscreen': 'zakázat zobrazení na celou obrazovku',
75
- 'fabric.linking.display_thumbnail': 'Zobrazit miniaturu',
76
- 'fabric.linking.document': 'dokument',
24
+ 'fabric.linking.create_on_absolute': 'Vytvořeno: {context}',
25
+ 'fabric.linking.create_on_relative': 'Vytvořeno: {context}',
26
+ 'fabric.linking.created_by': 'Vytvořil(a) {context}',
27
+ 'fabric.linking.delete': 'Odstranit',
77
28
  'fabric.linking.download': 'Stáhnout',
78
- 'fabric.linking.drag_and_drop_images_here': 'Přetáhněte své obrázky sem.',
79
- 'fabric.linking.drag_and_drop_your_files': 'Přetáhněte své soubory kamkoli na stránku nebo',
80
- 'fabric.linking.drag_and_drop_your_files_and_folders': 'Přetáhněte své soubory a složky kamkoli na stránku nebo',
81
- 'fabric.linking.drop_your_files': 'Chcete-li nahrát soubory, přetáhněte je sem',
82
- 'fabric.linking.drop_your_files_here': 'Přetáhněte své soubory sem.',
83
- 'fabric.linking.email': 'E-mail',
84
- 'fabric.linking.enable_fullscreen': 'povolit zobrazení na celou obrazovku',
85
- 'fabric.linking.error_429': 'Chyba 429',
86
- 'fabric.linking.error_generating_preview': 'Chyba při vytváření náhledu',
87
- 'fabric.linking.error_hint_critical': 'Pokud problém přetrvává, kontaktujte podporu.',
88
- 'fabric.linking.error_hint_retry': 'Zkuste to znovu a my se o to také pokusíme.',
89
- 'fabric.linking.error_loading_file': 'Chyba při načítání souboru',
90
- 'fabric.linking.failed_to_load': 'Nepodařilo se načíst',
91
- 'fabric.linking.failed_to_upload': 'Nahrání se nezdařilo',
29
+ 'fabric.linking.edit': 'Upravit',
30
+ 'fabric.linking.forbidden_access': 'Přístup byl odepřen',
92
31
  'fabric.linking.forbidden_description': 'K tomuto náhledu nemáte přístup. Pokud potřebujete přístup, obraťte se na správce webu.',
93
- 'fabric.linking.give_feedback': 'Váš názor',
94
- 'fabric.linking.image': 'obrázek',
95
- 'fabric.linking.image_format_invalid_error': 'Nepodařilo se nahrát obrázek, formát je neplatný.',
96
- 'fabric.linking.image_size_too_large_error': 'Obrázek je příliš velký. Maximální velikost je {MAX_SIZE_MB} MB.',
97
- 'fabric.linking.image_url_invalid_error': 'Nepodařilo se nahrát obrázek, adresa URL je neplatná.',
98
- 'fabric.linking.insert_files': '{0, plural, one {Vložit {0} soubor} few {Vložit {0} soubory} many {Vložit {0} souboru} other {Vložit {0} souborů}}',
99
32
  'fabric.linking.invalid_permissions': 'Omezený odkaz',
100
33
  'fabric.linking.invalid_permissions_description': 'Pokud si chcete zobrazit tento náhled, požádejte o přístup nebo vyzkoušejte jiný účet.',
101
- 'fabric.linking.item_not_found_in_list': 'Vybraná položka nebyla v tomto seznamu nalezena.',
102
- 'fabric.linking.learn_more': 'Další informace',
103
- 'fabric.linking.load_more_gifs': 'Nahrát více GIFů',
34
+ 'fabric.linking.join_to_view': 'Chcete-li si zobrazit tento požadavek, připojte se ke službě {context}.',
104
35
  'fabric.linking.loading': 'Načítání…',
105
- 'fabric.linking.loading_file': 'Načítání souboru…',
106
- 'fabric.linking.might_be_a_hiccup': 'Chybička se vloudila, ale nevíme kam.',
107
- 'fabric.linking.no_gifs_found': 'Haló? Hledali jste mě?',
108
- 'fabric.linking.no_gifs_found_suggestion': 'Pro výraz „{query}“ jsme nic nenašli.',
109
- 'fabric.linking.no_pdf_artifacts': 'Pro tento soubor nebyly nalezeny žádné PDF artefakty.',
36
+ 'fabric.linking.modified_on_absolute': 'Aktualizováno: {context}',
37
+ 'fabric.linking.modified_on_relative': 'Aktualizováno: {context}',
38
+ 'fabric.linking.more_actions': 'Další akce',
110
39
  'fabric.linking.not_found_description': 'Odkaz se nepodařilo najít. Zkontrolujte adresu URL a zkuste ji upravit nebo vložit znovu.',
111
40
  'fabric.linking.not_found_title': 'Jejda. Tento odkaz se nepodařilo najít.',
112
- 'fabric.linking.or': 'nebo',
113
- 'fabric.linking.pause': 'Pozastavit',
114
- 'fabric.linking.play': 'Přehrát',
115
- 'fabric.linking.playback_default_speed': 'Výchozí',
116
- 'fabric.linking.playback_speed': 'Rychlost přehrávání',
41
+ 'fabric.linking.pending_request': 'Vaše žádost o přístup čeká na vyřízení.',
117
42
  'fabric.linking.preview': 'Náhled',
118
- 'fabric.linking.preview_currently_unavailable': 'Náhled aktuálně není k dispozici',
119
- 'fabric.linking.preview_unavailable': 'Náhled není k dispozici',
120
- 'fabric.linking.recent_uploads': 'Nedávno nahráno',
121
- 'fabric.linking.remove_image': 'Odstranit obrázek',
43
+ 'fabric.linking.priority_blocker': 'Blokující',
44
+ 'fabric.linking.priority_critical': 'Kritická',
45
+ 'fabric.linking.priority_high': 'Vysoká',
46
+ 'fabric.linking.priority_highest': 'Nejvyšší',
47
+ 'fabric.linking.priority_low': 'Nízká',
48
+ 'fabric.linking.priority_lowest': 'Nejnižší',
49
+ 'fabric.linking.priority_major': 'Vysoká',
50
+ 'fabric.linking.priority_medium': 'Střední',
51
+ 'fabric.linking.priority_minor': 'Nízká',
52
+ 'fabric.linking.priority_trivial': 'Triviální',
53
+ 'fabric.linking.priority_undefined': 'Nedefinováno',
122
54
  'fabric.linking.request_access': 'Požádat o přístup',
123
55
  'fabric.linking.request_access_description': 'Pokud si chcete zobrazit tento náhled, požádejte o přístup k řešení {context}.',
124
56
  'fabric.linking.request_access_pending': 'Čeká se na vyřízení přístupu',
125
57
  'fabric.linking.request_access_pending_description': 'Vaše žádost o přístup čeká na vyřízení.',
58
+ 'fabric.linking.request_access_to_view': 'Chcete-li si zobrazit tento požadavek, požádejte o přístup ke službě {context}.',
59
+ 'fabric.linking.request_denied': 'Vaše žádost o přístup byla odmítnuta.',
126
60
  'fabric.linking.request_denied_description': 'Vaše žádost o přístup byla odmítnuta. Pokud stále potřebujete přístup, obraťte se na správce webu.',
61
+ 'fabric.linking.restricted_link': 'Omezený odkaz, zkuste jiný účet.',
127
62
  'fabric.linking.retry': 'Zkusit znovu',
128
63
  'fabric.linking.save': 'Uložit',
129
- 'fabric.linking.search': 'vyhledat',
130
- 'fabric.linking.search_all_gifs': 'Prohledejte všechny GIFy!',
131
- 'fabric.linking.share_files_instantly': 'Okamžitě je nasdílíme.',
132
- 'fabric.linking.skip_backward': 'Zpět o 10 sekund',
133
- 'fabric.linking.skip_forward': 'Dopředu o 10 sekund',
134
- 'fabric.linking.something_went_wrong': 'Něco se pokazilo.',
135
64
  'fabric.linking.srclink': 'Zobrazit v',
136
65
  'fabric.linking.srclinkunknown': 'Zobrazit originál',
137
- 'fabric.linking.text': 'text',
138
66
  'fabric.linking.try_again': 'Zkusit znovu',
139
67
  'fabric.linking.try_another_account': 'Zkuste jiný účet',
140
- 'fabric.linking.try_downloading_file': 'Pokud chcete soubor zobrazit, zkuste ho stáhnout.',
141
- 'fabric.linking.unable_to_annotate_image': 'K tomuto obrázku nemůžete přidávat poznámky.',
142
- 'fabric.linking.unknown': 'neznámé',
143
68
  'fabric.linking.unlink_account': 'Odpojit účet',
144
- 'fabric.linking.upload': 'Nahrát',
145
- 'fabric.linking.upload_an_avatar': 'Nahrát avatar',
146
- 'fabric.linking.upload_file': 'Nahrát soubor',
147
- 'fabric.linking.upload_file_from': 'Nahrát soubor z: {name}',
148
- 'fabric.linking.upload_image': 'Nahrát obrázek',
149
- 'fabric.linking.upload_photo': 'Nahrát fotku',
150
- 'fabric.linking.video': 'video',
151
- 'fabric.linking.view': 'Zobrazit',
152
- 'fabric.linking.viewer_rateLimited': 'Při načítání vašeho souboru došlo k potížím.',
153
- 'fabric.linking.webgl_warning_description': 'Váš prohlížeč nepodporuje knihovnu WebGL. Chcete-li přidávat k obrázkům poznámky, použijte prohlížeč, který ji podporuje.',
154
- 'fabric.linking.zip_entry_load_failed': 'Načtení daného souboru ZIP potřebného k náhledu se nezdařilo',
155
- 'fabric.linking.zoom_in': 'přiblížit',
156
- 'fabric.linking.zoom_out': 'oddálit'
69
+ 'fabric.linking.updated_by': 'Upravil(a) {context}',
70
+ 'fabric.linking.view': 'Zobrazit'
157
71
  };