@atlaskit/smart-card 40.12.0 → 40.13.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 40.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`ffc3ef708967c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ffc3ef708967c) -
8
+ [ux] Adds an optional disablePreviewPanel prop on a smartcard to allow consumers opt out of
9
+ opening Preview Panel by default when a smartlink is clicked.
10
+
11
+ ## 40.12.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [`ea0c752bfa736`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ea0c752bfa736) -
16
+ [ux] Changing passionfruit extension key for Smart Links
17
+
3
18
  ## 40.12.0
4
19
 
5
20
  ### Minor Changes
@@ -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: "40.11.0"
14
+ packageVersion: "40.12.1"
15
15
  };
16
16
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
17
17
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -74,7 +74,7 @@ var getSimulatedBetterMetadata = exports.getSimulatedBetterMetadata = function g
74
74
  name: _constants.ElementName.AppliedToComponentsCount
75
75
  }].concat(baseBottomMetaData)
76
76
  };
77
- case 'passionfruit-object-provider':
77
+ case 'integration-passionfruit-object-provider':
78
78
  if ((0, _platformFeatureFlags.fg)('passionfruit_ask_smart_links_enabled')) {
79
79
  return {
80
80
  titleMetadata: defaultTitleMetadata,
@@ -53,7 +53,8 @@ function Component(_ref) {
53
53
  resolvingPlaceholder = _ref.resolvingPlaceholder,
54
54
  truncateInline = _ref.truncateInline,
55
55
  CompetitorPrompt = _ref.CompetitorPrompt,
56
- hideIconLoadingSkeleton = _ref.hideIconLoadingSkeleton;
56
+ hideIconLoadingSkeleton = _ref.hideIconLoadingSkeleton,
57
+ disablePreviewPanel = _ref.disablePreviewPanel;
57
58
  var _useAnalyticsEventsNe = (0, _analyticsNext.useAnalyticsEvents)(),
58
59
  createAnalyticsEvent = _useAnalyticsEventsNe.createAnalyticsEvent;
59
60
  var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
@@ -116,12 +117,13 @@ function Component(_ref) {
116
117
  }
117
118
  }
118
119
  }
120
+ var isDisablePreviewPanel = disablePreviewPanel && (0, _expValEquals.expValEquals)('platform_editor_preview_panel_linking_exp', 'isEnabled', true);
119
121
 
120
122
  // If preview panel is available and the user clicked on the link,
121
123
  // delegate the click to the preview panel handler
122
124
  if (!isModifierKeyPressed && ari && name && openPreviewPanel && isPreviewPanelAvailable !== null && isPreviewPanelAvailable !== void 0 && isPreviewPanelAvailable({
123
125
  ari: ari
124
- }) && !(0, _expValEquals.expValEquals)('platform_editor_preview_panel_linking_exp', 'isEnabled', true)) {
126
+ }) && !isDisablePreviewPanel) {
125
127
  event.preventDefault();
126
128
  event.stopPropagation();
127
129
  openPreviewPanel({
@@ -156,7 +158,7 @@ function Component(_ref) {
156
158
  }
157
159
  (0, _click.fireLinkClickedEvent)(createAnalyticsEvent)(event);
158
160
  }
159
- }, [fireEvent, id, isFlexibleUi, appearance, definitionId, onClick, url, state.details, ari, name, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, thirdPartyARI, firstPartyIdentifier]);
161
+ }, [fireEvent, id, isFlexibleUi, appearance, definitionId, onClick, url, state.details, ari, name, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, thirdPartyARI, firstPartyIdentifier, disablePreviewPanel]);
160
162
  var handleAuthorize = (0, _react.useCallback)(function () {
161
163
  return actions.authorize(appearance);
162
164
  }, [actions, appearance]);
@@ -70,7 +70,8 @@ function CardWithURLRenderer(props) {
70
70
  removeTextHighlightingFromTitle = props.removeTextHighlightingFromTitle,
71
71
  resolvingPlaceholder = props.resolvingPlaceholder,
72
72
  truncateInline = props.truncateInline,
73
- CompetitorPrompt = props.CompetitorPrompt;
73
+ CompetitorPrompt = props.CompetitorPrompt,
74
+ disablePreviewPanel = props.disablePreviewPanel;
74
75
  var isFlexibleUi = (0, _flexible.isFlexibleUiCard)(children, ui);
75
76
  var analyticsContext = (0, _SmartLinkAnalyticsContext.useSmartLinkAnalyticsContext)({
76
77
  display: isFlexibleUi ? 'flexible' : appearance,
@@ -146,7 +147,8 @@ function CardWithURLRenderer(props) {
146
147
  removeTextHighlightingFromTitle: removeTextHighlightingFromTitle,
147
148
  resolvingPlaceholder: resolvingPlaceholder,
148
149
  truncateInline: truncateInline,
149
- CompetitorPrompt: CompetitorPrompt
150
+ CompetitorPrompt: CompetitorPrompt,
151
+ disablePreviewPanel: disablePreviewPanel
150
152
  };
151
153
  return /*#__PURE__*/_react.default.createElement(_reactErrorBoundary.ErrorBoundary, {
152
154
  FallbackComponent: ErrorFallback,
@@ -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: "40.11.0",
22
+ packageVersion: "40.12.1",
23
23
  componentName: 'linkUrl'
24
24
  };
25
25
  var Anchor = (0, _click.withLinkClickedEvent)('a');
@@ -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: "40.11.0"
5
+ packageVersion: "40.12.1"
6
6
  };
7
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
8
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -68,7 +68,7 @@ export const getSimulatedBetterMetadata = cardDetails => {
68
68
  name: ElementName.AppliedToComponentsCount
69
69
  }, ...baseBottomMetaData]
70
70
  };
71
- case 'passionfruit-object-provider':
71
+ case 'integration-passionfruit-object-provider':
72
72
  if (fg('passionfruit_ask_smart_links_enabled')) {
73
73
  return {
74
74
  titleMetadata: defaultTitleMetadata,
@@ -44,7 +44,8 @@ function Component({
44
44
  resolvingPlaceholder,
45
45
  truncateInline,
46
46
  CompetitorPrompt,
47
- hideIconLoadingSkeleton
47
+ hideIconLoadingSkeleton,
48
+ disablePreviewPanel
48
49
  }) {
49
50
  const {
50
51
  createAnalyticsEvent
@@ -109,12 +110,13 @@ function Component({
109
110
  }
110
111
  }
111
112
  }
113
+ const isDisablePreviewPanel = disablePreviewPanel && expValEquals('platform_editor_preview_panel_linking_exp', 'isEnabled', true);
112
114
 
113
115
  // If preview panel is available and the user clicked on the link,
114
116
  // delegate the click to the preview panel handler
115
117
  if (!isModifierKeyPressed && ari && name && openPreviewPanel && isPreviewPanelAvailable !== null && isPreviewPanelAvailable !== void 0 && isPreviewPanelAvailable({
116
118
  ari
117
- }) && !expValEquals('platform_editor_preview_panel_linking_exp', 'isEnabled', true)) {
119
+ }) && !isDisablePreviewPanel) {
118
120
  event.preventDefault();
119
121
  event.stopPropagation();
120
122
  openPreviewPanel({
@@ -149,7 +151,7 @@ function Component({
149
151
  }
150
152
  fireLinkClickedEvent(createAnalyticsEvent)(event);
151
153
  }
152
- }, [fireEvent, id, isFlexibleUi, appearance, definitionId, onClick, url, state.details, ari, name, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, thirdPartyARI, firstPartyIdentifier]);
154
+ }, [fireEvent, id, isFlexibleUi, appearance, definitionId, onClick, url, state.details, ari, name, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, thirdPartyARI, firstPartyIdentifier, disablePreviewPanel]);
153
155
  const handleAuthorize = useCallback(() => actions.authorize(appearance), [actions, appearance]);
154
156
  const handleRetry = useCallback(() => {
155
157
  actions.reload();
@@ -48,7 +48,8 @@ export function CardWithURLRenderer(props) {
48
48
  removeTextHighlightingFromTitle,
49
49
  resolvingPlaceholder,
50
50
  truncateInline,
51
- CompetitorPrompt
51
+ CompetitorPrompt,
52
+ disablePreviewPanel
52
53
  } = props;
53
54
  const isFlexibleUi = isFlexibleUiCard(children, ui);
54
55
  const analyticsContext = useSmartLinkAnalyticsContext({
@@ -125,7 +126,8 @@ export function CardWithURLRenderer(props) {
125
126
  removeTextHighlightingFromTitle,
126
127
  resolvingPlaceholder,
127
128
  truncateInline,
128
- CompetitorPrompt
129
+ CompetitorPrompt,
130
+ disablePreviewPanel
129
131
  };
130
132
  return /*#__PURE__*/React.createElement(ErrorBoundary, {
131
133
  FallbackComponent: ErrorFallback,
@@ -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: "40.11.0",
12
+ packageVersion: "40.12.1",
13
13
  componentName: 'linkUrl'
14
14
  };
15
15
  const Anchor = withLinkClickedEvent('a');
@@ -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: "40.11.0"
7
+ packageVersion: "40.12.1"
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -68,7 +68,7 @@ export var getSimulatedBetterMetadata = function getSimulatedBetterMetadata(card
68
68
  name: ElementName.AppliedToComponentsCount
69
69
  }].concat(baseBottomMetaData)
70
70
  };
71
- case 'passionfruit-object-provider':
71
+ case 'integration-passionfruit-object-provider':
72
72
  if (fg('passionfruit_ask_smart_links_enabled')) {
73
73
  return {
74
74
  titleMetadata: defaultTitleMetadata,
@@ -44,7 +44,8 @@ function Component(_ref) {
44
44
  resolvingPlaceholder = _ref.resolvingPlaceholder,
45
45
  truncateInline = _ref.truncateInline,
46
46
  CompetitorPrompt = _ref.CompetitorPrompt,
47
- hideIconLoadingSkeleton = _ref.hideIconLoadingSkeleton;
47
+ hideIconLoadingSkeleton = _ref.hideIconLoadingSkeleton,
48
+ disablePreviewPanel = _ref.disablePreviewPanel;
48
49
  var _useAnalyticsEventsNe = useAnalyticsEventsNext(),
49
50
  createAnalyticsEvent = _useAnalyticsEventsNe.createAnalyticsEvent;
50
51
  var _useAnalyticsEvents = useAnalyticsEvents(),
@@ -107,12 +108,13 @@ function Component(_ref) {
107
108
  }
108
109
  }
109
110
  }
111
+ var isDisablePreviewPanel = disablePreviewPanel && expValEquals('platform_editor_preview_panel_linking_exp', 'isEnabled', true);
110
112
 
111
113
  // If preview panel is available and the user clicked on the link,
112
114
  // delegate the click to the preview panel handler
113
115
  if (!isModifierKeyPressed && ari && name && openPreviewPanel && isPreviewPanelAvailable !== null && isPreviewPanelAvailable !== void 0 && isPreviewPanelAvailable({
114
116
  ari: ari
115
- }) && !expValEquals('platform_editor_preview_panel_linking_exp', 'isEnabled', true)) {
117
+ }) && !isDisablePreviewPanel) {
116
118
  event.preventDefault();
117
119
  event.stopPropagation();
118
120
  openPreviewPanel({
@@ -147,7 +149,7 @@ function Component(_ref) {
147
149
  }
148
150
  fireLinkClickedEvent(createAnalyticsEvent)(event);
149
151
  }
150
- }, [fireEvent, id, isFlexibleUi, appearance, definitionId, onClick, url, state.details, ari, name, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, thirdPartyARI, firstPartyIdentifier]);
152
+ }, [fireEvent, id, isFlexibleUi, appearance, definitionId, onClick, url, state.details, ari, name, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, thirdPartyARI, firstPartyIdentifier, disablePreviewPanel]);
151
153
  var handleAuthorize = useCallback(function () {
152
154
  return actions.authorize(appearance);
153
155
  }, [actions, appearance]);
@@ -58,7 +58,8 @@ export function CardWithURLRenderer(props) {
58
58
  removeTextHighlightingFromTitle = props.removeTextHighlightingFromTitle,
59
59
  resolvingPlaceholder = props.resolvingPlaceholder,
60
60
  truncateInline = props.truncateInline,
61
- CompetitorPrompt = props.CompetitorPrompt;
61
+ CompetitorPrompt = props.CompetitorPrompt,
62
+ disablePreviewPanel = props.disablePreviewPanel;
62
63
  var isFlexibleUi = isFlexibleUiCard(children, ui);
63
64
  var analyticsContext = useSmartLinkAnalyticsContext({
64
65
  display: isFlexibleUi ? 'flexible' : appearance,
@@ -134,7 +135,8 @@ export function CardWithURLRenderer(props) {
134
135
  removeTextHighlightingFromTitle: removeTextHighlightingFromTitle,
135
136
  resolvingPlaceholder: resolvingPlaceholder,
136
137
  truncateInline: truncateInline,
137
- CompetitorPrompt: CompetitorPrompt
138
+ CompetitorPrompt: CompetitorPrompt,
139
+ disablePreviewPanel: disablePreviewPanel
138
140
  };
139
141
  return /*#__PURE__*/React.createElement(ErrorBoundary, {
140
142
  FallbackComponent: ErrorFallback,
@@ -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: "40.11.0",
15
+ packageVersion: "40.12.1",
16
16
  componentName: 'linkUrl'
17
17
  };
18
18
  var Anchor = withLinkClickedEvent('a');
@@ -111,6 +111,11 @@ export interface BaseCardProps {
111
111
  sourceUrl: string;
112
112
  linkType?: string;
113
113
  }>;
114
+ /**
115
+ * When Preview panel is supported, onClick is ignored and the panel opens by default.
116
+ * This prop allows smartlinks inside of editor to bypass that as they have other ways to open Preview panel.
117
+ */
118
+ disablePreviewPanel?: boolean;
114
119
  }
115
120
  export interface InlineProps extends HoverPreviewProps {
116
121
  /**
@@ -35,4 +35,5 @@ export type CardWithUrlContentProps = {
35
35
  linkType?: string;
36
36
  }>;
37
37
  hideIconLoadingSkeleton?: boolean;
38
+ disablePreviewPanel?: boolean;
38
39
  };
@@ -111,6 +111,11 @@ export interface BaseCardProps {
111
111
  sourceUrl: string;
112
112
  linkType?: string;
113
113
  }>;
114
+ /**
115
+ * When Preview panel is supported, onClick is ignored and the panel opens by default.
116
+ * This prop allows smartlinks inside of editor to bypass that as they have other ways to open Preview panel.
117
+ */
118
+ disablePreviewPanel?: boolean;
114
119
  }
115
120
  export interface InlineProps extends HoverPreviewProps {
116
121
  /**
@@ -35,4 +35,5 @@ export type CardWithUrlContentProps = {
35
35
  linkType?: string;
36
36
  }>;
37
37
  hideIconLoadingSkeleton?: boolean;
38
+ disablePreviewPanel?: boolean;
38
39
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "40.12.0",
3
+ "version": "40.13.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -36,7 +36,7 @@
36
36
  "@atlaskit/css": "^0.12.0",
37
37
  "@atlaskit/dropdown-menu": "^16.3.0",
38
38
  "@atlaskit/feature-gate-js-client": "^5.5.0",
39
- "@atlaskit/form": "^12.1.0",
39
+ "@atlaskit/form": "^12.2.0",
40
40
  "@atlaskit/frontend-utilities": "^3.1.0",
41
41
  "@atlaskit/heading": "^5.2.0",
42
42
  "@atlaskit/icon": "^28.0.0",
@@ -68,7 +68,7 @@
68
68
  "@atlaskit/textarea": "^8.0.0",
69
69
  "@atlaskit/textfield": "^8.0.0",
70
70
  "@atlaskit/theme": "^19.0.0",
71
- "@atlaskit/tmp-editor-statsig": "^11.3.0",
71
+ "@atlaskit/tmp-editor-statsig": "^11.5.0",
72
72
  "@atlaskit/tokens": "^6.0.0",
73
73
  "@atlaskit/tooltip": "^20.4.0",
74
74
  "@atlaskit/ufo": "^0.4.0",
@@ -170,9 +170,6 @@
170
170
  "platform-visual-refresh-icons": {
171
171
  "type": "boolean"
172
172
  },
173
- "platform-visual-refresh-icons-legacy-facade": {
174
- "type": "boolean"
175
- },
176
173
  "platform-component-visual-refresh": {
177
174
  "type": "boolean"
178
175
  },