@atlaskit/smart-card 23.6.1 → 23.6.3

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 (28) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/extractors/common/actions/extractPreviewAction.js +2 -2
  3. package/dist/cjs/messages.js +5 -0
  4. package/dist/cjs/state/hooks-external/useSmartLinkActions.js +27 -5
  5. package/dist/cjs/version.json +1 -1
  6. package/dist/cjs/view/BlockCard/actions/PreviewAction.js +3 -3
  7. package/dist/cjs/view/HoverCard/components/HoverCardContent.js +5 -0
  8. package/dist/cjs/view/HoverCard/utils.js +3 -1
  9. package/dist/es2019/extractors/common/actions/extractPreviewAction.js +3 -1
  10. package/dist/es2019/messages.js +5 -0
  11. package/dist/es2019/state/hooks-external/useSmartLinkActions.js +25 -4
  12. package/dist/es2019/version.json +1 -1
  13. package/dist/es2019/view/BlockCard/actions/PreviewAction.js +2 -1
  14. package/dist/es2019/view/HoverCard/components/HoverCardContent.js +3 -0
  15. package/dist/es2019/view/HoverCard/utils.js +3 -1
  16. package/dist/esm/extractors/common/actions/extractPreviewAction.js +2 -2
  17. package/dist/esm/messages.js +5 -0
  18. package/dist/esm/state/hooks-external/useSmartLinkActions.js +27 -6
  19. package/dist/esm/version.json +1 -1
  20. package/dist/esm/view/BlockCard/actions/PreviewAction.js +3 -3
  21. package/dist/esm/view/HoverCard/components/HoverCardContent.js +3 -0
  22. package/dist/esm/view/HoverCard/utils.js +3 -1
  23. package/dist/types/messages.d.ts +1 -1
  24. package/dist/types/model/invoke-opts.d.ts +1 -1
  25. package/dist/types/state/hooks-external/useSmartLinkActions.d.ts +5 -1
  26. package/dist/types/view/BlockCard/components/Action.d.ts +1 -1
  27. package/dist/types/view/Card/index.d.ts +1 -1
  28. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 23.6.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b3c2a297df4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b3c2a297df4) - Hover Preview: Actionable element experiment: Reload link after embed view modal is closed
8
+
9
+ ## 23.6.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [`ac756b23886`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ac756b23886) - Added tooltip for open link in new tab button in hover card
14
+
3
15
  ## 23.6.1
4
16
 
5
17
  ### Patch Changes
@@ -100,8 +100,8 @@ var extractPreviewAction = function extractPreviewAction(_ref) {
100
100
 
101
101
  previewActionProps.action.promise = previewAction.promise; // - Promise invoked on click of `Preview` on block card; trigger above promise.
102
102
 
103
- previewAction.promise = function () {
104
- return handleInvoke(previewActionProps);
103
+ previewAction.promise = function (opts) {
104
+ return handleInvoke(_objectSpread(_objectSpread({}, previewActionProps), opts));
105
105
  };
106
106
 
107
107
  return previewAction;
@@ -183,6 +183,11 @@ var messages = (0, _reactIntlNext.defineMessages)({
183
183
  defaultMessage: "Uh oh. We can't find this link!",
184
184
  description: 'Error case for when a provided link is not found'
185
185
  },
186
+ open_link_in_a_new_tab: {
187
+ id: 'fabric.linking.open_link_in_a_new_tab',
188
+ defaultMessage: 'Open link in a new tab',
189
+ description: 'Click to open link in a new tab'
190
+ },
186
191
  preview: {
187
192
  id: 'fabric.linking.preview',
188
193
  defaultMessage: 'Full screen view',
@@ -23,6 +23,8 @@ var _store = require("../store");
23
23
 
24
24
  var _helpers = require("../helpers");
25
25
 
26
+ var _linkProvider = require("@atlaskit/link-provider");
27
+
26
28
  function useSmartLinkActions(_ref) {
27
29
  var url = _ref.url,
28
30
  appearance = _ref.appearance,
@@ -41,16 +43,36 @@ function useSmartLinkActions(_ref) {
41
43
 
42
44
  var linkState = (0, _store.useSmartCardState)(url);
43
45
  var linkAnalytics = (0, _analytics.useSmartLinkAnalytics)(url, analyticsHandler, id);
44
- var linkActions = (0, _actions.useSmartCardActions)(id, url, linkAnalytics);
46
+ var linkActions = (0, _actions.useSmartCardActions)(id, url, linkAnalytics); // Start: Smart ink Actions experiment
47
+
48
+ var enableActionableElement = (0, _linkProvider.useFeatureFlag)('enableActionableElement');
49
+ var reload = (0, _react.useCallback)(function () {
50
+ return linkActions.reload();
51
+ }, [linkActions]);
52
+ var handleInvoke = (0, _react.useCallback)(function (opts) {
53
+ var _opts$action;
54
+
55
+ if (enableActionableElement && opts.type === 'client' && opts.isReloadRequired && ((_opts$action = opts.action) === null || _opts$action === void 0 ? void 0 : _opts$action.type) === 'PreviewAction') {
56
+ // Reload when embed preview modal close
57
+ var promise = opts.action.promise;
58
+
59
+ opts.action.promise = function () {
60
+ return promise({
61
+ onClose: reload
62
+ });
63
+ };
64
+ }
65
+
66
+ return linkActions.invoke(opts, appearance);
67
+ }, [appearance, enableActionableElement, linkActions, reload]); // End: Smart ink Actions experiment
68
+
45
69
  (0, _react.useEffect)(function () {
46
70
  if (!linkState.details) {
47
71
  return;
48
72
  }
49
73
 
50
74
  var cardProperties = (0, _block.extractBlockProps)(linkState.details.data, linkState.details.meta, {
51
- handleInvoke: function handleInvoke(opts) {
52
- return linkActions.invoke(opts, appearance);
53
- },
75
+ handleInvoke: handleInvoke,
54
76
  analytics: linkAnalytics,
55
77
  origin: origin,
56
78
  extensionKey: (0, _helpers.getExtensionKey)(linkState.details),
@@ -69,6 +91,6 @@ function useSmartLinkActions(_ref) {
69
91
  };
70
92
  });
71
93
  setActions(cardActions);
72
- }, [linkState, linkActions, linkAnalytics, appearance, platform, origin]);
94
+ }, [linkState, linkActions, linkAnalytics, appearance, platform, origin, handleInvoke]);
73
95
  return actions;
74
96
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "23.6.1",
3
+ "version": "23.6.3",
4
4
  "sideEffects": false
5
5
  }
@@ -115,14 +115,14 @@ var _default = function _default(_ref2) {
115
115
  return {
116
116
  id: 'preview-content',
117
117
  text: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.preview),
118
- promise: function promise() {
119
- return previewFunction(_objectSpread({
118
+ promise: function promise(props) {
119
+ return previewFunction(_objectSpread(_objectSpread({
120
120
  popupMountPointId: 'twp-editor-preview-iframe',
121
121
  providerName: 'Preview',
122
122
  showModal: true,
123
123
  iframeName: 'twp-editor-preview-iframe',
124
124
  onClose: function onClose() {}
125
- }, rest));
125
+ }, props), rest));
126
126
  }
127
127
  };
128
128
  };
@@ -33,6 +33,10 @@ var _unauthorised = _interopRequireDefault(require("./views/unauthorised"));
33
33
 
34
34
  var _resolved = _interopRequireDefault(require("./views/resolved"));
35
35
 
36
+ var _reactIntlNext = require("react-intl-next");
37
+
38
+ var _messages = require("../../../messages");
39
+
36
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); }
37
41
 
38
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; }
@@ -55,6 +59,7 @@ var getOpenAction = function getOpenAction(url, analytics, onActionClick) {
55
59
  previewDisplay: 'card'
56
60
  });
57
61
  },
62
+ tooltipMessage: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.open_link_in_a_new_tab),
58
63
  testId: 'hover-card-open-button'
59
64
  };
60
65
  };
@@ -121,7 +121,9 @@ var toActionableMetadata = function toActionableMetadata(onActionClick, extensio
121
121
  onActionClick(previewAction.id);
122
122
  }
123
123
 
124
- return previewAction.invoke();
124
+ return previewAction.invoke({
125
+ isReloadRequired: true
126
+ });
125
127
  }
126
128
  }) : elementItem;
127
129
  });
@@ -76,7 +76,9 @@ export const extractPreviewAction = ({
76
76
 
77
77
  previewActionProps.action.promise = previewAction.promise; // - Promise invoked on click of `Preview` on block card; trigger above promise.
78
78
 
79
- previewAction.promise = () => handleInvoke(previewActionProps);
79
+ previewAction.promise = opts => handleInvoke({ ...previewActionProps,
80
+ ...opts
81
+ });
80
82
 
81
83
  return previewAction;
82
84
  }
@@ -175,6 +175,11 @@ export const messages = defineMessages({
175
175
  defaultMessage: "Uh oh. We can't find this link!",
176
176
  description: 'Error case for when a provided link is not found'
177
177
  },
178
+ open_link_in_a_new_tab: {
179
+ id: 'fabric.linking.open_link_in_a_new_tab',
180
+ defaultMessage: 'Open link in a new tab',
181
+ description: 'Click to open link in a new tab'
182
+ },
178
183
  preview: {
179
184
  id: 'fabric.linking.preview',
180
185
  defaultMessage: 'Full screen view',
@@ -1,10 +1,11 @@
1
- import { useEffect, useMemo, useState } from 'react';
1
+ import { useCallback, useEffect, useMemo, useState } from 'react';
2
2
  import uuid from 'uuid';
3
3
  import { extractBlockProps as extractCardProps } from '../../extractors/block';
4
4
  import { useSmartCardActions as useLinkActions } from '../actions';
5
5
  import { useSmartLinkAnalytics as useLinkAnalytics } from '../analytics';
6
6
  import { useSmartCardState as useLinkState } from '../store';
7
7
  import { getExtensionKey } from '../helpers';
8
+ import { useFeatureFlag } from '@atlaskit/link-provider';
8
9
  export function useSmartLinkActions({
9
10
  url,
10
11
  appearance,
@@ -16,14 +17,34 @@ export function useSmartLinkActions({
16
17
  const [actions, setActions] = useState([]);
17
18
  const linkState = useLinkState(url);
18
19
  const linkAnalytics = useLinkAnalytics(url, analyticsHandler, id);
19
- const linkActions = useLinkActions(id, url, linkAnalytics);
20
+ const linkActions = useLinkActions(id, url, linkAnalytics); // Start: Smart ink Actions experiment
21
+
22
+ const enableActionableElement = useFeatureFlag('enableActionableElement');
23
+ const reload = useCallback(() => linkActions.reload(), [linkActions]);
24
+ const handleInvoke = useCallback(opts => {
25
+ var _opts$action;
26
+
27
+ if (enableActionableElement && opts.type === 'client' && opts.isReloadRequired && ((_opts$action = opts.action) === null || _opts$action === void 0 ? void 0 : _opts$action.type) === 'PreviewAction') {
28
+ // Reload when embed preview modal close
29
+ const {
30
+ promise
31
+ } = opts.action;
32
+
33
+ opts.action.promise = () => promise({
34
+ onClose: reload
35
+ });
36
+ }
37
+
38
+ return linkActions.invoke(opts, appearance);
39
+ }, [appearance, enableActionableElement, linkActions, reload]); // End: Smart ink Actions experiment
40
+
20
41
  useEffect(() => {
21
42
  if (!linkState.details) {
22
43
  return;
23
44
  }
24
45
 
25
46
  const cardProperties = extractCardProps(linkState.details.data, linkState.details.meta, {
26
- handleInvoke: opts => linkActions.invoke(opts, appearance),
47
+ handleInvoke,
27
48
  analytics: linkAnalytics,
28
49
  origin,
29
50
  extensionKey: getExtensionKey(linkState.details),
@@ -40,6 +61,6 @@ export function useSmartLinkActions({
40
61
  invoke: action.promise
41
62
  }));
42
63
  setActions(cardActions);
43
- }, [linkState, linkActions, linkAnalytics, appearance, platform, origin]);
64
+ }, [linkState, linkActions, linkAnalytics, appearance, platform, origin, handleInvoke]);
44
65
  return actions;
45
66
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "23.6.1",
3
+ "version": "23.6.3",
4
4
  "sideEffects": false
5
5
  }
@@ -55,12 +55,13 @@ export default (({
55
55
  }) => ({
56
56
  id: 'preview-content',
57
57
  text: /*#__PURE__*/React.createElement(FormattedMessage, messages.preview),
58
- promise: () => previewFunction({
58
+ promise: props => previewFunction({
59
59
  popupMountPointId: 'twp-editor-preview-iframe',
60
60
  providerName: 'Preview',
61
61
  showModal: true,
62
62
  iframeName: 'twp-editor-preview-iframe',
63
63
  onClose: () => {},
64
+ ...props,
64
65
  ...rest
65
66
  })
66
67
  }));
@@ -10,6 +10,8 @@ import { getSimulatedMetadata, SMART_CARD_ANALYTICS_DISPLAY } from '../utils';
10
10
  import HoverCardLoadingView from './views/resolving';
11
11
  import HoverCardUnauthorisedView from './views/unauthorised';
12
12
  import HoverCardResolvedView from './views/resolved';
13
+ import { FormattedMessage } from 'react-intl-next';
14
+ import { messages } from '../../../messages';
13
15
  export const getOpenAction = (url, analytics, onActionClick) => ({
14
16
  name: ActionName.CustomAction,
15
17
  icon: /*#__PURE__*/React.createElement(ShortcutIcon, {
@@ -27,6 +29,7 @@ export const getOpenAction = (url, analytics, onActionClick) => ({
27
29
  previewDisplay: 'card'
28
30
  });
29
31
  },
32
+ tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.open_link_in_a_new_tab),
30
33
  testId: 'hover-card-open-button'
31
34
  });
32
35
 
@@ -90,7 +90,9 @@ export const toActionableMetadata = (onActionClick, extensionKey, types = [], ca
90
90
  onActionClick(previewAction.id);
91
91
  }
92
92
 
93
- return previewAction.invoke();
93
+ return previewAction.invoke({
94
+ isReloadRequired: true
95
+ });
94
96
  }
95
97
  } : elementItem);
96
98
  }
@@ -89,8 +89,8 @@ export var extractPreviewAction = function extractPreviewAction(_ref) {
89
89
 
90
90
  previewActionProps.action.promise = previewAction.promise; // - Promise invoked on click of `Preview` on block card; trigger above promise.
91
91
 
92
- previewAction.promise = function () {
93
- return handleInvoke(previewActionProps);
92
+ previewAction.promise = function (opts) {
93
+ return handleInvoke(_objectSpread(_objectSpread({}, previewActionProps), opts));
94
94
  };
95
95
 
96
96
  return previewAction;
@@ -175,6 +175,11 @@ export var messages = defineMessages({
175
175
  defaultMessage: "Uh oh. We can't find this link!",
176
176
  description: 'Error case for when a provided link is not found'
177
177
  },
178
+ open_link_in_a_new_tab: {
179
+ id: 'fabric.linking.open_link_in_a_new_tab',
180
+ defaultMessage: 'Open link in a new tab',
181
+ description: 'Click to open link in a new tab'
182
+ },
178
183
  preview: {
179
184
  id: 'fabric.linking.preview',
180
185
  defaultMessage: 'Full screen view',
@@ -1,11 +1,12 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import { useEffect, useMemo, useState } from 'react';
2
+ import { useCallback, useEffect, useMemo, useState } from 'react';
3
3
  import uuid from 'uuid';
4
4
  import { extractBlockProps as extractCardProps } from '../../extractors/block';
5
5
  import { useSmartCardActions as useLinkActions } from '../actions';
6
6
  import { useSmartLinkAnalytics as useLinkAnalytics } from '../analytics';
7
7
  import { useSmartCardState as useLinkState } from '../store';
8
8
  import { getExtensionKey } from '../helpers';
9
+ import { useFeatureFlag } from '@atlaskit/link-provider';
9
10
  export function useSmartLinkActions(_ref) {
10
11
  var url = _ref.url,
11
12
  appearance = _ref.appearance,
@@ -24,16 +25,36 @@ export function useSmartLinkActions(_ref) {
24
25
 
25
26
  var linkState = useLinkState(url);
26
27
  var linkAnalytics = useLinkAnalytics(url, analyticsHandler, id);
27
- var linkActions = useLinkActions(id, url, linkAnalytics);
28
+ var linkActions = useLinkActions(id, url, linkAnalytics); // Start: Smart ink Actions experiment
29
+
30
+ var enableActionableElement = useFeatureFlag('enableActionableElement');
31
+ var reload = useCallback(function () {
32
+ return linkActions.reload();
33
+ }, [linkActions]);
34
+ var handleInvoke = useCallback(function (opts) {
35
+ var _opts$action;
36
+
37
+ if (enableActionableElement && opts.type === 'client' && opts.isReloadRequired && ((_opts$action = opts.action) === null || _opts$action === void 0 ? void 0 : _opts$action.type) === 'PreviewAction') {
38
+ // Reload when embed preview modal close
39
+ var promise = opts.action.promise;
40
+
41
+ opts.action.promise = function () {
42
+ return promise({
43
+ onClose: reload
44
+ });
45
+ };
46
+ }
47
+
48
+ return linkActions.invoke(opts, appearance);
49
+ }, [appearance, enableActionableElement, linkActions, reload]); // End: Smart ink Actions experiment
50
+
28
51
  useEffect(function () {
29
52
  if (!linkState.details) {
30
53
  return;
31
54
  }
32
55
 
33
56
  var cardProperties = extractCardProps(linkState.details.data, linkState.details.meta, {
34
- handleInvoke: function handleInvoke(opts) {
35
- return linkActions.invoke(opts, appearance);
36
- },
57
+ handleInvoke: handleInvoke,
37
58
  analytics: linkAnalytics,
38
59
  origin: origin,
39
60
  extensionKey: getExtensionKey(linkState.details),
@@ -52,6 +73,6 @@ export function useSmartLinkActions(_ref) {
52
73
  };
53
74
  });
54
75
  setActions(cardActions);
55
- }, [linkState, linkActions, linkAnalytics, appearance, platform, origin]);
76
+ }, [linkState, linkActions, linkAnalytics, appearance, platform, origin, handleInvoke]);
56
77
  return actions;
57
78
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "23.6.1",
3
+ "version": "23.6.3",
4
4
  "sideEffects": false
5
5
  }
@@ -88,14 +88,14 @@ export default (function (_ref2) {
88
88
  return {
89
89
  id: 'preview-content',
90
90
  text: /*#__PURE__*/React.createElement(FormattedMessage, messages.preview),
91
- promise: function promise() {
92
- return previewFunction(_objectSpread({
91
+ promise: function promise(props) {
92
+ return previewFunction(_objectSpread(_objectSpread({
93
93
  popupMountPointId: 'twp-editor-preview-iframe',
94
94
  providerName: 'Preview',
95
95
  showModal: true,
96
96
  iframeName: 'twp-editor-preview-iframe',
97
97
  onClose: function onClose() {}
98
- }, rest));
98
+ }, props), rest));
99
99
  }
100
100
  };
101
101
  });
@@ -10,6 +10,8 @@ import { getSimulatedMetadata, SMART_CARD_ANALYTICS_DISPLAY } from '../utils';
10
10
  import HoverCardLoadingView from './views/resolving';
11
11
  import HoverCardUnauthorisedView from './views/unauthorised';
12
12
  import HoverCardResolvedView from './views/resolved';
13
+ import { FormattedMessage } from 'react-intl-next';
14
+ import { messages } from '../../../messages';
13
15
  export var getOpenAction = function getOpenAction(url, analytics, onActionClick) {
14
16
  return {
15
17
  name: ActionName.CustomAction,
@@ -28,6 +30,7 @@ export var getOpenAction = function getOpenAction(url, analytics, onActionClick)
28
30
  previewDisplay: 'card'
29
31
  });
30
32
  },
33
+ tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.open_link_in_a_new_tab),
31
34
  testId: 'hover-card-open-button'
32
35
  };
33
36
  };
@@ -106,7 +106,9 @@ export var toActionableMetadata = function toActionableMetadata(onActionClick, e
106
106
  onActionClick(previewAction.id);
107
107
  }
108
108
 
109
- return previewAction.invoke();
109
+ return previewAction.invoke({
110
+ isReloadRequired: true
111
+ });
110
112
  }
111
113
  }) : elementItem;
112
114
  });
@@ -1,6 +1,6 @@
1
1
  import { MessageDescriptor } from 'react-intl-next';
2
2
  export declare type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | 'request_access_pending_description' | 'request_denied_description';
3
- export declare type MessageKey = 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'could_not_load_link' | 'download' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'delete' | 'edit' | 'learn_more_about_smart_links_security' | 'loading' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'preview' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'try_again' | 'try_another_account' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey;
3
+ export declare type MessageKey = 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'could_not_load_link' | 'download' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'delete' | 'edit' | 'learn_more_about_smart_links_security' | 'loading' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_link_in_a_new_tab' | 'preview' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'try_again' | 'try_another_account' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey;
4
4
  declare type Messages = {
5
5
  [K in MessageKey]: MessageDescriptor;
6
6
  };
@@ -13,5 +13,5 @@ export declare type InvokeServerOpts = InvokeOpts<ServerActionOpts> & {
13
13
  };
14
14
  export interface ClientActionOpts {
15
15
  type: string;
16
- promise: () => Promise<void>;
16
+ promise: <T>(opts?: T) => Promise<void>;
17
17
  }
@@ -2,6 +2,9 @@
2
2
  import { JsonLd } from 'json-ld-types';
3
3
  import type { AnalyticsHandler, AnalyticsOrigin } from '../../utils/types';
4
4
  import type { CardInnerAppearance } from '../../view/Card/types';
5
+ declare type ExperimentInvokeOpts = {
6
+ isReloadRequired?: boolean;
7
+ };
5
8
  export interface LinkAction {
6
9
  /**
7
10
  * Unique ID for the action.
@@ -18,7 +21,7 @@ export interface LinkAction {
18
21
  * Promise to invoke on triggering this action.
19
22
  * @example Clicking on `Delete` leading to deletion of content.
20
23
  */
21
- invoke: () => Promise<any>;
24
+ invoke: (opts?: ExperimentInvokeOpts) => Promise<any>;
22
25
  }
23
26
  export interface UseSmartLinkActionsOpts {
24
27
  /**
@@ -47,3 +50,4 @@ export interface UseSmartLinkActionsOpts {
47
50
  origin?: AnalyticsOrigin;
48
51
  }
49
52
  export declare function useSmartLinkActions({ url, appearance, analyticsHandler, platform, origin, }: UseSmartLinkActionsOpts): LinkAction[];
53
+ export {};
@@ -5,7 +5,7 @@ import { Appearance } from '@atlaskit/button/types';
5
5
  export interface ActionProps {
6
6
  id: string;
7
7
  text: React.ReactNode;
8
- promise: () => Promise<any>;
8
+ promise: <T>(opts?: T) => Promise<any>;
9
9
  buttonAppearance?: Appearance;
10
10
  }
11
11
  export declare type ActionState = 'init' | 'loading' | 'success' | 'failure';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { CardAppearance, CardPlatform, CardProps } from './types';
3
3
  import { WrappedComponentProps } from 'react-intl-next';
4
- export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<React.PropsWithChildren<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps<"intl">>>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "appearance" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "ui" | "showActions" | "onResolve" | "platform" | "isFrameVisible" | "embedIframeRef" | "showHoverPreview" | "inlinePreloaderStyle" | "importer" | "container" | "analyticsEvents" | "forwardedRef"> & React.RefAttributes<any>>;
4
+ export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<React.PropsWithChildren<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps<"intl">>>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "appearance" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "ui" | "showActions" | "onResolve" | "platform" | "showHoverPreview" | "isFrameVisible" | "embedIframeRef" | "inlinePreloaderStyle" | "importer" | "container" | "analyticsEvents" | "forwardedRef"> & React.RefAttributes<any>>;
5
5
  export type { CardAppearance, CardProps, CardPlatform };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "23.6.1",
3
+ "version": "23.6.3",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"