@atlaskit/smart-card 30.2.3 → 30.2.5

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,22 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 30.2.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#164921](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/164921)
8
+ [`e8067159036a3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e8067159036a3) -
9
+ Fix smartLinkIframe location attribute not being included when fired
10
+ - Updated dependencies
11
+
12
+ ## 30.2.4
13
+
14
+ ### Patch Changes
15
+
16
+ - [#161848](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/161848)
17
+ [`b3284704393ce`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b3284704393ce) -
18
+ Migrate analytics for smartlinkiframe
19
+
3
20
  ## 30.2.3
4
21
 
5
22
  ### Patch Changes
@@ -2,22 +2,33 @@ common:
2
2
  product: media
3
3
 
4
4
  context:
5
- PackageMetaData: &PackageMetaDataContext
5
+ PackageMetaDataContext: &PackageMetaDataContext
6
6
  packageName:
7
7
  type: string
8
8
  description: name of the package the event was fired from
9
9
  packageVersion:
10
10
  type: string
11
11
  description: version of the package the event was fired from
12
-
13
- ResolvedAttributes: &ResolvedAttributes
12
+ ResolvedContext: &ResolvedContext
14
13
  status:
15
- type: ['pending', 'resolving', 'resolved', 'errored', 'fallback', 'unauthorized', 'forbidden', 'not_found']
14
+ type:
15
+ [
16
+ 'pending',
17
+ 'resolving',
18
+ 'resolved',
19
+ 'errored',
20
+ 'fallback',
21
+ 'unauthorized',
22
+ 'forbidden',
23
+ 'not_found',
24
+ ]
16
25
  description: The status of the link resolution at the time of the event.
17
26
  required: false
18
27
  statusDetails:
19
28
  type: string
20
- description: Provides further information of the resolved status. May be different for different status values
29
+ description:
30
+ Provides further information of the resolved status. May be different for different status
31
+ values
21
32
  required: false
22
33
  displayCategory:
23
34
  type: ['smartLink', 'link']
@@ -71,37 +82,49 @@ context:
71
82
  type: boolean
72
83
  required: false
73
84
  description: An indicator that a link can be converted to datasource view
85
+ location:
86
+ required: false
87
+ type: string
88
+ description: Where the Smart Link is currently rendered
89
+ resourceType:
90
+ required: false
91
+ type: string
92
+ description: Type of resource the link is pointing to
74
93
 
75
- aiInteractionAttributes: &aiInteractionAttributes
94
+ attributes:
95
+ AiInteractionAttributes: &AiInteractionAttributes
76
96
  aiFeatureName:
77
97
  type: string
78
98
  description: The name of the AI feature as shared with AI team
79
99
  proactiveAIGenerated:
80
100
  type: number
81
- description: Attribute that captures the fact that an AI generated result was proactively served to a user.
101
+ description:
102
+ Attribute that captures the fact that an AI generated result was proactively served to a
103
+ user.
82
104
  userGeneratedAI:
83
105
  type: number
84
- description: Attribute that captures the fact that a user interaction with a feature lead to generation of an AI result.
85
-
106
+ description:
107
+ Attribute that captures the fact that a user interaction with a feature lead to generation
108
+ of an AI result.
86
109
 
87
110
  events:
88
111
  - button clicked (aiSummary):
89
112
  type: ui
90
113
  description: fired when an ai summary is clicked
91
114
  attributes:
92
- <<: [*PackageMetaDataContext, *ResolvedAttributes]
115
+ <<: [*PackageMetaDataContext, *ResolvedContext]
93
116
 
94
117
  - button clicked (copySummary):
95
118
  type: ui
96
119
  description: fired when the copy ai summary button is clicked
97
120
  attributes:
98
- <<: [*PackageMetaDataContext, *ResolvedAttributes]
121
+ <<: [*PackageMetaDataContext, *ResolvedContext]
99
122
 
100
123
  - summary viewed:
101
124
  type: ui
102
125
  description: fired when a summary is viewed
103
126
  attributes:
104
- <<: [*PackageMetaDataContext, *ResolvedAttributes]
127
+ <<: [*PackageMetaDataContext, *ResolvedContext]
105
128
  fromCache:
106
129
  required: false
107
130
  type: boolean
@@ -111,19 +134,19 @@ events:
111
134
  type: ui
112
135
  description: fired when a summary error is viewed
113
136
  attributes:
114
- <<: [*PackageMetaDataContext, *ResolvedAttributes]
137
+ <<: [*PackageMetaDataContext, *ResolvedContext]
115
138
 
116
139
  - summary success:
117
140
  type: operational
118
141
  description: fired when a summary request finishes with a successful response
119
142
  attributes:
120
- <<: [*PackageMetaDataContext, *ResolvedAttributes]
143
+ <<: [*PackageMetaDataContext, *ResolvedContext]
121
144
 
122
145
  - summary failed:
123
146
  type: operational
124
147
  description: fired when a summary request finishes with a failed response
125
148
  attributes:
126
- <<: [*PackageMetaDataContext, *ResolvedAttributes]
149
+ <<: [*PackageMetaDataContext, *ResolvedContext]
127
150
  reason:
128
151
  required: false
129
152
  type: string
@@ -133,36 +156,35 @@ events:
133
156
  type: boolean
134
157
  description: True if the error should be counted towards the SLO.
135
158
 
136
-
137
159
  - aiInteraction initiated:
138
160
  type: track
139
161
  description: fired when an explicit request is made to use an AI-powered feature
140
162
  attributes:
141
- <<: [*PackageMetaDataContext, *aiInteractionAttributes]
163
+ <<: [*PackageMetaDataContext, *AiInteractionAttributes]
142
164
 
143
165
  - button clicked (automationAction):
144
166
  type: ui
145
167
  description: fired when the automation action button is clicked
146
168
  attributes:
147
- <<: [*PackageMetaDataContext, *ResolvedAttributes]
169
+ <<: [*PackageMetaDataContext, *ResolvedContext]
148
170
 
149
171
  - button clicked (relatedLinks):
150
172
  type: ui
151
173
  description: fired when the related links action button is clicked
152
174
  attributes:
153
- <<: [*PackageMetaDataContext, *ResolvedAttributes]
175
+ <<: [*PackageMetaDataContext, *ResolvedContext]
154
176
 
155
177
  - modal opened (relatedLinks):
156
178
  type: ui
157
179
  description: fired when related links modal is opened
158
180
  attributes:
159
- <<: [*PackageMetaDataContext, *ResolvedAttributes]
181
+ <<: [*PackageMetaDataContext, *ResolvedContext]
160
182
 
161
183
  - modal closed (relatedLinks):
162
184
  type: ui
163
185
  description: fired when related links modal is closed
164
186
  attributes:
165
- <<: [*PackageMetaDataContext, *ResolvedAttributes]
187
+ <<: [*PackageMetaDataContext, *ResolvedContext]
166
188
  dwellTime:
167
189
  required: true
168
190
  type: number
@@ -170,9 +192,9 @@ events:
170
192
 
171
193
  - relatedLinks success:
172
194
  type: operational
173
- description: fired when related links are retrieved succesfully
195
+ description: fired when related links are retrieved successfully
174
196
  attributes:
175
- <<: [*PackageMetaDataContext, *ResolvedAttributes]
197
+ <<: [*PackageMetaDataContext, *ResolvedContext]
176
198
  incomingCount:
177
199
  type: number
178
200
  required: true
@@ -186,8 +208,49 @@ events:
186
208
  type: operational
187
209
  description: fired when related links retrieval fails
188
210
  attributes:
189
- <<: [*PackageMetaDataContext, *ResolvedAttributes]
211
+ <<: [*PackageMetaDataContext, *ResolvedContext]
190
212
  reason:
191
213
  required: true
192
214
  type: string
193
215
  description: failure reason
216
+ - smartLinkIframe dwelled:
217
+ type: ui
218
+ description: fired when a user dwells their cursor on a Smart Link's iframe
219
+ attributes:
220
+ <<: [*PackageMetaDataContext, *ResolvedContext]
221
+ id:
222
+ required: true
223
+ type: string
224
+ description: The unique ID for this Smart Link
225
+ display:
226
+ required: true
227
+ type: ['inline', 'block', 'embed', 'embedPreview', 'flexible', 'hoverCardPreview']
228
+ description: Whether the card was an Inline, Block, Embed or Flexible UI
229
+ definitionId:
230
+ required: false
231
+ type: string
232
+ description: The definitionId of the Smart Link resolver invoked.
233
+ dwellTime:
234
+ required: true
235
+ type: number
236
+ description: Total seconds that the user has dwelled on this iframe
237
+ dwellPercentVisible:
238
+ required: true
239
+ type: number
240
+ description: Percentage element was visible at end of dwell
241
+ - smartLinkIframe focus:
242
+ type: ui
243
+ description: fires when a user clicks or tabs into a Smart Link's iframe.
244
+ attributes:
245
+ id:
246
+ required: true
247
+ type: string
248
+ description: The unique ID for this Smart Link.
249
+ display:
250
+ required: true
251
+ type: ['inline', 'block', 'embed', 'embedPreview', 'flexible', 'hoverCardPreview']
252
+ description: Whether the card was an Inline, Block, Embed or Flexible UI.
253
+ definitionId:
254
+ required: false
255
+ type: string
256
+ description: The definitionId of the Smart Link resolver invoked.
@@ -36,7 +36,6 @@ var applyCommonAttributes = function applyCommonAttributes(event, commonAttribut
36
36
  * Can be provided to Card via the analyticsEvents prop to change the analytics events.
37
37
  *
38
38
  * @param url URL of the link
39
- * @param dispatchAnalytics dispatchAnalytics function
40
39
  * @param id fallback id of the events sent if no id is available
41
40
  * @param defaultLocation location attribute to be used
42
41
  * @returns
@@ -187,6 +186,7 @@ var useSmartLinkAnalytics = exports.useSmartLinkAnalytics = function useSmartLin
187
186
  * @param dwellTime Total seconds that the user has dwelled on this iframe
188
187
  * @param dwellPercentVisible Percentage element was visible at end of dwell
189
188
  * @returns
189
+ * @deprecated
190
190
  */
191
191
  iframeDwelledEvent: function iframeDwelledEvent(_ref4) {
192
192
  var id = _ref4.id,
@@ -222,6 +222,7 @@ var useSmartLinkAnalytics = exports.useSmartLinkAnalytics = function useSmartLin
222
222
  * @param location Where the Smart Link is currently rendered.
223
223
  * @param destinationProduct The product the Smart Link is linked to.
224
224
  * @returns
225
+ * @deprecated
225
226
  */
226
227
  iframeFocusedEvent: function iframeFocusedEvent(_ref5) {
227
228
  var id = _ref5.id,
@@ -22,7 +22,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
22
22
  var context = exports.context = {
23
23
  componentName: 'smart-cards',
24
24
  packageName: "@atlaskit/smart-card",
25
- packageVersion: "30.2.3"
25
+ packageVersion: "30.2.5"
26
26
  };
27
27
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
28
28
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -91,7 +91,7 @@ var getSimulatedBetterMetadata = exports.getSimulatedBetterMetadata = function g
91
91
  }, {
92
92
  name: _constants.ElementName.ModifiedOn
93
93
  }];
94
- } else if (isJiraPlan && (0, _platformFeatureFlags.fg)('smart_links_for_plans')) {
94
+ } else if (isJiraPlan && (0, _platformFeatureFlags.fg)('smart_links_for_plans_platform')) {
95
95
  topMetadata = [{
96
96
  name: _constants.ElementName.OwnedByGroup
97
97
  }, {
@@ -8,6 +8,8 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.CardWithUrlContent = void 0;
9
9
  var _react = _interopRequireWildcard(require("react"));
10
10
  var _analyticsNext = require("@atlaskit/analytics-next");
11
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
+ var _useAnalyticsEvents2 = require("../../common/analytics/generated/use-analytics-events");
11
13
  var _constants = require("../../constants");
12
14
  var _state = require("../../state");
13
15
  var _helpers = require("../../state/helpers");
@@ -51,8 +53,10 @@ function Component(_ref) {
51
53
  removeTextHighlightingFromTitle = _ref.removeTextHighlightingFromTitle,
52
54
  resolvingPlaceholder = _ref.resolvingPlaceholder,
53
55
  truncateInline = _ref.truncateInline;
54
- var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
55
- createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
56
+ var _useAnalyticsEventsNe = (0, _analyticsNext.useAnalyticsEvents)(),
57
+ createAnalyticsEvent = _useAnalyticsEventsNe.createAnalyticsEvent;
58
+ var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
59
+ fireEvent = _useAnalyticsEvents.fireEvent;
56
60
 
57
61
  // Get state, actions for this card.
58
62
  var _useSmartLink = (0, _state.useSmartLink)(id, url),
@@ -156,29 +160,47 @@ function Component(_ref) {
156
160
  }
157
161
  }, [isFlexibleUi, appearance, state.status, url, definitionId, extensionKey, analytics.ui, id, canBeDatasource]);
158
162
  var onIframeDwell = (0, _react.useCallback)(function (dwellTime, dwellPercentVisible) {
159
- analytics.ui.iframeDwelledEvent({
160
- id: id,
161
- display: isFlexibleUi ? 'flexible' : appearance,
162
- status: state.status,
163
- definitionId: definitionId,
164
- extensionKey: extensionKey,
165
- destinationProduct: product,
166
- destinationSubproduct: subproduct,
167
- dwellTime: dwellTime,
168
- dwellPercentVisible: dwellPercentVisible
169
- });
170
- }, [id, state.status, analytics.ui, appearance, definitionId, extensionKey, isFlexibleUi, product, subproduct]);
163
+ if ((0, _platformFeatureFlags.fg)('smart-card-migrate-smartlinkiframe-analytics')) {
164
+ fireEvent('ui.smartLinkIframe.dwelled', {
165
+ id: id,
166
+ definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
167
+ display: isFlexibleUi ? 'flexible' : appearance,
168
+ dwellPercentVisible: dwellPercentVisible,
169
+ dwellTime: dwellTime
170
+ });
171
+ } else {
172
+ analytics.ui.iframeDwelledEvent({
173
+ id: id,
174
+ display: isFlexibleUi ? 'flexible' : appearance,
175
+ status: state.status,
176
+ definitionId: definitionId,
177
+ extensionKey: extensionKey,
178
+ destinationProduct: product,
179
+ destinationSubproduct: subproduct,
180
+ dwellTime: dwellTime,
181
+ dwellPercentVisible: dwellPercentVisible
182
+ });
183
+ }
184
+ }, [id, state.status, analytics.ui, appearance, definitionId, extensionKey, isFlexibleUi, product, subproduct, fireEvent]);
171
185
  var onIframeFocus = (0, _react.useCallback)(function () {
172
- analytics.ui.iframeFocusedEvent({
173
- id: id,
174
- display: isFlexibleUi ? 'flexible' : appearance,
175
- status: state.status,
176
- definitionId: definitionId,
177
- extensionKey: extensionKey,
178
- destinationProduct: product,
179
- destinationSubproduct: subproduct
180
- });
181
- }, [id, state.status, analytics.ui, appearance, definitionId, extensionKey, isFlexibleUi, product, subproduct]);
186
+ if ((0, _platformFeatureFlags.fg)('smart-card-migrate-smartlinkiframe-analytics')) {
187
+ fireEvent('ui.smartLinkIframe.focus', {
188
+ id: id,
189
+ definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
190
+ display: isFlexibleUi ? 'flexible' : appearance
191
+ });
192
+ } else {
193
+ analytics.ui.iframeFocusedEvent({
194
+ id: id,
195
+ display: isFlexibleUi ? 'flexible' : appearance,
196
+ status: state.status,
197
+ definitionId: definitionId,
198
+ extensionKey: extensionKey,
199
+ destinationProduct: product,
200
+ destinationSubproduct: subproduct
201
+ });
202
+ }
203
+ }, [id, state.status, analytics.ui, appearance, definitionId, extensionKey, isFlexibleUi, product, subproduct, fireEvent]);
182
204
  if (isFlexibleUi) {
183
205
  var cardState = state;
184
206
  if (error) {
@@ -17,7 +17,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
17
17
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
18
18
  var PACKAGE_DATA = {
19
19
  packageName: "@atlaskit/smart-card",
20
- packageVersion: "30.2.3",
20
+ packageVersion: "30.2.5",
21
21
  componentName: 'linkUrl'
22
22
  };
23
23
  var Link = (0, _click.withLinkClickedEvent)('a');
@@ -22,7 +22,6 @@ const applyCommonAttributes = (event, commonAttributes) => {
22
22
  * Can be provided to Card via the analyticsEvents prop to change the analytics events.
23
23
  *
24
24
  * @param url URL of the link
25
- * @param dispatchAnalytics dispatchAnalytics function
26
25
  * @param id fallback id of the events sent if no id is available
27
26
  * @param defaultLocation location attribute to be used
28
27
  * @returns
@@ -170,6 +169,7 @@ export const useSmartLinkAnalytics = (url, id, defaultLocation) => {
170
169
  * @param dwellTime Total seconds that the user has dwelled on this iframe
171
170
  * @param dwellPercentVisible Percentage element was visible at end of dwell
172
171
  * @returns
172
+ * @deprecated
173
173
  */
174
174
  iframeDwelledEvent: ({
175
175
  id,
@@ -204,6 +204,7 @@ export const useSmartLinkAnalytics = (url, id, defaultLocation) => {
204
204
  * @param location Where the Smart Link is currently rendered.
205
205
  * @param destinationProduct The product the Smart Link is linked to.
206
206
  * @returns
207
+ * @deprecated
207
208
  */
208
209
  iframeFocusedEvent: ({
209
210
  id,
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
4
4
  export const context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card",
7
- packageVersion: "30.2.3"
7
+ packageVersion: "30.2.5"
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -85,7 +85,7 @@ export const getSimulatedBetterMetadata = cardDetails => {
85
85
  }, {
86
86
  name: ElementName.ModifiedOn
87
87
  }];
88
- } else if (isJiraPlan && fg('smart_links_for_plans')) {
88
+ } else if (isJiraPlan && fg('smart_links_for_plans_platform')) {
89
89
  topMetadata = [{
90
90
  name: ElementName.OwnedByGroup
91
91
  }, {
@@ -1,5 +1,7 @@
1
1
  import React, { useCallback, useEffect, useMemo } from 'react';
2
- import { useAnalyticsEvents } from '@atlaskit/analytics-next';
2
+ import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/analytics-next';
3
+ import { fg } from '@atlaskit/platform-feature-flags';
4
+ import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
3
5
  import { CardDisplay } from '../../constants';
4
6
  import { useSmartLink } from '../../state';
5
7
  import { getCanBeDatasource, getClickUrl, getDefinitionId, getExtensionKey, getProduct, getResourceType, getServices, getSubproduct, isFinalState } from '../../state/helpers';
@@ -44,6 +46,9 @@ function Component({
44
46
  }) {
45
47
  const {
46
48
  createAnalyticsEvent
49
+ } = useAnalyticsEventsNext();
50
+ const {
51
+ fireEvent
47
52
  } = useAnalyticsEvents();
48
53
 
49
54
  // Get state, actions for this card.
@@ -143,29 +148,47 @@ function Component({
143
148
  }
144
149
  }, [isFlexibleUi, appearance, state.status, url, definitionId, extensionKey, analytics.ui, id, canBeDatasource]);
145
150
  const onIframeDwell = useCallback((dwellTime, dwellPercentVisible) => {
146
- analytics.ui.iframeDwelledEvent({
147
- id,
148
- display: isFlexibleUi ? 'flexible' : appearance,
149
- status: state.status,
150
- definitionId,
151
- extensionKey,
152
- destinationProduct: product,
153
- destinationSubproduct: subproduct,
154
- dwellTime: dwellTime,
155
- dwellPercentVisible: dwellPercentVisible
156
- });
157
- }, [id, state.status, analytics.ui, appearance, definitionId, extensionKey, isFlexibleUi, product, subproduct]);
151
+ if (fg('smart-card-migrate-smartlinkiframe-analytics')) {
152
+ fireEvent('ui.smartLinkIframe.dwelled', {
153
+ id,
154
+ definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
155
+ display: isFlexibleUi ? 'flexible' : appearance,
156
+ dwellPercentVisible,
157
+ dwellTime
158
+ });
159
+ } else {
160
+ analytics.ui.iframeDwelledEvent({
161
+ id,
162
+ display: isFlexibleUi ? 'flexible' : appearance,
163
+ status: state.status,
164
+ definitionId,
165
+ extensionKey,
166
+ destinationProduct: product,
167
+ destinationSubproduct: subproduct,
168
+ dwellTime: dwellTime,
169
+ dwellPercentVisible: dwellPercentVisible
170
+ });
171
+ }
172
+ }, [id, state.status, analytics.ui, appearance, definitionId, extensionKey, isFlexibleUi, product, subproduct, fireEvent]);
158
173
  const onIframeFocus = useCallback(() => {
159
- analytics.ui.iframeFocusedEvent({
160
- id,
161
- display: isFlexibleUi ? 'flexible' : appearance,
162
- status: state.status,
163
- definitionId,
164
- extensionKey,
165
- destinationProduct: product,
166
- destinationSubproduct: subproduct
167
- });
168
- }, [id, state.status, analytics.ui, appearance, definitionId, extensionKey, isFlexibleUi, product, subproduct]);
174
+ if (fg('smart-card-migrate-smartlinkiframe-analytics')) {
175
+ fireEvent('ui.smartLinkIframe.focus', {
176
+ id,
177
+ definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
178
+ display: isFlexibleUi ? 'flexible' : appearance
179
+ });
180
+ } else {
181
+ analytics.ui.iframeFocusedEvent({
182
+ id,
183
+ display: isFlexibleUi ? 'flexible' : appearance,
184
+ status: state.status,
185
+ definitionId,
186
+ extensionKey,
187
+ destinationProduct: product,
188
+ destinationSubproduct: subproduct
189
+ });
190
+ }
191
+ }, [id, state.status, analytics.ui, appearance, definitionId, extensionKey, isFlexibleUi, product, subproduct, fireEvent]);
169
192
  if (isFlexibleUi) {
170
193
  let cardState = state;
171
194
  if (error) {
@@ -7,7 +7,7 @@ import LinkWarningModal from './LinkWarningModal';
7
7
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
8
8
  const PACKAGE_DATA = {
9
9
  packageName: "@atlaskit/smart-card",
10
- packageVersion: "30.2.3",
10
+ packageVersion: "30.2.5",
11
11
  componentName: 'linkUrl'
12
12
  };
13
13
  const Link = withLinkClickedEvent('a');
@@ -29,7 +29,6 @@ var applyCommonAttributes = function applyCommonAttributes(event, commonAttribut
29
29
  * Can be provided to Card via the analyticsEvents prop to change the analytics events.
30
30
  *
31
31
  * @param url URL of the link
32
- * @param dispatchAnalytics dispatchAnalytics function
33
32
  * @param id fallback id of the events sent if no id is available
34
33
  * @param defaultLocation location attribute to be used
35
34
  * @returns
@@ -180,6 +179,7 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, id, defau
180
179
  * @param dwellTime Total seconds that the user has dwelled on this iframe
181
180
  * @param dwellPercentVisible Percentage element was visible at end of dwell
182
181
  * @returns
182
+ * @deprecated
183
183
  */
184
184
  iframeDwelledEvent: function iframeDwelledEvent(_ref4) {
185
185
  var id = _ref4.id,
@@ -215,6 +215,7 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, id, defau
215
215
  * @param location Where the Smart Link is currently rendered.
216
216
  * @param destinationProduct The product the Smart Link is linked to.
217
217
  * @returns
218
+ * @deprecated
218
219
  */
219
220
  iframeFocusedEvent: function iframeFocusedEvent(_ref5) {
220
221
  var id = _ref5.id,
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
15
15
  export var context = {
16
16
  componentName: 'smart-cards',
17
17
  packageName: "@atlaskit/smart-card",
18
- packageVersion: "30.2.3"
18
+ packageVersion: "30.2.5"
19
19
  };
20
20
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
21
21
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -85,7 +85,7 @@ export var getSimulatedBetterMetadata = function getSimulatedBetterMetadata(card
85
85
  }, {
86
86
  name: ElementName.ModifiedOn
87
87
  }];
88
- } else if (isJiraPlan && fg('smart_links_for_plans')) {
88
+ } else if (isJiraPlan && fg('smart_links_for_plans_platform')) {
89
89
  topMetadata = [{
90
90
  name: ElementName.OwnedByGroup
91
91
  }, {
@@ -1,5 +1,7 @@
1
1
  import React, { useCallback, useEffect, useMemo } from 'react';
2
- import { useAnalyticsEvents } from '@atlaskit/analytics-next';
2
+ import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/analytics-next';
3
+ import { fg } from '@atlaskit/platform-feature-flags';
4
+ import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
3
5
  import { CardDisplay } from '../../constants';
4
6
  import { useSmartLink } from '../../state';
5
7
  import { getCanBeDatasource, getClickUrl, getDefinitionId, getExtensionKey, getProduct, getResourceType, getServices, getSubproduct, isFinalState } from '../../state/helpers';
@@ -41,8 +43,10 @@ function Component(_ref) {
41
43
  removeTextHighlightingFromTitle = _ref.removeTextHighlightingFromTitle,
42
44
  resolvingPlaceholder = _ref.resolvingPlaceholder,
43
45
  truncateInline = _ref.truncateInline;
46
+ var _useAnalyticsEventsNe = useAnalyticsEventsNext(),
47
+ createAnalyticsEvent = _useAnalyticsEventsNe.createAnalyticsEvent;
44
48
  var _useAnalyticsEvents = useAnalyticsEvents(),
45
- createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
49
+ fireEvent = _useAnalyticsEvents.fireEvent;
46
50
 
47
51
  // Get state, actions for this card.
48
52
  var _useSmartLink = useSmartLink(id, url),
@@ -146,29 +150,47 @@ function Component(_ref) {
146
150
  }
147
151
  }, [isFlexibleUi, appearance, state.status, url, definitionId, extensionKey, analytics.ui, id, canBeDatasource]);
148
152
  var onIframeDwell = useCallback(function (dwellTime, dwellPercentVisible) {
149
- analytics.ui.iframeDwelledEvent({
150
- id: id,
151
- display: isFlexibleUi ? 'flexible' : appearance,
152
- status: state.status,
153
- definitionId: definitionId,
154
- extensionKey: extensionKey,
155
- destinationProduct: product,
156
- destinationSubproduct: subproduct,
157
- dwellTime: dwellTime,
158
- dwellPercentVisible: dwellPercentVisible
159
- });
160
- }, [id, state.status, analytics.ui, appearance, definitionId, extensionKey, isFlexibleUi, product, subproduct]);
153
+ if (fg('smart-card-migrate-smartlinkiframe-analytics')) {
154
+ fireEvent('ui.smartLinkIframe.dwelled', {
155
+ id: id,
156
+ definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
157
+ display: isFlexibleUi ? 'flexible' : appearance,
158
+ dwellPercentVisible: dwellPercentVisible,
159
+ dwellTime: dwellTime
160
+ });
161
+ } else {
162
+ analytics.ui.iframeDwelledEvent({
163
+ id: id,
164
+ display: isFlexibleUi ? 'flexible' : appearance,
165
+ status: state.status,
166
+ definitionId: definitionId,
167
+ extensionKey: extensionKey,
168
+ destinationProduct: product,
169
+ destinationSubproduct: subproduct,
170
+ dwellTime: dwellTime,
171
+ dwellPercentVisible: dwellPercentVisible
172
+ });
173
+ }
174
+ }, [id, state.status, analytics.ui, appearance, definitionId, extensionKey, isFlexibleUi, product, subproduct, fireEvent]);
161
175
  var onIframeFocus = useCallback(function () {
162
- analytics.ui.iframeFocusedEvent({
163
- id: id,
164
- display: isFlexibleUi ? 'flexible' : appearance,
165
- status: state.status,
166
- definitionId: definitionId,
167
- extensionKey: extensionKey,
168
- destinationProduct: product,
169
- destinationSubproduct: subproduct
170
- });
171
- }, [id, state.status, analytics.ui, appearance, definitionId, extensionKey, isFlexibleUi, product, subproduct]);
176
+ if (fg('smart-card-migrate-smartlinkiframe-analytics')) {
177
+ fireEvent('ui.smartLinkIframe.focus', {
178
+ id: id,
179
+ definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
180
+ display: isFlexibleUi ? 'flexible' : appearance
181
+ });
182
+ } else {
183
+ analytics.ui.iframeFocusedEvent({
184
+ id: id,
185
+ display: isFlexibleUi ? 'flexible' : appearance,
186
+ status: state.status,
187
+ definitionId: definitionId,
188
+ extensionKey: extensionKey,
189
+ destinationProduct: product,
190
+ destinationSubproduct: subproduct
191
+ });
192
+ }
193
+ }, [id, state.status, analytics.ui, appearance, definitionId, extensionKey, isFlexibleUi, product, subproduct, fireEvent]);
172
194
  if (isFlexibleUi) {
173
195
  var cardState = state;
174
196
  if (error) {
@@ -10,7 +10,7 @@ import LinkWarningModal from './LinkWarningModal';
10
10
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
11
11
  var PACKAGE_DATA = {
12
12
  packageName: "@atlaskit/smart-card",
13
- packageVersion: "30.2.3",
13
+ packageVersion: "30.2.5",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  var Link = withLinkClickedEvent('a');
@@ -3,14 +3,14 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::b519212dc7ce398897c4e790498adb64>>
6
+ * @codegen <<SignedSource::1b003c1bbf9093c5eb592e8d6a034d9c>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
8
8
  */
9
- export type PackageMetaDataType = {
9
+ export type PackageMetaDataContextType = {
10
10
  packageName: string;
11
11
  packageVersion: string;
12
12
  };
13
- export type ResolvedAttributesType = {
13
+ export type ResolvedContextType = {
14
14
  status: 'pending' | 'resolving' | 'resolved' | 'errored' | 'fallback' | 'unauthorized' | 'forbidden' | 'not_found' | null;
15
15
  statusDetails: string | null;
16
16
  displayCategory: 'smartLink' | 'link';
@@ -23,6 +23,8 @@ export type ResolvedAttributesType = {
23
23
  destinationContainerId: string | null;
24
24
  destinationTenantId: string | null;
25
25
  canBeDatasource: boolean | null;
26
+ location: string | null;
27
+ resourceType: string | null;
26
28
  };
27
29
  export type ButtonClickedAiSummaryAttributesType = {};
28
30
  export type ButtonClickedCopySummaryAttributesType = {};
@@ -53,6 +55,18 @@ export type RelatedLinksSuccessAttributesType = {
53
55
  export type RelatedLinksFailedAttributesType = {
54
56
  reason: string;
55
57
  };
58
+ export type SmartLinkIframeDwelledAttributesType = {
59
+ id: string;
60
+ display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
61
+ definitionId: string | null;
62
+ dwellTime: number;
63
+ dwellPercentVisible: number;
64
+ };
65
+ export type SmartLinkIframeFocusAttributesType = {
66
+ id: string;
67
+ display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
68
+ definitionId: string | null;
69
+ };
56
70
  export type AnalyticsEventAttributes = {
57
71
  /**
58
72
  * fired when an ai summary is clicked */
@@ -88,10 +102,16 @@ export type AnalyticsEventAttributes = {
88
102
  * fired when related links modal is closed */
89
103
  'ui.modal.closed.relatedLinks': ModalClosedRelatedLinksAttributesType;
90
104
  /**
91
- * fired when related links are retrieved succesfully */
105
+ * fired when related links are retrieved successfully */
92
106
  'operational.relatedLinks.success': RelatedLinksSuccessAttributesType;
93
107
  /**
94
108
  * fired when related links retrieval fails */
95
109
  'operational.relatedLinks.failed': RelatedLinksFailedAttributesType;
110
+ /**
111
+ * fired when a user dwells their cursor on a Smart Link's iframe */
112
+ 'ui.smartLinkIframe.dwelled': SmartLinkIframeDwelledAttributesType;
113
+ /**
114
+ * fires when a user clicks or tabs into a Smart Link's iframe. */
115
+ 'ui.smartLinkIframe.focus': SmartLinkIframeFocusAttributesType;
96
116
  };
97
117
  export type EventKey = keyof AnalyticsEventAttributes;
@@ -7,7 +7,6 @@ import { type AnalyticsName, type AnalyticsPayload } from '../../utils/types';
7
7
  * Can be provided to Card via the analyticsEvents prop to change the analytics events.
8
8
  *
9
9
  * @param url URL of the link
10
- * @param dispatchAnalytics dispatchAnalytics function
11
10
  * @param id fallback id of the events sent if no id is available
12
11
  * @param defaultLocation location attribute to be used
13
12
  * @returns
@@ -65,6 +64,7 @@ export declare const useSmartLinkAnalytics: (url: string, id?: string, defaultLo
65
64
  * @param dwellTime Total seconds that the user has dwelled on this iframe
66
65
  * @param dwellPercentVisible Percentage element was visible at end of dwell
67
66
  * @returns
67
+ * @deprecated
68
68
  */
69
69
  iframeDwelledEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, dwellTime, dwellPercentVisible, }: UiIframeDwelledEventProps) => void;
70
70
  /**
@@ -77,6 +77,7 @@ export declare const useSmartLinkAnalytics: (url: string, id?: string, defaultLo
77
77
  * @param location Where the Smart Link is currently rendered.
78
78
  * @param destinationProduct The product the Smart Link is linked to.
79
79
  * @returns
80
+ * @deprecated
80
81
  */
81
82
  iframeFocusedEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, }: UiIframeFocusedEventProps) => void;
82
83
  /**
@@ -3,14 +3,14 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::b519212dc7ce398897c4e790498adb64>>
6
+ * @codegen <<SignedSource::1b003c1bbf9093c5eb592e8d6a034d9c>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
8
8
  */
9
- export type PackageMetaDataType = {
9
+ export type PackageMetaDataContextType = {
10
10
  packageName: string;
11
11
  packageVersion: string;
12
12
  };
13
- export type ResolvedAttributesType = {
13
+ export type ResolvedContextType = {
14
14
  status: 'pending' | 'resolving' | 'resolved' | 'errored' | 'fallback' | 'unauthorized' | 'forbidden' | 'not_found' | null;
15
15
  statusDetails: string | null;
16
16
  displayCategory: 'smartLink' | 'link';
@@ -23,6 +23,8 @@ export type ResolvedAttributesType = {
23
23
  destinationContainerId: string | null;
24
24
  destinationTenantId: string | null;
25
25
  canBeDatasource: boolean | null;
26
+ location: string | null;
27
+ resourceType: string | null;
26
28
  };
27
29
  export type ButtonClickedAiSummaryAttributesType = {};
28
30
  export type ButtonClickedCopySummaryAttributesType = {};
@@ -53,6 +55,18 @@ export type RelatedLinksSuccessAttributesType = {
53
55
  export type RelatedLinksFailedAttributesType = {
54
56
  reason: string;
55
57
  };
58
+ export type SmartLinkIframeDwelledAttributesType = {
59
+ id: string;
60
+ display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
61
+ definitionId: string | null;
62
+ dwellTime: number;
63
+ dwellPercentVisible: number;
64
+ };
65
+ export type SmartLinkIframeFocusAttributesType = {
66
+ id: string;
67
+ display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
68
+ definitionId: string | null;
69
+ };
56
70
  export type AnalyticsEventAttributes = {
57
71
  /**
58
72
  * fired when an ai summary is clicked */
@@ -88,10 +102,16 @@ export type AnalyticsEventAttributes = {
88
102
  * fired when related links modal is closed */
89
103
  'ui.modal.closed.relatedLinks': ModalClosedRelatedLinksAttributesType;
90
104
  /**
91
- * fired when related links are retrieved succesfully */
105
+ * fired when related links are retrieved successfully */
92
106
  'operational.relatedLinks.success': RelatedLinksSuccessAttributesType;
93
107
  /**
94
108
  * fired when related links retrieval fails */
95
109
  'operational.relatedLinks.failed': RelatedLinksFailedAttributesType;
110
+ /**
111
+ * fired when a user dwells their cursor on a Smart Link's iframe */
112
+ 'ui.smartLinkIframe.dwelled': SmartLinkIframeDwelledAttributesType;
113
+ /**
114
+ * fires when a user clicks or tabs into a Smart Link's iframe. */
115
+ 'ui.smartLinkIframe.focus': SmartLinkIframeFocusAttributesType;
96
116
  };
97
117
  export type EventKey = keyof AnalyticsEventAttributes;
@@ -7,7 +7,6 @@ import { type AnalyticsName, type AnalyticsPayload } from '../../utils/types';
7
7
  * Can be provided to Card via the analyticsEvents prop to change the analytics events.
8
8
  *
9
9
  * @param url URL of the link
10
- * @param dispatchAnalytics dispatchAnalytics function
11
10
  * @param id fallback id of the events sent if no id is available
12
11
  * @param defaultLocation location attribute to be used
13
12
  * @returns
@@ -65,6 +64,7 @@ export declare const useSmartLinkAnalytics: (url: string, id?: string, defaultLo
65
64
  * @param dwellTime Total seconds that the user has dwelled on this iframe
66
65
  * @param dwellPercentVisible Percentage element was visible at end of dwell
67
66
  * @returns
67
+ * @deprecated
68
68
  */
69
69
  iframeDwelledEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, dwellTime, dwellPercentVisible, }: UiIframeDwelledEventProps) => void;
70
70
  /**
@@ -77,6 +77,7 @@ export declare const useSmartLinkAnalytics: (url: string, id?: string, defaultLo
77
77
  * @param location Where the Smart Link is currently rendered.
78
78
  * @param destinationProduct The product the Smart Link is linked to.
79
79
  * @returns
80
+ * @deprecated
80
81
  */
81
82
  iframeFocusedEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, }: UiIframeFocusedEventProps) => void;
82
83
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "30.2.3",
3
+ "version": "30.2.5",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -52,7 +52,7 @@
52
52
  "@atlaskit/outbound-auth-flow-client": "^3.4.0",
53
53
  "@atlaskit/platform-feature-flags": "^0.3.0",
54
54
  "@atlaskit/popup": "^1.29.0",
55
- "@atlaskit/primitives": "^13.1.0",
55
+ "@atlaskit/primitives": "^13.2.0",
56
56
  "@atlaskit/section-message": "^6.6.0",
57
57
  "@atlaskit/select": "^18.5.0",
58
58
  "@atlaskit/spinner": "^16.3.0",
@@ -171,7 +171,10 @@
171
171
  "platform-visual-refresh-icons": {
172
172
  "type": "boolean"
173
173
  },
174
- "smart_links_for_plans": {
174
+ "smart_links_for_plans_platform": {
175
+ "type": "boolean"
176
+ },
177
+ "smart-card-migrate-smartlinkiframe-analytics": {
175
178
  "type": "boolean"
176
179
  }
177
180
  }