@atlaskit/smart-card 45.15.2 → 45.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/extractors/action/extract-invoke-preview-action.js +10 -0
  3. package/dist/cjs/extractors/flexible/actions/index.js +6 -2
  4. package/dist/cjs/extractors/flexible/extract-state.js +8 -5
  5. package/dist/cjs/extractors/flexible/index.js +8 -4
  6. package/dist/cjs/state/hooks/useSmartLink.js +2 -0
  7. package/dist/cjs/state/hooks-external/useSmartLinkActions.js +6 -2
  8. package/dist/cjs/utils/analytics/analytics.js +1 -1
  9. package/dist/cjs/view/FlexibleCard/index.js +11 -4
  10. package/dist/cjs/view/LinkUrl/index.js +1 -1
  11. package/dist/es2019/extractors/action/extract-invoke-preview-action.js +10 -0
  12. package/dist/es2019/extractors/flexible/actions/index.js +4 -0
  13. package/dist/es2019/extractors/flexible/extract-state.js +6 -3
  14. package/dist/es2019/extractors/flexible/index.js +5 -1
  15. package/dist/es2019/state/hooks/useSmartLink.js +2 -0
  16. package/dist/es2019/state/hooks-external/useSmartLinkActions.js +4 -0
  17. package/dist/es2019/utils/analytics/analytics.js +1 -1
  18. package/dist/es2019/view/FlexibleCard/index.js +5 -1
  19. package/dist/es2019/view/LinkUrl/index.js +1 -1
  20. package/dist/esm/extractors/action/extract-invoke-preview-action.js +10 -0
  21. package/dist/esm/extractors/flexible/actions/index.js +6 -2
  22. package/dist/esm/extractors/flexible/extract-state.js +8 -5
  23. package/dist/esm/extractors/flexible/index.js +8 -4
  24. package/dist/esm/state/hooks/useSmartLink.js +2 -0
  25. package/dist/esm/state/hooks-external/useSmartLinkActions.js +6 -2
  26. package/dist/esm/utils/analytics/analytics.js +1 -1
  27. package/dist/esm/view/FlexibleCard/index.js +11 -4
  28. package/dist/esm/view/LinkUrl/index.js +1 -1
  29. package/dist/types/extractors/action/extract-invoke-preview-action.d.ts +3 -0
  30. package/dist/types/extractors/flexible/actions/index.d.ts +4 -1
  31. package/dist/types/extractors/flexible/extract-state.d.ts +3 -1
  32. package/dist/types/extractors/flexible/index.d.ts +1 -1
  33. package/dist/types/state/hooks/useSmartLink.d.ts +3 -0
  34. package/dist/types/view/FlexibleCard/types.d.ts +3 -0
  35. package/package.json +6 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 45.16.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`05fc574d23d1e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/05fc574d23d1e) -
8
+ Block previews for cross-unit resources. Before opening a preview panel or falling back to an
9
+ embed modal, the target resource's cloudId is now verified to belong to the same unit as the
10
+ current site; resources on a different unit are blocked entirely. `useGlobalObjectPreviewPanels`
11
+ exposes a new `isPreviewRestricted` signal, which is threaded through `link-provider` and
12
+ `smart-card` so the smart card preview affordance is not offered (neither panel nor modal) for
13
+ restricted resources.
14
+
15
+ The new and legacy behaviours of `useGlobalObjectPreviewPanels` are now split into separate
16
+ implementations selected via `functionWithCondition` behind the `preview_panel_unit_check` gate;
17
+ this is an internal restructure with no change to the hook's public API.
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
3
23
  ## 45.15.2
4
24
 
5
25
  ### Patch Changes
@@ -10,6 +10,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
10
10
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
11
  var _linkExtractors = require("@atlaskit/link-extractors");
12
12
  var _utils = require("@atlaskit/linking-common/utils");
13
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
14
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
14
15
  var _constants = require("../../constants");
15
16
  var _index = require("../../index");
@@ -33,6 +34,7 @@ var extractInvokePreviewAction = exports.extractInvokePreviewAction = function e
33
34
  origin = param.origin,
34
35
  response = param.response,
35
36
  isPreviewPanelAvailable = param.isPreviewPanelAvailable,
37
+ isPreviewRestricted = param.isPreviewRestricted,
36
38
  openPreviewPanel = param.openPreviewPanel;
37
39
  var ari = (0, _linkExtractors.extractSmartLinkAri)(response);
38
40
  var url = (0, _linkExtractors.extractSmartLinkUrl)(response);
@@ -48,6 +50,14 @@ var extractInvokePreviewAction = exports.extractInvokePreviewAction = function e
48
50
  return;
49
51
  }
50
52
 
53
+ // Restricted (e.g. cross-unit) resources must not be previewed at all — suppress
54
+ // the action so it does not fall back to a preview modal.
55
+ if (ari && isPreviewRestricted !== null && isPreviewRestricted !== void 0 && isPreviewRestricted({
56
+ ari: ari
57
+ }) && (0, _platformFeatureFlags.fg)('preview_panel_unit_check')) {
58
+ return;
59
+ }
60
+
51
61
  /* Analytics UI event for preview action created to support tracking of preview actions as the experiment rolls out */
52
62
  var firePreviewActionUIEvent = function firePreviewActionUIEvent(_ref) {
53
63
  var previewType = _ref.previewType;
@@ -31,6 +31,7 @@ var extractFlexibleCardActions = exports.extractFlexibleCardActions = function e
31
31
  transformUrl = _ref.transformUrl,
32
32
  url = _ref.url,
33
33
  isPreviewPanelAvailable = _ref.isPreviewPanelAvailable,
34
+ isPreviewRestricted = _ref.isPreviewRestricted,
34
35
  openPreviewPanel = _ref.openPreviewPanel;
35
36
  var action = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _constants.ActionName.CopyLinkAction, (0, _extractCopyLinkAction.extractCopyLinkClientAction)({
36
37
  actionOptions: actionOptions,
@@ -42,14 +43,17 @@ var extractFlexibleCardActions = exports.extractFlexibleCardActions = function e
42
43
  appearance: appearance,
43
44
  id: id,
44
45
  response: response
45
- })), _constants.ActionName.FollowAction, (0, _extractFollowAction.default)(response, actionOptions, id)), _constants.ActionName.PreviewAction, (0, _extractPreviewAction.extractPreviewClientAction)(_objectSpread({
46
+ })), _constants.ActionName.FollowAction, (0, _extractFollowAction.default)(response, actionOptions, id)), _constants.ActionName.PreviewAction, (0, _extractPreviewAction.extractPreviewClientAction)(_objectSpread(_objectSpread({
46
47
  actionOptions: actionOptions,
47
48
  appearance: appearance,
48
49
  fireEvent: fireEvent,
49
50
  id: id,
50
51
  origin: origin,
51
52
  response: response,
52
- isPreviewPanelAvailable: isPreviewPanelAvailable,
53
+ isPreviewPanelAvailable: isPreviewPanelAvailable
54
+ }, (0, _platformFeatureFlags.fg)('preview_panel_unit_check') ? {
55
+ isPreviewRestricted: isPreviewRestricted
56
+ } : undefined), {}, {
53
57
  openPreviewPanel: openPreviewPanel
54
58
  }, (0, _platformFeatureFlags.fg)('platform_smartlink_xpc_url_wrapping') ? {
55
59
  transformUrl: transformUrl
@@ -29,7 +29,7 @@ var toInvokeRequest = function toInvokeRequest(extensionKey, resourceIdentifiers
29
29
  details: details
30
30
  };
31
31
  };
32
- var extractAction = function extractAction(response, id, actionOptions, appearance, origin, fireEvent, resolve, isPreviewPanelAvailable, openPreviewPanel, transformUrl) {
32
+ var extractAction = function extractAction(response, id, actionOptions, appearance, origin, fireEvent, resolve, isPreviewPanelAvailable, openPreviewPanel, transformUrl, isPreviewRestricted) {
33
33
  var _action$dataRetrieval, _extractInvokePreview, _action$dataUpdateAct;
34
34
  var extensionKey = (0, _helpers.getExtensionKey)(response);
35
35
  var data = response === null || response === void 0 ? void 0 : response.data;
@@ -45,7 +45,7 @@ var extractAction = function extractAction(response, id, actionOptions, appearan
45
45
  }
46
46
  var read = toInvokeRequest(extensionKey, action.resourceIdentifiers, (_action$dataRetrieval = action.dataRetrievalAction) === null || _action$dataRetrieval === void 0 ? void 0 : _action$dataRetrieval.name);
47
47
  var url = (0, _linkExtractors.extractLink)(data);
48
- var invokePreviewAction = response ? (_extractInvokePreview = (0, _extractInvokePreviewAction.extractInvokePreviewAction)(_objectSpread({
48
+ var invokePreviewAction = response ? (_extractInvokePreview = (0, _extractInvokePreviewAction.extractInvokePreviewAction)(_objectSpread(_objectSpread({
49
49
  actionOptions: actionOptions,
50
50
  appearance: appearance,
51
51
  fireEvent: fireEvent,
@@ -58,7 +58,10 @@ var extractAction = function extractAction(response, id, actionOptions, appearan
58
58
  } : undefined,
59
59
  origin: origin,
60
60
  response: response,
61
- isPreviewPanelAvailable: isPreviewPanelAvailable,
61
+ isPreviewPanelAvailable: isPreviewPanelAvailable
62
+ }, (0, _platformFeatureFlags.fg)('preview_panel_unit_check') ? {
63
+ isPreviewRestricted: isPreviewRestricted
64
+ } : undefined), {}, {
62
65
  openPreviewPanel: openPreviewPanel
63
66
  }, (0, _platformFeatureFlags.fg)('platform_smartlink_xpc_url_wrapping') ? {
64
67
  transformUrl: transformUrl
@@ -74,7 +77,7 @@ var extractAction = function extractAction(response, id, actionOptions, appearan
74
77
  update: update
75
78
  } : undefined;
76
79
  };
77
- var extractState = function extractState(response, actionOptions, id, appearance, origin, fireEvent, resolve, isPreviewPanelAvailable, openPreviewPanel, transformUrl) {
80
+ var extractState = function extractState(response, actionOptions, id, appearance, origin, fireEvent, resolve, isPreviewPanelAvailable, openPreviewPanel, transformUrl, isPreviewRestricted) {
78
81
  if (!response || !response.data) {
79
82
  return;
80
83
  }
@@ -85,7 +88,7 @@ var extractState = function extractState(response, actionOptions, id, appearance
85
88
  if (!(0, _canShowAction.canShowAction)(_constants.CardAction.ChangeStatusAction, actionOptions)) {
86
89
  return lozenge;
87
90
  }
88
- var action = extractAction(response, id, actionOptions, appearance, origin, fireEvent, resolve, isPreviewPanelAvailable, openPreviewPanel, (0, _platformFeatureFlags.fg)('platform_smartlink_xpc_url_wrapping') ? transformUrl : undefined);
91
+ var action = extractAction(response, id, actionOptions, appearance, origin, fireEvent, resolve, isPreviewPanelAvailable, openPreviewPanel, (0, _platformFeatureFlags.fg)('platform_smartlink_xpc_url_wrapping') ? transformUrl : undefined, (0, _platformFeatureFlags.fg)('preview_panel_unit_check') ? isPreviewRestricted : undefined);
89
92
  return _objectSpread(_objectSpread({}, lozenge), {}, {
90
93
  action: action
91
94
  });
@@ -21,7 +21,7 @@ var _icon = require("./icon");
21
21
  var _extractProviderIcon = require("./icon/extract-provider-icon");
22
22
  var _latestCommit = require("./latest-commit");
23
23
  var _utils = require("./utils");
24
- var _excluded = ["appearance", "fireEvent", "id", "onClick", "onAuxClick", "onContextMenu", "origin", "product", "resolve", "rovoConfig", "actionOptions", "response", "status", "aiSummaryConfig", "isPreviewPanelAvailable", "openPreviewPanel", "transformUrl"];
24
+ var _excluded = ["appearance", "fireEvent", "id", "onClick", "onAuxClick", "onContextMenu", "origin", "product", "resolve", "rovoConfig", "actionOptions", "response", "status", "aiSummaryConfig", "isPreviewPanelAvailable", "isPreviewRestricted", "openPreviewPanel", "transformUrl"];
25
25
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
26
26
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
27
27
  var extractFlexibleUiContext = function extractFlexibleUiContext() {
@@ -41,6 +41,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
41
41
  status = _ref.status,
42
42
  aiSummaryConfig = _ref.aiSummaryConfig,
43
43
  isPreviewPanelAvailable = _ref.isPreviewPanelAvailable,
44
+ isPreviewRestricted = _ref.isPreviewRestricted,
44
45
  openPreviewPanel = _ref.openPreviewPanel,
45
46
  transformUrl = _ref.transformUrl,
46
47
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
@@ -51,7 +52,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
51
52
  var meta = response.meta;
52
53
  var url = (0, _linkExtractors.extractSmartLinkUrl)(response);
53
54
  return {
54
- actions: (0, _actions.extractFlexibleCardActions)(_objectSpread({
55
+ actions: (0, _actions.extractFlexibleCardActions)(_objectSpread(_objectSpread({
55
56
  actionOptions: actionOptions,
56
57
  aiSummaryConfig: aiSummaryConfig,
57
58
  appearance: appearance,
@@ -63,7 +64,10 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
63
64
  response: response,
64
65
  url: props.url,
65
66
  // Use the original URL in edge cases, such as short links for AI summary and copy link actions.
66
- isPreviewPanelAvailable: isPreviewPanelAvailable,
67
+ isPreviewPanelAvailable: isPreviewPanelAvailable
68
+ }, (0, _platformFeatureFlags.fg)('preview_panel_unit_check') ? {
69
+ isPreviewRestricted: isPreviewRestricted
70
+ } : undefined), {}, {
67
71
  openPreviewPanel: openPreviewPanel
68
72
  }, (0, _platformFeatureFlags.fg)('platform_smartlink_xpc_url_wrapping') ? {
69
73
  transformUrl: transformUrl
@@ -99,7 +103,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
99
103
  snippet: (0, _extractSummary.extractSmartLinkSummary)(response) || undefined,
100
104
  // Explicitly set here to remove an empty string
101
105
  sourceBranch: (0, _utils.extractSourceBranch)(data),
102
- state: (0, _extractState.default)(response, actionOptions, id, appearance, origin, fireEvent, resolve, isPreviewPanelAvailable, openPreviewPanel, (0, _platformFeatureFlags.fg)('platform_smartlink_xpc_url_wrapping') ? transformUrl : undefined),
106
+ state: (0, _extractState.default)(response, actionOptions, id, appearance, origin, fireEvent, resolve, isPreviewPanelAvailable, openPreviewPanel, (0, _platformFeatureFlags.fg)('platform_smartlink_xpc_url_wrapping') ? transformUrl : undefined, (0, _platformFeatureFlags.fg)('preview_panel_unit_check') ? isPreviewRestricted : undefined),
103
107
  subscriberCount: (0, _utils.extractSubscriberCount)(data),
104
108
  subTasksProgress: (0, _utils.extractSubTasksProgress)(data),
105
109
  storyPoints: (0, _utils.extractStoryPoints)(data),
@@ -26,6 +26,7 @@ function useSmartLink(id, url, appearance) {
26
26
  var _useSmartLinkContext = (0, _linkProvider.useSmartLinkContext)(),
27
27
  store = _useSmartLinkContext.store,
28
28
  isPreviewPanelAvailable = _useSmartLinkContext.isPreviewPanelAvailable,
29
+ isPreviewRestricted = _useSmartLinkContext.isPreviewRestricted,
29
30
  openPreviewPanel = _useSmartLinkContext.openPreviewPanel;
30
31
  var actions = (0, _actions.useSmartCardActions)(id, url);
31
32
  var config = (0, _config.useSmartLinkConfig)();
@@ -54,6 +55,7 @@ function useSmartLink(id, url, appearance) {
54
55
  renderers: renderers,
55
56
  error: error,
56
57
  isPreviewPanelAvailable: isPreviewPanelAvailable,
58
+ isPreviewRestricted: (0, _platformFeatureFlags.fg)('preview_panel_unit_check') ? isPreviewRestricted : undefined,
57
59
  openPreviewPanel: openPreviewPanel
58
60
  };
59
61
  }
@@ -38,6 +38,7 @@ function useSmartLinkActions(_ref) {
38
38
  fireEvent = _useAnalyticsEvents.fireEvent;
39
39
  var _useSmartLinkContext = (0, _linkProvider.useSmartLinkContext)(),
40
40
  isPreviewPanelAvailable = _useSmartLinkContext.isPreviewPanelAvailable,
41
+ isPreviewRestricted = _useSmartLinkContext.isPreviewRestricted,
41
42
  openPreviewPanel = _useSmartLinkContext.openPreviewPanel;
42
43
  var invokeClientAction = (0, _useInvokeClientAction.default)({
43
44
  fireEvent: fireEvent
@@ -72,10 +73,13 @@ function useSmartLinkActions(_ref) {
72
73
  if (viewActionProps) {
73
74
  actions.push((0, _toAction.toAction)(viewActionProps, invokeClientAction, _messages.messages.view, 'view-content'));
74
75
  }
75
- var previewActionProps = (0, _extractInvokePreviewAction.extractInvokePreviewAction)(_objectSpread(_objectSpread({}, invokeParam), {}, {
76
+ var previewActionProps = (0, _extractInvokePreviewAction.extractInvokePreviewAction)(_objectSpread(_objectSpread(_objectSpread({}, invokeParam), {}, {
76
77
  fireEvent: fireEvent,
77
78
  origin: origin,
78
- isPreviewPanelAvailable: isPreviewPanelAvailable,
79
+ isPreviewPanelAvailable: isPreviewPanelAvailable
80
+ }, (0, _platformFeatureFlags.fg)('preview_panel_unit_check') ? {
81
+ isPreviewRestricted: isPreviewRestricted
82
+ } : undefined), {}, {
79
83
  openPreviewPanel: openPreviewPanel
80
84
  }, (0, _platformFeatureFlags.fg)('platform_smartlink_xpc_url_wrapping') ? {
81
85
  transformUrl: function transformUrl() {
@@ -11,7 +11,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
11
11
  var context = exports.context = {
12
12
  componentName: 'smart-cards',
13
13
  packageName: "@atlaskit/smart-card" || '',
14
- packageVersion: "45.15.1" || ''
14
+ packageVersion: "45.15.2" || ''
15
15
  };
16
16
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
17
17
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
11
  var _react = _interopRequireWildcard(require("react"));
11
12
  var _linkProvider = require("@atlaskit/link-provider");
12
13
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
@@ -22,6 +23,8 @@ var _useSmartLinkCrossProductUrlWrapper = require("../../state/hooks/use-smart-l
22
23
  var _container = _interopRequireDefault(require("./components/container"));
23
24
  var _utils = require("./utils");
24
25
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
26
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
27
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
25
28
  var PENDING_LINK_STATUSES = [_constants.SmartLinkStatus.Pending, _constants.SmartLinkStatus.Resolving];
26
29
 
27
30
  /**
@@ -57,6 +60,7 @@ var FlexibleCard = function FlexibleCard(_ref) {
57
60
  var resolve = (0, _useResolve.default)();
58
61
  var _useSmartLinkContext = (0, _linkProvider.useSmartLinkContext)(),
59
62
  isPreviewPanelAvailable = _useSmartLinkContext.isPreviewPanelAvailable,
63
+ isPreviewRestricted = _useSmartLinkContext.isPreviewRestricted,
60
64
  openPreviewPanel = _useSmartLinkContext.openPreviewPanel,
61
65
  product = _useSmartLinkContext.product;
62
66
  var rovoConfig = (0, _useRovoConfig.default)();
@@ -81,7 +85,7 @@ var FlexibleCard = function FlexibleCard(_ref) {
81
85
  }, [placeholderData, status]);
82
86
  var placeHolderStatus = placeholderCardState ? placeholderCardState.status : undefined;
83
87
  var context = (0, _react.useMemo)(function () {
84
- return (0, _utils.getContextByStatus)({
88
+ return (0, _utils.getContextByStatus)(_objectSpread(_objectSpread({
85
89
  aiSummaryConfig: aiSummaryConfig,
86
90
  appearance: appearance,
87
91
  fireEvent: fireEvent,
@@ -99,11 +103,14 @@ var FlexibleCard = function FlexibleCard(_ref) {
99
103
  actionOptions: actionOptions,
100
104
  status: placeholderCardState ? placeHolderStatus : status,
101
105
  url: url,
102
- isPreviewPanelAvailable: isPreviewPanelAvailable,
106
+ isPreviewPanelAvailable: isPreviewPanelAvailable
107
+ }, (0, _platformFeatureFlags.fg)('preview_panel_unit_check') ? {
108
+ isPreviewRestricted: isPreviewRestricted
109
+ } : undefined), {}, {
103
110
  openPreviewPanel: openPreviewPanel,
104
111
  transformUrl: transformUrl
105
- });
106
- }, [aiSummaryConfig, appearance, actionOptions, details, id, isPreviewPanelAvailable, onAuthorize, onClick, onAuxClick, onContextMenu, openPreviewPanel, origin, placeholderCardState, placeHolderStatus, product, renderers, resolve, rovoConfig, status, transformUrl, url, fireEvent]);
112
+ }));
113
+ }, [aiSummaryConfig, appearance, actionOptions, details, id, isPreviewPanelAvailable, isPreviewRestricted, onAuthorize, onClick, onAuxClick, onContextMenu, openPreviewPanel, origin, placeholderCardState, placeHolderStatus, product, renderers, resolve, rovoConfig, status, transformUrl, url, fireEvent]);
107
114
  var flexibleCardContext = (0, _react.useMemo)(function () {
108
115
  return {
109
116
  data: context,
@@ -19,7 +19,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
19
19
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
20
20
  var PACKAGE_DATA = {
21
21
  packageName: "@atlaskit/smart-card",
22
- packageVersion: "45.15.1",
22
+ packageVersion: "45.15.2",
23
23
  componentName: 'linkUrl'
24
24
  };
25
25
  var LinkUrl = function LinkUrl(_ref) {
@@ -1,5 +1,6 @@
1
1
  import { extractPreview as extractPreviewData, extractSmartLinkAri, extractSmartLinkEmbed, extractSmartLinkProvider, extractSmartLinkTitle, extractSmartLinkUrl } from '@atlaskit/link-extractors';
2
2
  import { isWithinPreviewPanelIFrame } from '@atlaskit/linking-common/utils';
3
+ import { fg } from '@atlaskit/platform-feature-flags';
3
4
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
5
  import { CardAction } from '../../constants';
5
6
  import { ActionName } from '../../index';
@@ -22,6 +23,7 @@ export const extractInvokePreviewAction = param => {
22
23
  origin,
23
24
  response,
24
25
  isPreviewPanelAvailable,
26
+ isPreviewRestricted,
25
27
  openPreviewPanel
26
28
  } = param;
27
29
  const ari = extractSmartLinkAri(response);
@@ -38,6 +40,14 @@ export const extractInvokePreviewAction = param => {
38
40
  return;
39
41
  }
40
42
 
43
+ // Restricted (e.g. cross-unit) resources must not be previewed at all — suppress
44
+ // the action so it does not fall back to a preview modal.
45
+ if (ari && isPreviewRestricted !== null && isPreviewRestricted !== void 0 && isPreviewRestricted({
46
+ ari
47
+ }) && fg('preview_panel_unit_check')) {
48
+ return;
49
+ }
50
+
41
51
  /* Analytics UI event for preview action created to support tracking of preview actions as the experiment rolls out */
42
52
  const firePreviewActionUIEvent = ({
43
53
  previewType
@@ -21,6 +21,7 @@ export const extractFlexibleCardActions = ({
21
21
  transformUrl,
22
22
  url,
23
23
  isPreviewPanelAvailable,
24
+ isPreviewRestricted,
24
25
  openPreviewPanel
25
26
  }) => {
26
27
  const action = {
@@ -45,6 +46,9 @@ export const extractFlexibleCardActions = ({
45
46
  origin,
46
47
  response,
47
48
  isPreviewPanelAvailable,
49
+ ...(fg('preview_panel_unit_check') ? {
50
+ isPreviewRestricted
51
+ } : undefined),
48
52
  openPreviewPanel,
49
53
  ...(fg('platform_smartlink_xpc_url_wrapping') ? {
50
54
  transformUrl
@@ -19,7 +19,7 @@ const toInvokeRequest = (extensionKey, resourceIdentifiers, actionType, details)
19
19
  details
20
20
  };
21
21
  };
22
- const extractAction = (response, id, actionOptions, appearance, origin, fireEvent, resolve, isPreviewPanelAvailable, openPreviewPanel, transformUrl) => {
22
+ const extractAction = (response, id, actionOptions, appearance, origin, fireEvent, resolve, isPreviewPanelAvailable, openPreviewPanel, transformUrl, isPreviewRestricted) => {
23
23
  var _action$dataRetrieval, _extractInvokePreview, _action$dataUpdateAct;
24
24
  const extensionKey = getExtensionKey(response);
25
25
  const data = response === null || response === void 0 ? void 0 : response.data;
@@ -45,6 +45,9 @@ const extractAction = (response, id, actionOptions, appearance, origin, fireEven
45
45
  origin,
46
46
  response,
47
47
  isPreviewPanelAvailable,
48
+ ...(fg('preview_panel_unit_check') ? {
49
+ isPreviewRestricted
50
+ } : undefined),
48
51
  openPreviewPanel,
49
52
  ...(fg('platform_smartlink_xpc_url_wrapping') ? {
50
53
  transformUrl
@@ -61,7 +64,7 @@ const extractAction = (response, id, actionOptions, appearance, origin, fireEven
61
64
  update
62
65
  } : undefined;
63
66
  };
64
- const extractState = (response, actionOptions, id, appearance, origin, fireEvent, resolve, isPreviewPanelAvailable, openPreviewPanel, transformUrl) => {
67
+ const extractState = (response, actionOptions, id, appearance, origin, fireEvent, resolve, isPreviewPanelAvailable, openPreviewPanel, transformUrl, isPreviewRestricted) => {
65
68
  if (!response || !response.data) {
66
69
  return;
67
70
  }
@@ -72,7 +75,7 @@ const extractState = (response, actionOptions, id, appearance, origin, fireEvent
72
75
  if (!canShowAction(CardAction.ChangeStatusAction, actionOptions)) {
73
76
  return lozenge;
74
77
  }
75
- const action = extractAction(response, id, actionOptions, appearance, origin, fireEvent, resolve, isPreviewPanelAvailable, openPreviewPanel, fg('platform_smartlink_xpc_url_wrapping') ? transformUrl : undefined);
78
+ const action = extractAction(response, id, actionOptions, appearance, origin, fireEvent, resolve, isPreviewPanelAvailable, openPreviewPanel, fg('platform_smartlink_xpc_url_wrapping') ? transformUrl : undefined, fg('preview_panel_unit_check') ? isPreviewRestricted : undefined);
76
79
  return {
77
80
  ...lozenge,
78
81
  action
@@ -28,6 +28,7 @@ const extractFlexibleUiContext = ({
28
28
  status,
29
29
  aiSummaryConfig,
30
30
  isPreviewPanelAvailable,
31
+ isPreviewRestricted,
31
32
  openPreviewPanel,
32
33
  transformUrl,
33
34
  ...props
@@ -52,6 +53,9 @@ const extractFlexibleUiContext = ({
52
53
  url: props.url,
53
54
  // Use the original URL in edge cases, such as short links for AI summary and copy link actions.
54
55
  isPreviewPanelAvailable,
56
+ ...(fg('preview_panel_unit_check') ? {
57
+ isPreviewRestricted
58
+ } : undefined),
55
59
  openPreviewPanel,
56
60
  ...(fg('platform_smartlink_xpc_url_wrapping') ? {
57
61
  transformUrl
@@ -88,7 +92,7 @@ const extractFlexibleUiContext = ({
88
92
  snippet: extractSmartLinkSummary(response) || undefined,
89
93
  // Explicitly set here to remove an empty string
90
94
  sourceBranch: extractSourceBranch(data),
91
- state: extractState(response, actionOptions, id, appearance, origin, fireEvent, resolve, isPreviewPanelAvailable, openPreviewPanel, fg('platform_smartlink_xpc_url_wrapping') ? transformUrl : undefined),
95
+ state: extractState(response, actionOptions, id, appearance, origin, fireEvent, resolve, isPreviewPanelAvailable, openPreviewPanel, fg('platform_smartlink_xpc_url_wrapping') ? transformUrl : undefined, fg('preview_panel_unit_check') ? isPreviewRestricted : undefined),
92
96
  subscriberCount: extractSubscriberCount(data),
93
97
  subTasksProgress: extractSubTasksProgress(data),
94
98
  storyPoints: extractStoryPoints(data),
@@ -19,6 +19,7 @@ export function useSmartLink(id, url, appearance) {
19
19
  const {
20
20
  store,
21
21
  isPreviewPanelAvailable,
22
+ isPreviewRestricted,
22
23
  openPreviewPanel
23
24
  } = useSmartLinkContext();
24
25
  const actions = useSmartLinkActions(id, url);
@@ -43,6 +44,7 @@ export function useSmartLink(id, url, appearance) {
43
44
  renderers,
44
45
  error,
45
46
  isPreviewPanelAvailable,
47
+ isPreviewRestricted: fg('preview_panel_unit_check') ? isPreviewRestricted : undefined,
46
48
  openPreviewPanel
47
49
  };
48
50
  }
@@ -30,6 +30,7 @@ export function useSmartLinkActions({
30
30
  } = useAnalyticsEvents();
31
31
  const {
32
32
  isPreviewPanelAvailable,
33
+ isPreviewRestricted,
33
34
  openPreviewPanel
34
35
  } = useSmartLinkContext();
35
36
  const invokeClientAction = useInvokeClientAction({
@@ -68,6 +69,9 @@ export function useSmartLinkActions({
68
69
  fireEvent,
69
70
  origin,
70
71
  isPreviewPanelAvailable,
72
+ ...(fg('preview_panel_unit_check') ? {
73
+ isPreviewRestricted
74
+ } : undefined),
71
75
  openPreviewPanel,
72
76
  ...(fg('platform_smartlink_xpc_url_wrapping') ? {
73
77
  transformUrl: (destinationUrl = url) => appendCrossProductAnalyticsParams(destinationUrl)
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
2
2
  export const context = {
3
3
  componentName: 'smart-cards',
4
4
  packageName: "@atlaskit/smart-card" || '',
5
- packageVersion: "45.15.1" || ''
5
+ packageVersion: "45.15.2" || ''
6
6
  };
7
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
8
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -48,6 +48,7 @@ const FlexibleCard = ({
48
48
  const resolve = useResolve();
49
49
  const {
50
50
  isPreviewPanelAvailable,
51
+ isPreviewRestricted,
51
52
  openPreviewPanel,
52
53
  product
53
54
  } = useSmartLinkContext();
@@ -89,9 +90,12 @@ const FlexibleCard = ({
89
90
  status: placeholderCardState ? placeHolderStatus : status,
90
91
  url,
91
92
  isPreviewPanelAvailable,
93
+ ...(fg('preview_panel_unit_check') ? {
94
+ isPreviewRestricted
95
+ } : undefined),
92
96
  openPreviewPanel,
93
97
  transformUrl
94
- }), [aiSummaryConfig, appearance, actionOptions, details, id, isPreviewPanelAvailable, onAuthorize, onClick, onAuxClick, onContextMenu, openPreviewPanel, origin, placeholderCardState, placeHolderStatus, product, renderers, resolve, rovoConfig, status, transformUrl, url, fireEvent]);
98
+ }), [aiSummaryConfig, appearance, actionOptions, details, id, isPreviewPanelAvailable, isPreviewRestricted, onAuthorize, onClick, onAuxClick, onContextMenu, openPreviewPanel, origin, placeholderCardState, placeHolderStatus, product, renderers, resolve, rovoConfig, status, transformUrl, url, fireEvent]);
95
99
  const flexibleCardContext = useMemo(() => ({
96
100
  data: context,
97
101
  status: placeHolderStatus !== null && placeHolderStatus !== void 0 ? placeHolderStatus : status,
@@ -9,7 +9,7 @@ import LinkWarningModal from './LinkWarningModal';
9
9
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
10
10
  const PACKAGE_DATA = {
11
11
  packageName: "@atlaskit/smart-card",
12
- packageVersion: "45.15.1",
12
+ packageVersion: "45.15.2",
13
13
  componentName: 'linkUrl'
14
14
  };
15
15
  const LinkUrl = ({
@@ -5,6 +5,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
6
  import { extractPreview as extractPreviewData, extractSmartLinkAri, extractSmartLinkEmbed, extractSmartLinkProvider, extractSmartLinkTitle, extractSmartLinkUrl } from '@atlaskit/link-extractors';
7
7
  import { isWithinPreviewPanelIFrame } from '@atlaskit/linking-common/utils';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
8
9
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
10
  import { CardAction } from '../../constants';
10
11
  import { ActionName } from '../../index';
@@ -26,6 +27,7 @@ export var extractInvokePreviewAction = function extractInvokePreviewAction(para
26
27
  origin = param.origin,
27
28
  response = param.response,
28
29
  isPreviewPanelAvailable = param.isPreviewPanelAvailable,
30
+ isPreviewRestricted = param.isPreviewRestricted,
29
31
  openPreviewPanel = param.openPreviewPanel;
30
32
  var ari = extractSmartLinkAri(response);
31
33
  var url = extractSmartLinkUrl(response);
@@ -41,6 +43,14 @@ export var extractInvokePreviewAction = function extractInvokePreviewAction(para
41
43
  return;
42
44
  }
43
45
 
46
+ // Restricted (e.g. cross-unit) resources must not be previewed at all — suppress
47
+ // the action so it does not fall back to a preview modal.
48
+ if (ari && isPreviewRestricted !== null && isPreviewRestricted !== void 0 && isPreviewRestricted({
49
+ ari: ari
50
+ }) && fg('preview_panel_unit_check')) {
51
+ return;
52
+ }
53
+
44
54
  /* Analytics UI event for preview action created to support tracking of preview actions as the experiment rolls out */
45
55
  var firePreviewActionUIEvent = function firePreviewActionUIEvent(_ref) {
46
56
  var previewType = _ref.previewType;
@@ -24,6 +24,7 @@ export var extractFlexibleCardActions = function extractFlexibleCardActions(_ref
24
24
  transformUrl = _ref.transformUrl,
25
25
  url = _ref.url,
26
26
  isPreviewPanelAvailable = _ref.isPreviewPanelAvailable,
27
+ isPreviewRestricted = _ref.isPreviewRestricted,
27
28
  openPreviewPanel = _ref.openPreviewPanel;
28
29
  var action = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ActionName.CopyLinkAction, extractCopyLinkClientAction({
29
30
  actionOptions: actionOptions,
@@ -35,14 +36,17 @@ export var extractFlexibleCardActions = function extractFlexibleCardActions(_ref
35
36
  appearance: appearance,
36
37
  id: id,
37
38
  response: response
38
- })), ActionName.FollowAction, extractFollowAction(response, actionOptions, id)), ActionName.PreviewAction, extractPreviewClientAction(_objectSpread({
39
+ })), ActionName.FollowAction, extractFollowAction(response, actionOptions, id)), ActionName.PreviewAction, extractPreviewClientAction(_objectSpread(_objectSpread({
39
40
  actionOptions: actionOptions,
40
41
  appearance: appearance,
41
42
  fireEvent: fireEvent,
42
43
  id: id,
43
44
  origin: origin,
44
45
  response: response,
45
- isPreviewPanelAvailable: isPreviewPanelAvailable,
46
+ isPreviewPanelAvailable: isPreviewPanelAvailable
47
+ }, fg('preview_panel_unit_check') ? {
48
+ isPreviewRestricted: isPreviewRestricted
49
+ } : undefined), {}, {
46
50
  openPreviewPanel: openPreviewPanel
47
51
  }, fg('platform_smartlink_xpc_url_wrapping') ? {
48
52
  transformUrl: transformUrl
@@ -22,7 +22,7 @@ var toInvokeRequest = function toInvokeRequest(extensionKey, resourceIdentifiers
22
22
  details: details
23
23
  };
24
24
  };
25
- var extractAction = function extractAction(response, id, actionOptions, appearance, origin, fireEvent, resolve, isPreviewPanelAvailable, openPreviewPanel, transformUrl) {
25
+ var extractAction = function extractAction(response, id, actionOptions, appearance, origin, fireEvent, resolve, isPreviewPanelAvailable, openPreviewPanel, transformUrl, isPreviewRestricted) {
26
26
  var _action$dataRetrieval, _extractInvokePreview, _action$dataUpdateAct;
27
27
  var extensionKey = getExtensionKey(response);
28
28
  var data = response === null || response === void 0 ? void 0 : response.data;
@@ -38,7 +38,7 @@ var extractAction = function extractAction(response, id, actionOptions, appearan
38
38
  }
39
39
  var read = toInvokeRequest(extensionKey, action.resourceIdentifiers, (_action$dataRetrieval = action.dataRetrievalAction) === null || _action$dataRetrieval === void 0 ? void 0 : _action$dataRetrieval.name);
40
40
  var url = extractLink(data);
41
- var invokePreviewAction = response ? (_extractInvokePreview = extractInvokePreviewAction(_objectSpread({
41
+ var invokePreviewAction = response ? (_extractInvokePreview = extractInvokePreviewAction(_objectSpread(_objectSpread({
42
42
  actionOptions: actionOptions,
43
43
  appearance: appearance,
44
44
  fireEvent: fireEvent,
@@ -51,7 +51,10 @@ var extractAction = function extractAction(response, id, actionOptions, appearan
51
51
  } : undefined,
52
52
  origin: origin,
53
53
  response: response,
54
- isPreviewPanelAvailable: isPreviewPanelAvailable,
54
+ isPreviewPanelAvailable: isPreviewPanelAvailable
55
+ }, fg('preview_panel_unit_check') ? {
56
+ isPreviewRestricted: isPreviewRestricted
57
+ } : undefined), {}, {
55
58
  openPreviewPanel: openPreviewPanel
56
59
  }, fg('platform_smartlink_xpc_url_wrapping') ? {
57
60
  transformUrl: transformUrl
@@ -67,7 +70,7 @@ var extractAction = function extractAction(response, id, actionOptions, appearan
67
70
  update: update
68
71
  } : undefined;
69
72
  };
70
- var extractState = function extractState(response, actionOptions, id, appearance, origin, fireEvent, resolve, isPreviewPanelAvailable, openPreviewPanel, transformUrl) {
73
+ var extractState = function extractState(response, actionOptions, id, appearance, origin, fireEvent, resolve, isPreviewPanelAvailable, openPreviewPanel, transformUrl, isPreviewRestricted) {
71
74
  if (!response || !response.data) {
72
75
  return;
73
76
  }
@@ -78,7 +81,7 @@ var extractState = function extractState(response, actionOptions, id, appearance
78
81
  if (!canShowAction(CardAction.ChangeStatusAction, actionOptions)) {
79
82
  return lozenge;
80
83
  }
81
- var action = extractAction(response, id, actionOptions, appearance, origin, fireEvent, resolve, isPreviewPanelAvailable, openPreviewPanel, fg('platform_smartlink_xpc_url_wrapping') ? transformUrl : undefined);
84
+ var action = extractAction(response, id, actionOptions, appearance, origin, fireEvent, resolve, isPreviewPanelAvailable, openPreviewPanel, fg('platform_smartlink_xpc_url_wrapping') ? transformUrl : undefined, fg('preview_panel_unit_check') ? isPreviewRestricted : undefined);
82
85
  return _objectSpread(_objectSpread({}, lozenge), {}, {
83
86
  action: action
84
87
  });
@@ -1,6 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["appearance", "fireEvent", "id", "onClick", "onAuxClick", "onContextMenu", "origin", "product", "resolve", "rovoConfig", "actionOptions", "response", "status", "aiSummaryConfig", "isPreviewPanelAvailable", "openPreviewPanel", "transformUrl"];
3
+ var _excluded = ["appearance", "fireEvent", "id", "onClick", "onAuxClick", "onContextMenu", "origin", "product", "resolve", "rovoConfig", "actionOptions", "response", "status", "aiSummaryConfig", "isPreviewPanelAvailable", "isPreviewRestricted", "openPreviewPanel", "transformUrl"];
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
6
  import { extractPersonOwnedBy, extractSmartLinkAri, extractSmartLinkAuthorGroup, extractSmartLinkCreatedBy, extractSmartLinkCreatedOn, extractSmartLinkModifiedBy, extractSmartLinkModifiedOn, extractSmartLinkUrl, extractType } from '@atlaskit/link-extractors';
@@ -34,6 +34,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
34
34
  status = _ref.status,
35
35
  aiSummaryConfig = _ref.aiSummaryConfig,
36
36
  isPreviewPanelAvailable = _ref.isPreviewPanelAvailable,
37
+ isPreviewRestricted = _ref.isPreviewRestricted,
37
38
  openPreviewPanel = _ref.openPreviewPanel,
38
39
  transformUrl = _ref.transformUrl,
39
40
  props = _objectWithoutProperties(_ref, _excluded);
@@ -44,7 +45,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
44
45
  var meta = response.meta;
45
46
  var url = extractSmartLinkUrl(response);
46
47
  return {
47
- actions: extractFlexibleCardActions(_objectSpread({
48
+ actions: extractFlexibleCardActions(_objectSpread(_objectSpread({
48
49
  actionOptions: actionOptions,
49
50
  aiSummaryConfig: aiSummaryConfig,
50
51
  appearance: appearance,
@@ -56,7 +57,10 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
56
57
  response: response,
57
58
  url: props.url,
58
59
  // Use the original URL in edge cases, such as short links for AI summary and copy link actions.
59
- isPreviewPanelAvailable: isPreviewPanelAvailable,
60
+ isPreviewPanelAvailable: isPreviewPanelAvailable
61
+ }, fg('preview_panel_unit_check') ? {
62
+ isPreviewRestricted: isPreviewRestricted
63
+ } : undefined), {}, {
60
64
  openPreviewPanel: openPreviewPanel
61
65
  }, fg('platform_smartlink_xpc_url_wrapping') ? {
62
66
  transformUrl: transformUrl
@@ -92,7 +96,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
92
96
  snippet: extractSmartLinkSummary(response) || undefined,
93
97
  // Explicitly set here to remove an empty string
94
98
  sourceBranch: extractSourceBranch(data),
95
- state: extractState(response, actionOptions, id, appearance, origin, fireEvent, resolve, isPreviewPanelAvailable, openPreviewPanel, fg('platform_smartlink_xpc_url_wrapping') ? transformUrl : undefined),
99
+ state: extractState(response, actionOptions, id, appearance, origin, fireEvent, resolve, isPreviewPanelAvailable, openPreviewPanel, fg('platform_smartlink_xpc_url_wrapping') ? transformUrl : undefined, fg('preview_panel_unit_check') ? isPreviewRestricted : undefined),
96
100
  subscriberCount: extractSubscriberCount(data),
97
101
  subTasksProgress: extractSubTasksProgress(data),
98
102
  storyPoints: extractStoryPoints(data),
@@ -20,6 +20,7 @@ export function useSmartLink(id, url, appearance) {
20
20
  var _useSmartLinkContext = useSmartLinkContext(),
21
21
  store = _useSmartLinkContext.store,
22
22
  isPreviewPanelAvailable = _useSmartLinkContext.isPreviewPanelAvailable,
23
+ isPreviewRestricted = _useSmartLinkContext.isPreviewRestricted,
23
24
  openPreviewPanel = _useSmartLinkContext.openPreviewPanel;
24
25
  var actions = useSmartLinkActions(id, url);
25
26
  var config = useSmartLinkConfig();
@@ -48,6 +49,7 @@ export function useSmartLink(id, url, appearance) {
48
49
  renderers: renderers,
49
50
  error: error,
50
51
  isPreviewPanelAvailable: isPreviewPanelAvailable,
52
+ isPreviewRestricted: fg('preview_panel_unit_check') ? isPreviewRestricted : undefined,
51
53
  openPreviewPanel: openPreviewPanel
52
54
  };
53
55
  }
@@ -33,6 +33,7 @@ export function useSmartLinkActions(_ref) {
33
33
  fireEvent = _useAnalyticsEvents.fireEvent;
34
34
  var _useSmartLinkContext = useSmartLinkContext(),
35
35
  isPreviewPanelAvailable = _useSmartLinkContext.isPreviewPanelAvailable,
36
+ isPreviewRestricted = _useSmartLinkContext.isPreviewRestricted,
36
37
  openPreviewPanel = _useSmartLinkContext.openPreviewPanel;
37
38
  var invokeClientAction = useInvokeClientAction({
38
39
  fireEvent: fireEvent
@@ -67,10 +68,13 @@ export function useSmartLinkActions(_ref) {
67
68
  if (viewActionProps) {
68
69
  actions.push(toAction(viewActionProps, invokeClientAction, messages.view, 'view-content'));
69
70
  }
70
- var previewActionProps = extractInvokePreviewAction(_objectSpread(_objectSpread({}, invokeParam), {}, {
71
+ var previewActionProps = extractInvokePreviewAction(_objectSpread(_objectSpread(_objectSpread({}, invokeParam), {}, {
71
72
  fireEvent: fireEvent,
72
73
  origin: origin,
73
- isPreviewPanelAvailable: isPreviewPanelAvailable,
74
+ isPreviewPanelAvailable: isPreviewPanelAvailable
75
+ }, fg('preview_panel_unit_check') ? {
76
+ isPreviewRestricted: isPreviewRestricted
77
+ } : undefined), {}, {
74
78
  openPreviewPanel: openPreviewPanel
75
79
  }, fg('platform_smartlink_xpc_url_wrapping') ? {
76
80
  transformUrl: function transformUrl() {
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
4
4
  export var context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card" || '',
7
- packageVersion: "45.15.1" || ''
7
+ packageVersion: "45.15.2" || ''
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,4 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2
5
  import React, { useCallback, useEffect, useMemo } from 'react';
3
6
  import { useSmartLinkContext } from '@atlaskit/link-provider';
4
7
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -48,6 +51,7 @@ var FlexibleCard = function FlexibleCard(_ref) {
48
51
  var resolve = useResolve();
49
52
  var _useSmartLinkContext = useSmartLinkContext(),
50
53
  isPreviewPanelAvailable = _useSmartLinkContext.isPreviewPanelAvailable,
54
+ isPreviewRestricted = _useSmartLinkContext.isPreviewRestricted,
51
55
  openPreviewPanel = _useSmartLinkContext.openPreviewPanel,
52
56
  product = _useSmartLinkContext.product;
53
57
  var rovoConfig = useRovoConfig();
@@ -72,7 +76,7 @@ var FlexibleCard = function FlexibleCard(_ref) {
72
76
  }, [placeholderData, status]);
73
77
  var placeHolderStatus = placeholderCardState ? placeholderCardState.status : undefined;
74
78
  var context = useMemo(function () {
75
- return getContextByStatus({
79
+ return getContextByStatus(_objectSpread(_objectSpread({
76
80
  aiSummaryConfig: aiSummaryConfig,
77
81
  appearance: appearance,
78
82
  fireEvent: fireEvent,
@@ -90,11 +94,14 @@ var FlexibleCard = function FlexibleCard(_ref) {
90
94
  actionOptions: actionOptions,
91
95
  status: placeholderCardState ? placeHolderStatus : status,
92
96
  url: url,
93
- isPreviewPanelAvailable: isPreviewPanelAvailable,
97
+ isPreviewPanelAvailable: isPreviewPanelAvailable
98
+ }, fg('preview_panel_unit_check') ? {
99
+ isPreviewRestricted: isPreviewRestricted
100
+ } : undefined), {}, {
94
101
  openPreviewPanel: openPreviewPanel,
95
102
  transformUrl: transformUrl
96
- });
97
- }, [aiSummaryConfig, appearance, actionOptions, details, id, isPreviewPanelAvailable, onAuthorize, onClick, onAuxClick, onContextMenu, openPreviewPanel, origin, placeholderCardState, placeHolderStatus, product, renderers, resolve, rovoConfig, status, transformUrl, url, fireEvent]);
103
+ }));
104
+ }, [aiSummaryConfig, appearance, actionOptions, details, id, isPreviewPanelAvailable, isPreviewRestricted, onAuthorize, onClick, onAuxClick, onContextMenu, openPreviewPanel, origin, placeholderCardState, placeHolderStatus, product, renderers, resolve, rovoConfig, status, transformUrl, url, fireEvent]);
98
105
  var flexibleCardContext = useMemo(function () {
99
106
  return {
100
107
  data: context,
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
12
12
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
13
13
  var PACKAGE_DATA = {
14
14
  packageName: "@atlaskit/smart-card",
15
- packageVersion: "45.15.1",
15
+ packageVersion: "45.15.2",
16
16
  componentName: 'linkUrl'
17
17
  };
18
18
  var LinkUrl = function LinkUrl(_ref) {
@@ -8,6 +8,9 @@ export type ExtractInvokePreviewActionParam = ExtractClientActionsParam & {
8
8
  isPreviewPanelAvailable?: (params: {
9
9
  ari: string;
10
10
  }) => boolean;
11
+ isPreviewRestricted?: (params: {
12
+ ari: string;
13
+ }) => boolean;
11
14
  onClose?: EmbedModalProps['onClose'];
12
15
  openPreviewPanel?: (params: {
13
16
  ari: string;
@@ -16,6 +16,9 @@ export type ExtractActionsParam = {
16
16
  isPreviewPanelAvailable?: (params: {
17
17
  ari: string;
18
18
  }) => boolean;
19
+ isPreviewRestricted?: (params: {
20
+ ari: string;
21
+ }) => boolean;
19
22
  openPreviewPanel?: (params: {
20
23
  ari: string;
21
24
  iconUrl: string | undefined;
@@ -32,4 +35,4 @@ export type ExtractActionsParam = {
32
35
  transformUrl?: TransformUrlFn;
33
36
  url?: string;
34
37
  };
35
- export declare const extractFlexibleCardActions: ({ actionOptions, aiSummaryConfig, appearance, fireEvent, id, origin, product, response, rovoConfig, transformUrl, url, isPreviewPanelAvailable, openPreviewPanel, }: ExtractActionsParam) => FlexibleUiActions | undefined;
38
+ export declare const extractFlexibleCardActions: ({ actionOptions, aiSummaryConfig, appearance, fireEvent, id, origin, product, response, rovoConfig, transformUrl, url, isPreviewPanelAvailable, isPreviewRestricted, openPreviewPanel, }: ExtractActionsParam) => FlexibleUiActions | undefined;
@@ -15,5 +15,7 @@ declare const extractState: (response?: JsonLd.Response, actionOptions?: CardAct
15
15
  embedUrl?: string;
16
16
  };
17
17
  url: string;
18
- }) => void, transformUrl?: TransformUrlFn) => LinkLozenge | undefined;
18
+ }) => void, transformUrl?: TransformUrlFn, isPreviewRestricted?: (params: {
19
+ ari: string;
20
+ }) => boolean) => LinkLozenge | undefined;
19
21
  export default extractState;
@@ -1,4 +1,4 @@
1
1
  import { type FlexibleUiDataContext } from '../../state/flexible-ui-context/types';
2
2
  import { type ExtractFlexibleUiDataContextParams } from '../../view/FlexibleCard/types';
3
- declare const extractFlexibleUiContext: ({ appearance, fireEvent, id, onClick, onAuxClick, onContextMenu, origin, product, resolve, rovoConfig, actionOptions, response, status, aiSummaryConfig, isPreviewPanelAvailable, openPreviewPanel, transformUrl, ...props }?: Partial<ExtractFlexibleUiDataContextParams>) => FlexibleUiDataContext | undefined;
3
+ declare const extractFlexibleUiContext: ({ appearance, fireEvent, id, onClick, onAuxClick, onContextMenu, origin, product, resolve, rovoConfig, actionOptions, response, status, aiSummaryConfig, isPreviewPanelAvailable, isPreviewRestricted, openPreviewPanel, transformUrl, ...props }?: Partial<ExtractFlexibleUiDataContextParams>) => FlexibleUiDataContext | undefined;
4
4
  export default extractFlexibleUiContext;
@@ -24,6 +24,9 @@ export declare function useSmartLink(id: string, url: string, appearance?: CardA
24
24
  isPreviewPanelAvailable: ((props: {
25
25
  ari: string;
26
26
  }) => boolean) | undefined;
27
+ isPreviewRestricted: ((props: {
28
+ ari: string;
29
+ }) => boolean) | undefined;
27
30
  openPreviewPanel: ((props: {
28
31
  ari: string;
29
32
  iconUrl: string | undefined;
@@ -188,6 +188,9 @@ export type ExtractFlexibleUiDataContextParams = Pick<FlexibleCardProps, 'appear
188
188
  isPreviewPanelAvailable?: (params: {
189
189
  ari: string;
190
190
  }) => boolean;
191
+ isPreviewRestricted?: (params: {
192
+ ari: string;
193
+ }) => boolean;
191
194
  openPreviewPanel?: (params: {
192
195
  ari: string;
193
196
  iconUrl: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "45.15.2",
3
+ "version": "45.16.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -88,7 +88,7 @@
88
88
  "@atlaskit/textfield": "^9.1.0",
89
89
  "@atlaskit/theme": "^26.1.0",
90
90
  "@atlaskit/tile": "^2.3.0",
91
- "@atlaskit/tmp-editor-statsig": "^135.7.0",
91
+ "@atlaskit/tmp-editor-statsig": "^135.8.0",
92
92
  "@atlaskit/tokens": "^16.3.0",
93
93
  "@atlaskit/tooltip": "^24.0.0",
94
94
  "@atlaskit/ufo": "^1.0.0",
@@ -108,7 +108,7 @@
108
108
  "uuid": "^3.1.0"
109
109
  },
110
110
  "peerDependencies": {
111
- "@atlaskit/link-provider": "^5.2.0",
111
+ "@atlaskit/link-provider": "^5.3.0",
112
112
  "react": "^18.2.0",
113
113
  "react-dom": "^18.2.0",
114
114
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
@@ -282,6 +282,9 @@
282
282
  "navx-5343-sl-action-block-styling-fixes": {
283
283
  "type": "boolean"
284
284
  },
285
+ "preview_panel_unit_check": {
286
+ "type": "boolean"
287
+ },
285
288
  "nike_r19_render_unmount": {
286
289
  "type": "boolean"
287
290
  }