@atlaskit/smart-card 43.11.2 → 43.12.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 +15 -0
- package/analytics.spec.yaml +7 -1
- package/dist/cjs/state/actions/index.js +1 -4
- package/dist/cjs/state/hooks/use-resolve/index.js +3 -13
- package/dist/cjs/state/hooks/use-response/index.js +0 -2
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/analytics/click.js +0 -1
- package/dist/cjs/view/CardWithUrl/component.js +327 -3
- package/dist/cjs/view/EmbedCard/components/ExpandedFrame.js +93 -2
- package/dist/cjs/view/EmbedCard/components/Frame.js +121 -3
- package/dist/cjs/view/EmbedCard/components/IframeDwellTracker.js +25 -4
- package/dist/cjs/view/EmbedCard/index.js +204 -1
- package/dist/cjs/view/EmbedCard/views/ResolvedView.js +95 -2
- package/dist/cjs/view/FlexibleCard/components/actions/action/index.js +0 -1
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/boolean-prompt/main.js +9 -13
- package/dist/cjs/view/LinkUrl/Hyperlink/index.js +0 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -3
- package/dist/es2019/state/actions/index.js +1 -4
- package/dist/es2019/state/hooks/use-resolve/index.js +1 -10
- package/dist/es2019/state/hooks/use-response/index.js +0 -2
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/analytics/click.js +0 -1
- package/dist/es2019/view/CardWithUrl/component.js +324 -2
- package/dist/es2019/view/EmbedCard/components/ExpandedFrame.js +87 -2
- package/dist/es2019/view/EmbedCard/components/Frame.js +112 -2
- package/dist/es2019/view/EmbedCard/components/IframeDwellTracker.js +25 -4
- package/dist/es2019/view/EmbedCard/index.js +208 -0
- package/dist/es2019/view/EmbedCard/views/ResolvedView.js +91 -3
- package/dist/es2019/view/FlexibleCard/components/actions/action/index.js +0 -1
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/boolean-prompt/main.js +8 -12
- package/dist/es2019/view/LinkUrl/Hyperlink/index.js +0 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -3
- package/dist/esm/state/actions/index.js +1 -4
- package/dist/esm/state/hooks/use-resolve/index.js +3 -13
- package/dist/esm/state/hooks/use-response/index.js +0 -2
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/analytics/click.js +0 -1
- package/dist/esm/view/CardWithUrl/component.js +326 -2
- package/dist/esm/view/EmbedCard/components/ExpandedFrame.js +95 -2
- package/dist/esm/view/EmbedCard/components/Frame.js +122 -2
- package/dist/esm/view/EmbedCard/components/IframeDwellTracker.js +25 -4
- package/dist/esm/view/EmbedCard/index.js +203 -0
- package/dist/esm/view/EmbedCard/views/ResolvedView.js +97 -3
- package/dist/esm/view/FlexibleCard/components/actions/action/index.js +0 -1
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/boolean-prompt/main.js +9 -13
- package/dist/esm/view/LinkUrl/Hyperlink/index.js +0 -1
- package/dist/esm/view/LinkUrl/index.js +1 -3
- package/dist/types/common/analytics/generated/analytics.types.d.ts +1 -0
- package/dist/types/view/EmbedCard/components/ExpandedFrame.d.ts +8 -1
- package/dist/types/view/EmbedCard/components/Frame.d.ts +6 -0
- package/dist/types/view/EmbedCard/index.d.ts +4 -0
- package/dist/types/view/EmbedCard/types.d.ts +4 -0
- package/dist/types/view/EmbedCard/views/ResolvedView.d.ts +6 -1
- package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +1 -0
- package/dist/types-ts4.5/view/EmbedCard/components/ExpandedFrame.d.ts +8 -1
- package/dist/types-ts4.5/view/EmbedCard/components/Frame.d.ts +6 -0
- package/dist/types-ts4.5/view/EmbedCard/index.d.ts +4 -0
- package/dist/types-ts4.5/view/EmbedCard/types.d.ts +4 -0
- package/dist/types-ts4.5/view/EmbedCard/views/ResolvedView.d.ts +6 -1
- package/package.json +8 -4
|
@@ -226,4 +226,207 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref2, iframeRef)
|
|
|
226
226
|
isSelected: isSelected
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
|
+
});
|
|
230
|
+
export var EmbedCardUpdated = /*#__PURE__*/React.forwardRef(function (_ref3, iframeRef) {
|
|
231
|
+
var _details$meta4, _forbiddenViewProps$c3, _forbiddenViewProps$c4, _notFoundViewProps$co3, _notFoundViewProps$co4;
|
|
232
|
+
var url = _ref3.url,
|
|
233
|
+
cardState = _ref3.cardState,
|
|
234
|
+
handleAuthorize = _ref3.handleAuthorize,
|
|
235
|
+
handleErrorRetry = _ref3.handleErrorRetry,
|
|
236
|
+
handleFrameClick = _ref3.handleFrameClick,
|
|
237
|
+
isSelected = _ref3.isSelected,
|
|
238
|
+
frameStyle = _ref3.frameStyle,
|
|
239
|
+
platform = _ref3.platform,
|
|
240
|
+
onResolve = _ref3.onResolve,
|
|
241
|
+
onError = _ref3.onError,
|
|
242
|
+
testId = _ref3.testId,
|
|
243
|
+
inheritDimensions = _ref3.inheritDimensions,
|
|
244
|
+
onIframeDwell = _ref3.onIframeDwell,
|
|
245
|
+
onIframeFocus = _ref3.onIframeFocus,
|
|
246
|
+
onIframeMouseEnter = _ref3.onIframeMouseEnter,
|
|
247
|
+
onIframeMouseLeave = _ref3.onIframeMouseLeave,
|
|
248
|
+
iframeUrlType = _ref3.iframeUrlType,
|
|
249
|
+
actionOptions = _ref3.actionOptions,
|
|
250
|
+
renderers = _ref3.renderers,
|
|
251
|
+
CompetitorPrompt = _ref3.CompetitorPrompt,
|
|
252
|
+
hideIconLoadingSkeleton = _ref3.hideIconLoadingSkeleton;
|
|
253
|
+
var _useAnalyticsEvents2 = useAnalyticsEvents(),
|
|
254
|
+
createAnalyticsEvent = _useAnalyticsEvents2.createAnalyticsEvent;
|
|
255
|
+
var status = cardState.status,
|
|
256
|
+
details = cardState.details;
|
|
257
|
+
var extensionKey = getExtensionKey(details);
|
|
258
|
+
var isProductIntegrationSupported = hasAuthScopeOverrides(details);
|
|
259
|
+
var _useControlDataExport3 = useControlDataExportConfig(),
|
|
260
|
+
_useControlDataExport4 = _useControlDataExport3.shouldControlDataExport,
|
|
261
|
+
shouldControlDataExport = _useControlDataExport4 === void 0 ? false : _useControlDataExport4;
|
|
262
|
+
switch (status) {
|
|
263
|
+
case 'pending':
|
|
264
|
+
case 'resolving':
|
|
265
|
+
return /*#__PURE__*/React.createElement(UFOLoadHoldWrapper, null, /*#__PURE__*/React.createElement(BlockCardResolvedView, {
|
|
266
|
+
url: url,
|
|
267
|
+
cardState: cardState,
|
|
268
|
+
onClick: handleFrameClick,
|
|
269
|
+
onError: onError,
|
|
270
|
+
onResolve: onResolve,
|
|
271
|
+
renderers: renderers,
|
|
272
|
+
actionOptions: actionOptions,
|
|
273
|
+
testId: testId ? "".concat(testId, "-resolving-view") : 'embed-card-resolving-view'
|
|
274
|
+
}));
|
|
275
|
+
case 'resolved':
|
|
276
|
+
var resolvedViewProps = extractEmbedProps(details, platform, iframeUrlType);
|
|
277
|
+
if (onResolve) {
|
|
278
|
+
var _resolvedViewProps$pr2, _details$meta3;
|
|
279
|
+
onResolve(_objectSpread({
|
|
280
|
+
title: resolvedViewProps.title,
|
|
281
|
+
url: url,
|
|
282
|
+
aspectRatio: (_resolvedViewProps$pr2 = resolvedViewProps.preview) === null || _resolvedViewProps$pr2 === void 0 ? void 0 : _resolvedViewProps$pr2.aspectRatio
|
|
283
|
+
}, fg('expose-product-details-from-smart-card') && {
|
|
284
|
+
extensionKey: details === null || details === void 0 || (_details$meta3 = details.meta) === null || _details$meta3 === void 0 ? void 0 : _details$meta3.key
|
|
285
|
+
}));
|
|
286
|
+
}
|
|
287
|
+
if (getIsDataExportEnabled(shouldControlDataExport, cardState.details)) {
|
|
288
|
+
var unauthViewProps = extractEmbedProps(details, platform);
|
|
289
|
+
return /*#__PURE__*/React.createElement(UnauthorizedView, {
|
|
290
|
+
context: unauthViewProps.context,
|
|
291
|
+
extensionKey: extensionKey,
|
|
292
|
+
frameStyle: frameStyle,
|
|
293
|
+
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
294
|
+
inheritDimensions: inheritDimensions,
|
|
295
|
+
isSelected: isSelected,
|
|
296
|
+
onAuthorize: handleAuthorize,
|
|
297
|
+
onClick: handleFrameClick,
|
|
298
|
+
testId: testId,
|
|
299
|
+
url: unauthViewProps.link
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
if (resolvedViewProps.preview) {
|
|
303
|
+
return /*#__PURE__*/React.createElement(EmbedCardResolvedView, _extends({}, resolvedViewProps, {
|
|
304
|
+
isSelected: isSelected,
|
|
305
|
+
frameStyle: frameStyle,
|
|
306
|
+
inheritDimensions: inheritDimensions,
|
|
307
|
+
onClick: handleFrameClick,
|
|
308
|
+
ref: iframeRef,
|
|
309
|
+
onIframeDwell: onIframeDwell,
|
|
310
|
+
onIframeFocus: onIframeFocus,
|
|
311
|
+
onIframeMouseEnter: onIframeMouseEnter,
|
|
312
|
+
onIframeMouseLeave: onIframeMouseLeave,
|
|
313
|
+
testId: testId,
|
|
314
|
+
CompetitorPrompt: CompetitorPrompt,
|
|
315
|
+
hideIconLoadingSkeleton: hideIconLoadingSkeleton,
|
|
316
|
+
extensionKey: extensionKey
|
|
317
|
+
}));
|
|
318
|
+
} else {
|
|
319
|
+
if (platform === 'mobile') {
|
|
320
|
+
var resolvedInlineViewProps = extractInlineProps(details);
|
|
321
|
+
return /*#__PURE__*/React.createElement(InlineCardResolvedView, _extends({}, resolvedInlineViewProps, {
|
|
322
|
+
isSelected: isSelected,
|
|
323
|
+
testId: testId,
|
|
324
|
+
onClick: handleFrameClick
|
|
325
|
+
}));
|
|
326
|
+
}
|
|
327
|
+
return /*#__PURE__*/React.createElement(BlockCardResolvedView, {
|
|
328
|
+
url: url,
|
|
329
|
+
cardState: cardState,
|
|
330
|
+
onClick: handleFrameClick,
|
|
331
|
+
onError: onError,
|
|
332
|
+
onResolve: onResolve,
|
|
333
|
+
renderers: renderers,
|
|
334
|
+
actionOptions: actionOptions,
|
|
335
|
+
testId: testId
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
case 'unauthorized':
|
|
339
|
+
if (onError) {
|
|
340
|
+
onError({
|
|
341
|
+
url: url,
|
|
342
|
+
status: status
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
var unauthorisedViewProps = extractEmbedProps(details, platform);
|
|
346
|
+
return /*#__PURE__*/React.createElement(UnauthorizedView, {
|
|
347
|
+
context: unauthorisedViewProps.context,
|
|
348
|
+
extensionKey: extensionKey,
|
|
349
|
+
frameStyle: frameStyle,
|
|
350
|
+
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
351
|
+
inheritDimensions: inheritDimensions,
|
|
352
|
+
isSelected: isSelected,
|
|
353
|
+
onAuthorize: handleAuthorize,
|
|
354
|
+
onClick: handleFrameClick,
|
|
355
|
+
testId: testId,
|
|
356
|
+
url: unauthorisedViewProps.link
|
|
357
|
+
});
|
|
358
|
+
case 'forbidden':
|
|
359
|
+
if (onError) {
|
|
360
|
+
onError({
|
|
361
|
+
url: url,
|
|
362
|
+
status: status
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
var forbiddenViewProps = extractEmbedProps(details, platform);
|
|
366
|
+
var cardMetadata = (_details$meta4 = details === null || details === void 0 ? void 0 : details.meta) !== null && _details$meta4 !== void 0 ? _details$meta4 : getForbiddenJsonLd().meta;
|
|
367
|
+
if (forbiddenViewProps.preview) {
|
|
368
|
+
return /*#__PURE__*/React.createElement(EmbedCardResolvedView, _extends({}, forbiddenViewProps, {
|
|
369
|
+
title: forbiddenViewProps.link,
|
|
370
|
+
frameStyle: frameStyle,
|
|
371
|
+
isSelected: isSelected,
|
|
372
|
+
inheritDimensions: inheritDimensions,
|
|
373
|
+
onClick: handleFrameClick,
|
|
374
|
+
ref: iframeRef,
|
|
375
|
+
extensionKey: extensionKey
|
|
376
|
+
}));
|
|
377
|
+
}
|
|
378
|
+
var forbiddenAccessContext = extractRequestAccessContextImproved({
|
|
379
|
+
jsonLd: cardMetadata,
|
|
380
|
+
url: url,
|
|
381
|
+
product: (_forbiddenViewProps$c3 = (_forbiddenViewProps$c4 = forbiddenViewProps.context) === null || _forbiddenViewProps$c4 === void 0 ? void 0 : _forbiddenViewProps$c4.text) !== null && _forbiddenViewProps$c3 !== void 0 ? _forbiddenViewProps$c3 : '',
|
|
382
|
+
createAnalyticsEvent: createAnalyticsEvent
|
|
383
|
+
});
|
|
384
|
+
return /*#__PURE__*/React.createElement(ForbiddenView, {
|
|
385
|
+
context: forbiddenViewProps.context,
|
|
386
|
+
frameStyle: frameStyle,
|
|
387
|
+
inheritDimensions: inheritDimensions,
|
|
388
|
+
isSelected: isSelected,
|
|
389
|
+
onAuthorize: handleAuthorize,
|
|
390
|
+
onClick: handleFrameClick,
|
|
391
|
+
accessContext: forbiddenAccessContext,
|
|
392
|
+
url: forbiddenViewProps.link
|
|
393
|
+
});
|
|
394
|
+
case 'not_found':
|
|
395
|
+
if (onError) {
|
|
396
|
+
onError({
|
|
397
|
+
url: url,
|
|
398
|
+
status: status
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
var notFoundViewProps = extractEmbedProps(details, platform);
|
|
402
|
+
var notFoundAccessContext = details !== null && details !== void 0 && details.meta ? extractRequestAccessContextImproved({
|
|
403
|
+
jsonLd: details === null || details === void 0 ? void 0 : details.meta,
|
|
404
|
+
url: url,
|
|
405
|
+
product: (_notFoundViewProps$co3 = (_notFoundViewProps$co4 = notFoundViewProps.context) === null || _notFoundViewProps$co4 === void 0 ? void 0 : _notFoundViewProps$co4.text) !== null && _notFoundViewProps$co3 !== void 0 ? _notFoundViewProps$co3 : '',
|
|
406
|
+
createAnalyticsEvent: createAnalyticsEvent
|
|
407
|
+
}) : undefined;
|
|
408
|
+
return /*#__PURE__*/React.createElement(NotFoundView, {
|
|
409
|
+
context: notFoundViewProps.context,
|
|
410
|
+
frameStyle: frameStyle,
|
|
411
|
+
inheritDimensions: inheritDimensions,
|
|
412
|
+
isSelected: isSelected,
|
|
413
|
+
onClick: handleFrameClick,
|
|
414
|
+
accessContext: notFoundAccessContext,
|
|
415
|
+
url: notFoundViewProps.link
|
|
416
|
+
});
|
|
417
|
+
case 'fallback':
|
|
418
|
+
case 'errored':
|
|
419
|
+
default:
|
|
420
|
+
if (onError) {
|
|
421
|
+
onError({
|
|
422
|
+
url: url,
|
|
423
|
+
status: status
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
return /*#__PURE__*/React.createElement(EmbedCardErroredView, {
|
|
427
|
+
onRetry: handleErrorRetry,
|
|
428
|
+
inheritDimensions: inheritDimensions,
|
|
429
|
+
isSelected: isSelected
|
|
430
|
+
});
|
|
431
|
+
}
|
|
229
432
|
});
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import LinkGlyph from '@atlaskit/icon/core/migration/link';
|
|
4
|
+
import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
|
|
3
5
|
import { useThemeObserver } from '@atlaskit/tokens';
|
|
4
6
|
import { getPreviewUrlWithTheme, isProfileType } from '../../../utils';
|
|
5
7
|
import { ExpandedFrame } from '../components/ExpandedFrame';
|
|
6
|
-
import { Frame } from '../components/Frame';
|
|
8
|
+
import { Frame, FrameUpdated } from '../components/Frame';
|
|
7
9
|
import { ImageIcon } from '../components/ImageIcon';
|
|
8
10
|
import { useEmbedResolvePostMessageListener } from '../useEmbedResolvePostMessageListener';
|
|
9
|
-
|
|
11
|
+
var FrameComponent = componentWithFG('rovo_chat_embed_card_dwell_and_hover_metrics', FrameUpdated, Frame);
|
|
12
|
+
var EmbedCardResolvedViewOld = /*#__PURE__*/React.forwardRef(function (_ref, embedIframeRef) {
|
|
10
13
|
var link = _ref.link,
|
|
11
14
|
context = _ref.context,
|
|
12
15
|
onClick = _ref.onClick,
|
|
@@ -77,4 +80,95 @@ export var EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(function (_ref,
|
|
|
77
80
|
title: text,
|
|
78
81
|
extensionKey: extensionKey
|
|
79
82
|
}));
|
|
80
|
-
});
|
|
83
|
+
});
|
|
84
|
+
var EmbedCardResolvedViewUpdated = /*#__PURE__*/React.forwardRef(function (_ref2, embedIframeRef) {
|
|
85
|
+
var link = _ref2.link,
|
|
86
|
+
context = _ref2.context,
|
|
87
|
+
onClick = _ref2.onClick,
|
|
88
|
+
isSelected = _ref2.isSelected,
|
|
89
|
+
frameStyle = _ref2.frameStyle,
|
|
90
|
+
preview = _ref2.preview,
|
|
91
|
+
title = _ref2.title,
|
|
92
|
+
isTrusted = _ref2.isTrusted,
|
|
93
|
+
_ref2$testId = _ref2.testId,
|
|
94
|
+
testId = _ref2$testId === void 0 ? 'embed-card-resolved-view' : _ref2$testId,
|
|
95
|
+
inheritDimensions = _ref2.inheritDimensions,
|
|
96
|
+
onIframeDwell = _ref2.onIframeDwell,
|
|
97
|
+
onIframeFocus = _ref2.onIframeFocus,
|
|
98
|
+
onIframeMouseEnter = _ref2.onIframeMouseEnter,
|
|
99
|
+
onIframeMouseLeave = _ref2.onIframeMouseLeave,
|
|
100
|
+
isSupportTheming = _ref2.isSupportTheming,
|
|
101
|
+
type = _ref2.type,
|
|
102
|
+
CompetitorPrompt = _ref2.CompetitorPrompt,
|
|
103
|
+
hideIconLoadingSkeleton = _ref2.hideIconLoadingSkeleton,
|
|
104
|
+
extensionKey = _ref2.extensionKey;
|
|
105
|
+
var iconFromContext = context === null || context === void 0 ? void 0 : context.icon;
|
|
106
|
+
var src = typeof iconFromContext === 'string' ? iconFromContext : undefined;
|
|
107
|
+
var text = title || (context === null || context === void 0 ? void 0 : context.text);
|
|
108
|
+
var linkGlyph = React.useMemo(function () {
|
|
109
|
+
return /*#__PURE__*/React.createElement(LinkGlyph, {
|
|
110
|
+
label: "icon",
|
|
111
|
+
LEGACY_size: "small",
|
|
112
|
+
testId: "embed-card-fallback-icon",
|
|
113
|
+
color: "currentColor"
|
|
114
|
+
});
|
|
115
|
+
}, []);
|
|
116
|
+
var icon = React.useMemo(function () {
|
|
117
|
+
if ( /*#__PURE__*/React.isValidElement(iconFromContext)) {
|
|
118
|
+
return iconFromContext;
|
|
119
|
+
}
|
|
120
|
+
return /*#__PURE__*/React.createElement(ImageIcon, {
|
|
121
|
+
src: src,
|
|
122
|
+
default: linkGlyph,
|
|
123
|
+
appearance: isProfileType(type) ? 'round' : 'square',
|
|
124
|
+
hideLoadingSkeleton: hideIconLoadingSkeleton
|
|
125
|
+
});
|
|
126
|
+
}, [iconFromContext, src, linkGlyph, type, hideIconLoadingSkeleton]);
|
|
127
|
+
useEmbedResolvePostMessageListener({
|
|
128
|
+
url: link,
|
|
129
|
+
embedIframeRef: embedIframeRef
|
|
130
|
+
});
|
|
131
|
+
var themeState = useThemeObserver();
|
|
132
|
+
var previewUrl = preview === null || preview === void 0 ? void 0 : preview.src;
|
|
133
|
+
if (previewUrl && isSupportTheming) {
|
|
134
|
+
previewUrl = getPreviewUrlWithTheme(previewUrl, themeState);
|
|
135
|
+
}
|
|
136
|
+
var _React$useState = React.useState(false),
|
|
137
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
138
|
+
isMouseOver = _React$useState2[0],
|
|
139
|
+
setMouseOver = _React$useState2[1];
|
|
140
|
+
return /*#__PURE__*/React.createElement(ExpandedFrame, {
|
|
141
|
+
isSelected: isSelected,
|
|
142
|
+
frameStyle: frameStyle,
|
|
143
|
+
href: link,
|
|
144
|
+
testId: testId,
|
|
145
|
+
icon: icon,
|
|
146
|
+
text: text,
|
|
147
|
+
onClick: onClick,
|
|
148
|
+
inheritDimensions: inheritDimensions,
|
|
149
|
+
setOverflow: false,
|
|
150
|
+
CompetitorPrompt: CompetitorPrompt,
|
|
151
|
+
onContentMouseEnter: function onContentMouseEnter() {
|
|
152
|
+
setMouseOver(true);
|
|
153
|
+
onIframeMouseEnter === null || onIframeMouseEnter === void 0 || onIframeMouseEnter();
|
|
154
|
+
},
|
|
155
|
+
onContentMouseLeave: function onContentMouseLeave() {
|
|
156
|
+
setMouseOver(false);
|
|
157
|
+
onIframeMouseLeave === null || onIframeMouseLeave === void 0 || onIframeMouseLeave();
|
|
158
|
+
}
|
|
159
|
+
}, /*#__PURE__*/React.createElement(FrameComponent, {
|
|
160
|
+
url: previewUrl,
|
|
161
|
+
isTrusted: isTrusted,
|
|
162
|
+
testId: testId,
|
|
163
|
+
ref: embedIframeRef,
|
|
164
|
+
onIframeDwell: onIframeDwell,
|
|
165
|
+
onIframeFocus: onIframeFocus,
|
|
166
|
+
onIframeMouseEnter: onIframeMouseEnter,
|
|
167
|
+
onIframeMouseLeave: onIframeMouseLeave,
|
|
168
|
+
isMouseOver: isMouseOver,
|
|
169
|
+
title: text,
|
|
170
|
+
extensionKey: extensionKey
|
|
171
|
+
}));
|
|
172
|
+
});
|
|
173
|
+
var EmbedCardResolvedViewWithFG = componentWithFG('rovo_chat_embed_card_dwell_and_hover_metrics', EmbedCardResolvedViewUpdated, EmbedCardResolvedViewOld);
|
|
174
|
+
export { EmbedCardResolvedViewWithFG as EmbedCardResolvedView };
|
|
@@ -96,7 +96,6 @@ var Action = function Action(_ref) {
|
|
|
96
96
|
href: href,
|
|
97
97
|
ariaLabel: ariaLabel
|
|
98
98
|
});
|
|
99
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
100
99
|
return Wrapper !== undefined ? /*#__PURE__*/React.createElement(Wrapper, null, button) : button;
|
|
101
100
|
};
|
|
102
101
|
export default Action;
|
|
@@ -8,18 +8,14 @@ var BooleanInputPrompt = function BooleanInputPrompt(_ref) {
|
|
|
8
8
|
var variableName = userInputPrompt.variableName,
|
|
9
9
|
displayName = userInputPrompt.displayName,
|
|
10
10
|
defaultValue = userInputPrompt.defaultValue;
|
|
11
|
-
return (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
label: displayName
|
|
21
|
-
}));
|
|
22
|
-
})
|
|
23
|
-
);
|
|
11
|
+
return /*#__PURE__*/React.createElement(CheckboxField, {
|
|
12
|
+
name: variableName,
|
|
13
|
+
defaultIsChecked: defaultValue || false
|
|
14
|
+
}, function (_ref2) {
|
|
15
|
+
var fieldProps = _ref2.fieldProps;
|
|
16
|
+
return /*#__PURE__*/React.createElement(Checkbox, _extends({}, fieldProps, {
|
|
17
|
+
label: displayName
|
|
18
|
+
}));
|
|
19
|
+
});
|
|
24
20
|
};
|
|
25
21
|
export default BooleanInputPrompt;
|
|
@@ -4,7 +4,6 @@ var _excluded = ["href", "children", "testId", "isLinkComponent"];
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import AKLink from '@atlaskit/link';
|
|
6
6
|
import { withLinkClickedEvent } from '../../../utils/analytics/click';
|
|
7
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
8
7
|
var Anchor = withLinkClickedEvent('a');
|
|
9
8
|
export var LinkComponent = withLinkClickedEvent(AKLink);
|
|
10
9
|
var Hyperlink = function Hyperlink(_ref) {
|
|
@@ -15,11 +15,9 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
15
15
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
16
16
|
var PACKAGE_DATA = {
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "
|
|
18
|
+
packageVersion: "0.0.0-development",
|
|
19
19
|
componentName: 'linkUrl'
|
|
20
20
|
};
|
|
21
|
-
|
|
22
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
23
21
|
var Anchor = withLinkClickedEvent('a');
|
|
24
22
|
export var LinkComponent = withLinkClickedEvent(AKLink);
|
|
25
23
|
var LinkUrl = function LinkUrl(_ref) {
|
|
@@ -108,6 +108,7 @@ export type SmartLinkIframeFocusedAttributesType = {
|
|
|
108
108
|
id: string;
|
|
109
109
|
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'url';
|
|
110
110
|
definitionId: string | null;
|
|
111
|
+
interactionType?: 'mouseenter' | 'mouseleave' | 'focus';
|
|
111
112
|
};
|
|
112
113
|
export type ApplicationAccountConnectedAttributesType = {
|
|
113
114
|
definitionId: string | null;
|
|
@@ -41,4 +41,11 @@ export interface ExpandedFrameProps {
|
|
|
41
41
|
testId?: string;
|
|
42
42
|
text?: React.ReactNode;
|
|
43
43
|
}
|
|
44
|
-
export
|
|
44
|
+
export interface ExpandedFrameUpdatedProps extends ExpandedFrameProps {
|
|
45
|
+
/** Callback for when mouse enters the content wrapper - for dwell tracking */
|
|
46
|
+
onContentMouseEnter?: () => void;
|
|
47
|
+
/** Callback for when mouse leaves the content wrapper - for dwell tracking */
|
|
48
|
+
onContentMouseLeave?: () => void;
|
|
49
|
+
}
|
|
50
|
+
declare const ExpandedFrameWithFG: import("react").FC<ExpandedFrameUpdatedProps & ExpandedFrameProps>;
|
|
51
|
+
export { ExpandedFrameWithFG as ExpandedFrame };
|
|
@@ -12,4 +12,10 @@ export interface FrameProps {
|
|
|
12
12
|
title?: string;
|
|
13
13
|
url?: string;
|
|
14
14
|
}
|
|
15
|
+
export interface FrameUpdatedProps extends FrameProps {
|
|
16
|
+
isMouseOver?: boolean;
|
|
17
|
+
onIframeMouseEnter?: () => void;
|
|
18
|
+
onIframeMouseLeave?: () => void;
|
|
19
|
+
}
|
|
15
20
|
export declare const Frame: React.ForwardRefExoticComponent<FrameProps & React.RefAttributes<HTMLIFrameElement>>;
|
|
21
|
+
export declare const FrameUpdated: React.ForwardRefExoticComponent<FrameUpdatedProps & React.RefAttributes<HTMLIFrameElement>>;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type EmbedCardProps } from './types';
|
|
3
3
|
export declare const EmbedCard: React.ForwardRefExoticComponent<EmbedCardProps & React.RefAttributes<HTMLIFrameElement>>;
|
|
4
|
+
export declare const EmbedCardUpdated: React.ForwardRefExoticComponent<EmbedCardProps & {
|
|
5
|
+
onIframeMouseEnter?: () => void;
|
|
6
|
+
onIframeMouseLeave?: () => void;
|
|
7
|
+
} & React.RefAttributes<HTMLIFrameElement>>;
|
|
@@ -30,6 +30,10 @@ export type EmbedCardProps = {
|
|
|
30
30
|
testId?: string;
|
|
31
31
|
url: string;
|
|
32
32
|
};
|
|
33
|
+
export type EmbedCardUpdatedProps = EmbedCardProps & {
|
|
34
|
+
onIframeMouseEnter?: () => void;
|
|
35
|
+
onIframeMouseLeave?: () => void;
|
|
36
|
+
};
|
|
33
37
|
export interface WithShowControlMethodProp {
|
|
34
38
|
showControls?: () => void;
|
|
35
39
|
}
|
|
@@ -28,6 +28,10 @@ export interface EmbedCardResolvedViewProps {
|
|
|
28
28
|
onIframeDwell?: (dwellTime: number, dwellPercentVisible: number) => void;
|
|
29
29
|
/** Optional callback for when user navigates into an iframe - for analytics **/
|
|
30
30
|
onIframeFocus?: () => void;
|
|
31
|
+
/** Optional callback for when user hovers over an iframe - for analytics **/
|
|
32
|
+
onIframeMouseEnter?: () => void;
|
|
33
|
+
/** Optional callback for when user stops hovering over an iframe - for analytics **/
|
|
34
|
+
onIframeMouseLeave?: () => void;
|
|
31
35
|
/** The src to be used for the `iframe` */
|
|
32
36
|
preview?: {
|
|
33
37
|
aspectRatio?: number;
|
|
@@ -40,4 +44,5 @@ export interface EmbedCardResolvedViewProps {
|
|
|
40
44
|
/** Type of the object */
|
|
41
45
|
type?: string[];
|
|
42
46
|
}
|
|
43
|
-
|
|
47
|
+
declare const EmbedCardResolvedViewWithFG: React.FC<Omit<EmbedCardResolvedViewProps & React.RefAttributes<HTMLIFrameElement>, "ref"> & React.RefAttributes<HTMLIFrameElement>>;
|
|
48
|
+
export { EmbedCardResolvedViewWithFG as EmbedCardResolvedView };
|
|
@@ -108,6 +108,7 @@ export type SmartLinkIframeFocusedAttributesType = {
|
|
|
108
108
|
id: string;
|
|
109
109
|
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'url';
|
|
110
110
|
definitionId: string | null;
|
|
111
|
+
interactionType?: 'mouseenter' | 'mouseleave' | 'focus';
|
|
111
112
|
};
|
|
112
113
|
export type ApplicationAccountConnectedAttributesType = {
|
|
113
114
|
definitionId: string | null;
|
|
@@ -41,4 +41,11 @@ export interface ExpandedFrameProps {
|
|
|
41
41
|
testId?: string;
|
|
42
42
|
text?: React.ReactNode;
|
|
43
43
|
}
|
|
44
|
-
export
|
|
44
|
+
export interface ExpandedFrameUpdatedProps extends ExpandedFrameProps {
|
|
45
|
+
/** Callback for when mouse enters the content wrapper - for dwell tracking */
|
|
46
|
+
onContentMouseEnter?: () => void;
|
|
47
|
+
/** Callback for when mouse leaves the content wrapper - for dwell tracking */
|
|
48
|
+
onContentMouseLeave?: () => void;
|
|
49
|
+
}
|
|
50
|
+
declare const ExpandedFrameWithFG: import("react").FC<ExpandedFrameUpdatedProps & ExpandedFrameProps>;
|
|
51
|
+
export { ExpandedFrameWithFG as ExpandedFrame };
|
|
@@ -12,4 +12,10 @@ export interface FrameProps {
|
|
|
12
12
|
title?: string;
|
|
13
13
|
url?: string;
|
|
14
14
|
}
|
|
15
|
+
export interface FrameUpdatedProps extends FrameProps {
|
|
16
|
+
isMouseOver?: boolean;
|
|
17
|
+
onIframeMouseEnter?: () => void;
|
|
18
|
+
onIframeMouseLeave?: () => void;
|
|
19
|
+
}
|
|
15
20
|
export declare const Frame: React.ForwardRefExoticComponent<FrameProps & React.RefAttributes<HTMLIFrameElement>>;
|
|
21
|
+
export declare const FrameUpdated: React.ForwardRefExoticComponent<FrameUpdatedProps & React.RefAttributes<HTMLIFrameElement>>;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type EmbedCardProps } from './types';
|
|
3
3
|
export declare const EmbedCard: React.ForwardRefExoticComponent<EmbedCardProps & React.RefAttributes<HTMLIFrameElement>>;
|
|
4
|
+
export declare const EmbedCardUpdated: React.ForwardRefExoticComponent<EmbedCardProps & {
|
|
5
|
+
onIframeMouseEnter?: () => void;
|
|
6
|
+
onIframeMouseLeave?: () => void;
|
|
7
|
+
} & React.RefAttributes<HTMLIFrameElement>>;
|
|
@@ -30,6 +30,10 @@ export type EmbedCardProps = {
|
|
|
30
30
|
testId?: string;
|
|
31
31
|
url: string;
|
|
32
32
|
};
|
|
33
|
+
export type EmbedCardUpdatedProps = EmbedCardProps & {
|
|
34
|
+
onIframeMouseEnter?: () => void;
|
|
35
|
+
onIframeMouseLeave?: () => void;
|
|
36
|
+
};
|
|
33
37
|
export interface WithShowControlMethodProp {
|
|
34
38
|
showControls?: () => void;
|
|
35
39
|
}
|
|
@@ -28,6 +28,10 @@ export interface EmbedCardResolvedViewProps {
|
|
|
28
28
|
onIframeDwell?: (dwellTime: number, dwellPercentVisible: number) => void;
|
|
29
29
|
/** Optional callback for when user navigates into an iframe - for analytics **/
|
|
30
30
|
onIframeFocus?: () => void;
|
|
31
|
+
/** Optional callback for when user hovers over an iframe - for analytics **/
|
|
32
|
+
onIframeMouseEnter?: () => void;
|
|
33
|
+
/** Optional callback for when user stops hovering over an iframe - for analytics **/
|
|
34
|
+
onIframeMouseLeave?: () => void;
|
|
31
35
|
/** The src to be used for the `iframe` */
|
|
32
36
|
preview?: {
|
|
33
37
|
aspectRatio?: number;
|
|
@@ -40,4 +44,5 @@ export interface EmbedCardResolvedViewProps {
|
|
|
40
44
|
/** Type of the object */
|
|
41
45
|
type?: string[];
|
|
42
46
|
}
|
|
43
|
-
|
|
47
|
+
declare const EmbedCardResolvedViewWithFG: React.FC<Omit<EmbedCardResolvedViewProps & React.RefAttributes<HTMLIFrameElement>, "ref"> & React.RefAttributes<HTMLIFrameElement>>;
|
|
48
|
+
export { EmbedCardResolvedViewWithFG as EmbedCardResolvedView };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "43.
|
|
3
|
+
"version": "43.12.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@atlaskit/link-client-extension": "^6.0.0",
|
|
55
55
|
"@atlaskit/link-extractors": "^2.4.0",
|
|
56
56
|
"@atlaskit/link-test-helpers": "^8.5.0",
|
|
57
|
-
"@atlaskit/linking-common": "^9.
|
|
57
|
+
"@atlaskit/linking-common": "^9.9.0",
|
|
58
58
|
"@atlaskit/linking-types": "^14.2.0",
|
|
59
59
|
"@atlaskit/logo": "^19.9.0",
|
|
60
60
|
"@atlaskit/lozenge": "^13.1.0",
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"@atlaskit/modal-dialog": "^14.7.0",
|
|
63
63
|
"@atlaskit/outbound-auth-flow-client": "^3.4.0",
|
|
64
64
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
65
|
+
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
65
66
|
"@atlaskit/popup": "^4.6.0",
|
|
66
67
|
"@atlaskit/primitives": "^16.4.0",
|
|
67
68
|
"@atlaskit/section-message": "^8.9.0",
|
|
@@ -70,7 +71,7 @@
|
|
|
70
71
|
"@atlaskit/textarea": "^8.1.0",
|
|
71
72
|
"@atlaskit/textfield": "^8.1.0",
|
|
72
73
|
"@atlaskit/theme": "^21.0.0",
|
|
73
|
-
"@atlaskit/tmp-editor-statsig": "^14.
|
|
74
|
+
"@atlaskit/tmp-editor-statsig": "^14.2.0",
|
|
74
75
|
"@atlaskit/tokens": "^8.4.0",
|
|
75
76
|
"@atlaskit/tooltip": "^20.10.0",
|
|
76
77
|
"@atlaskit/ufo": "^0.4.0",
|
|
@@ -104,7 +105,7 @@
|
|
|
104
105
|
"@atlaskit/ssr": "workspace:^",
|
|
105
106
|
"@atlassian/analytics-tooling": "workspace:^",
|
|
106
107
|
"@atlassian/feature-flags-test-utils": "^1.0.0",
|
|
107
|
-
"@atlassian/gemini": "^1.
|
|
108
|
+
"@atlassian/gemini": "^1.23.0",
|
|
108
109
|
"@testing-library/dom": "^10.1.0",
|
|
109
110
|
"@testing-library/jest-dom": "^6.4.5",
|
|
110
111
|
"@testing-library/react": "^13.4.0",
|
|
@@ -205,6 +206,9 @@
|
|
|
205
206
|
"platform_editor_inline_card_selected_state_fix": {
|
|
206
207
|
"type": "boolean"
|
|
207
208
|
},
|
|
209
|
+
"rovo_chat_embed_card_dwell_and_hover_metrics": {
|
|
210
|
+
"type": "boolean"
|
|
211
|
+
},
|
|
208
212
|
"platform_smartlink_3pclick_analytics": {
|
|
209
213
|
"type": "boolean"
|
|
210
214
|
},
|