@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
|
@@ -227,4 +227,212 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
|
|
|
227
227
|
isSelected: isSelected
|
|
228
228
|
});
|
|
229
229
|
}
|
|
230
|
+
});
|
|
231
|
+
export const EmbedCardUpdated = /*#__PURE__*/React.forwardRef(({
|
|
232
|
+
url,
|
|
233
|
+
cardState,
|
|
234
|
+
handleAuthorize,
|
|
235
|
+
handleErrorRetry,
|
|
236
|
+
handleFrameClick,
|
|
237
|
+
isSelected,
|
|
238
|
+
frameStyle,
|
|
239
|
+
platform,
|
|
240
|
+
onResolve,
|
|
241
|
+
onError,
|
|
242
|
+
testId,
|
|
243
|
+
inheritDimensions,
|
|
244
|
+
onIframeDwell,
|
|
245
|
+
onIframeFocus,
|
|
246
|
+
onIframeMouseEnter,
|
|
247
|
+
onIframeMouseLeave,
|
|
248
|
+
iframeUrlType,
|
|
249
|
+
actionOptions,
|
|
250
|
+
renderers,
|
|
251
|
+
CompetitorPrompt,
|
|
252
|
+
hideIconLoadingSkeleton
|
|
253
|
+
}, iframeRef) => {
|
|
254
|
+
var _details$meta4, _forbiddenViewProps$c3, _forbiddenViewProps$c4, _notFoundViewProps$co3, _notFoundViewProps$co4;
|
|
255
|
+
const {
|
|
256
|
+
createAnalyticsEvent
|
|
257
|
+
} = useAnalyticsEvents();
|
|
258
|
+
const {
|
|
259
|
+
status,
|
|
260
|
+
details
|
|
261
|
+
} = cardState;
|
|
262
|
+
const extensionKey = getExtensionKey(details);
|
|
263
|
+
const isProductIntegrationSupported = hasAuthScopeOverrides(details);
|
|
264
|
+
const {
|
|
265
|
+
shouldControlDataExport = false
|
|
266
|
+
} = useControlDataExportConfig();
|
|
267
|
+
switch (status) {
|
|
268
|
+
case 'pending':
|
|
269
|
+
case 'resolving':
|
|
270
|
+
return /*#__PURE__*/React.createElement(UFOLoadHoldWrapper, null, /*#__PURE__*/React.createElement(BlockCardResolvedView, {
|
|
271
|
+
url: url,
|
|
272
|
+
cardState: cardState,
|
|
273
|
+
onClick: handleFrameClick,
|
|
274
|
+
onError: onError,
|
|
275
|
+
onResolve: onResolve,
|
|
276
|
+
renderers: renderers,
|
|
277
|
+
actionOptions: actionOptions,
|
|
278
|
+
testId: testId ? `${testId}-resolving-view` : 'embed-card-resolving-view'
|
|
279
|
+
}));
|
|
280
|
+
case 'resolved':
|
|
281
|
+
const resolvedViewProps = extractEmbedProps(details, platform, iframeUrlType);
|
|
282
|
+
if (onResolve) {
|
|
283
|
+
var _resolvedViewProps$pr2, _details$meta3;
|
|
284
|
+
onResolve({
|
|
285
|
+
title: resolvedViewProps.title,
|
|
286
|
+
url,
|
|
287
|
+
aspectRatio: (_resolvedViewProps$pr2 = resolvedViewProps.preview) === null || _resolvedViewProps$pr2 === void 0 ? void 0 : _resolvedViewProps$pr2.aspectRatio,
|
|
288
|
+
...(fg('expose-product-details-from-smart-card') && {
|
|
289
|
+
extensionKey: details === null || details === void 0 ? void 0 : (_details$meta3 = details.meta) === null || _details$meta3 === void 0 ? void 0 : _details$meta3.key
|
|
290
|
+
})
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
if (getIsDataExportEnabled(shouldControlDataExport, cardState.details)) {
|
|
294
|
+
const unauthViewProps = extractEmbedProps(details, platform);
|
|
295
|
+
return /*#__PURE__*/React.createElement(UnauthorizedView, {
|
|
296
|
+
context: unauthViewProps.context,
|
|
297
|
+
extensionKey: extensionKey,
|
|
298
|
+
frameStyle: frameStyle,
|
|
299
|
+
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
300
|
+
inheritDimensions: inheritDimensions,
|
|
301
|
+
isSelected: isSelected,
|
|
302
|
+
onAuthorize: handleAuthorize,
|
|
303
|
+
onClick: handleFrameClick,
|
|
304
|
+
testId: testId,
|
|
305
|
+
url: unauthViewProps.link
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
if (resolvedViewProps.preview) {
|
|
309
|
+
return /*#__PURE__*/React.createElement(EmbedCardResolvedView, _extends({}, resolvedViewProps, {
|
|
310
|
+
isSelected: isSelected,
|
|
311
|
+
frameStyle: frameStyle,
|
|
312
|
+
inheritDimensions: inheritDimensions,
|
|
313
|
+
onClick: handleFrameClick,
|
|
314
|
+
ref: iframeRef,
|
|
315
|
+
onIframeDwell: onIframeDwell,
|
|
316
|
+
onIframeFocus: onIframeFocus,
|
|
317
|
+
onIframeMouseEnter: onIframeMouseEnter,
|
|
318
|
+
onIframeMouseLeave: onIframeMouseLeave,
|
|
319
|
+
testId: testId,
|
|
320
|
+
CompetitorPrompt: CompetitorPrompt,
|
|
321
|
+
hideIconLoadingSkeleton: hideIconLoadingSkeleton,
|
|
322
|
+
extensionKey: extensionKey
|
|
323
|
+
}));
|
|
324
|
+
} else {
|
|
325
|
+
if (platform === 'mobile') {
|
|
326
|
+
const resolvedInlineViewProps = extractInlineProps(details);
|
|
327
|
+
return /*#__PURE__*/React.createElement(InlineCardResolvedView, _extends({}, resolvedInlineViewProps, {
|
|
328
|
+
isSelected: isSelected,
|
|
329
|
+
testId: testId,
|
|
330
|
+
onClick: handleFrameClick
|
|
331
|
+
}));
|
|
332
|
+
}
|
|
333
|
+
return /*#__PURE__*/React.createElement(BlockCardResolvedView, {
|
|
334
|
+
url: url,
|
|
335
|
+
cardState: cardState,
|
|
336
|
+
onClick: handleFrameClick,
|
|
337
|
+
onError: onError,
|
|
338
|
+
onResolve: onResolve,
|
|
339
|
+
renderers: renderers,
|
|
340
|
+
actionOptions: actionOptions,
|
|
341
|
+
testId: testId
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
case 'unauthorized':
|
|
345
|
+
if (onError) {
|
|
346
|
+
onError({
|
|
347
|
+
url,
|
|
348
|
+
status
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
const unauthorisedViewProps = extractEmbedProps(details, platform);
|
|
352
|
+
return /*#__PURE__*/React.createElement(UnauthorizedView, {
|
|
353
|
+
context: unauthorisedViewProps.context,
|
|
354
|
+
extensionKey: extensionKey,
|
|
355
|
+
frameStyle: frameStyle,
|
|
356
|
+
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
357
|
+
inheritDimensions: inheritDimensions,
|
|
358
|
+
isSelected: isSelected,
|
|
359
|
+
onAuthorize: handleAuthorize,
|
|
360
|
+
onClick: handleFrameClick,
|
|
361
|
+
testId: testId,
|
|
362
|
+
url: unauthorisedViewProps.link
|
|
363
|
+
});
|
|
364
|
+
case 'forbidden':
|
|
365
|
+
if (onError) {
|
|
366
|
+
onError({
|
|
367
|
+
url,
|
|
368
|
+
status
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
const forbiddenViewProps = extractEmbedProps(details, platform);
|
|
372
|
+
const cardMetadata = (_details$meta4 = details === null || details === void 0 ? void 0 : details.meta) !== null && _details$meta4 !== void 0 ? _details$meta4 : getForbiddenJsonLd().meta;
|
|
373
|
+
if (forbiddenViewProps.preview) {
|
|
374
|
+
return /*#__PURE__*/React.createElement(EmbedCardResolvedView, _extends({}, forbiddenViewProps, {
|
|
375
|
+
title: forbiddenViewProps.link,
|
|
376
|
+
frameStyle: frameStyle,
|
|
377
|
+
isSelected: isSelected,
|
|
378
|
+
inheritDimensions: inheritDimensions,
|
|
379
|
+
onClick: handleFrameClick,
|
|
380
|
+
ref: iframeRef,
|
|
381
|
+
extensionKey: extensionKey
|
|
382
|
+
}));
|
|
383
|
+
}
|
|
384
|
+
const forbiddenAccessContext = extractRequestAccessContextImproved({
|
|
385
|
+
jsonLd: cardMetadata,
|
|
386
|
+
url,
|
|
387
|
+
product: (_forbiddenViewProps$c3 = (_forbiddenViewProps$c4 = forbiddenViewProps.context) === null || _forbiddenViewProps$c4 === void 0 ? void 0 : _forbiddenViewProps$c4.text) !== null && _forbiddenViewProps$c3 !== void 0 ? _forbiddenViewProps$c3 : '',
|
|
388
|
+
createAnalyticsEvent
|
|
389
|
+
});
|
|
390
|
+
return /*#__PURE__*/React.createElement(ForbiddenView, {
|
|
391
|
+
context: forbiddenViewProps.context,
|
|
392
|
+
frameStyle: frameStyle,
|
|
393
|
+
inheritDimensions: inheritDimensions,
|
|
394
|
+
isSelected: isSelected,
|
|
395
|
+
onAuthorize: handleAuthorize,
|
|
396
|
+
onClick: handleFrameClick,
|
|
397
|
+
accessContext: forbiddenAccessContext,
|
|
398
|
+
url: forbiddenViewProps.link
|
|
399
|
+
});
|
|
400
|
+
case 'not_found':
|
|
401
|
+
if (onError) {
|
|
402
|
+
onError({
|
|
403
|
+
url,
|
|
404
|
+
status
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
const notFoundViewProps = extractEmbedProps(details, platform);
|
|
408
|
+
const notFoundAccessContext = details !== null && details !== void 0 && details.meta ? extractRequestAccessContextImproved({
|
|
409
|
+
jsonLd: details === null || details === void 0 ? void 0 : details.meta,
|
|
410
|
+
url,
|
|
411
|
+
product: (_notFoundViewProps$co3 = (_notFoundViewProps$co4 = notFoundViewProps.context) === null || _notFoundViewProps$co4 === void 0 ? void 0 : _notFoundViewProps$co4.text) !== null && _notFoundViewProps$co3 !== void 0 ? _notFoundViewProps$co3 : '',
|
|
412
|
+
createAnalyticsEvent
|
|
413
|
+
}) : undefined;
|
|
414
|
+
return /*#__PURE__*/React.createElement(NotFoundView, {
|
|
415
|
+
context: notFoundViewProps.context,
|
|
416
|
+
frameStyle: frameStyle,
|
|
417
|
+
inheritDimensions: inheritDimensions,
|
|
418
|
+
isSelected: isSelected,
|
|
419
|
+
onClick: handleFrameClick,
|
|
420
|
+
accessContext: notFoundAccessContext,
|
|
421
|
+
url: notFoundViewProps.link
|
|
422
|
+
});
|
|
423
|
+
case 'fallback':
|
|
424
|
+
case 'errored':
|
|
425
|
+
default:
|
|
426
|
+
if (onError) {
|
|
427
|
+
onError({
|
|
428
|
+
url,
|
|
429
|
+
status
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
return /*#__PURE__*/React.createElement(EmbedCardErroredView, {
|
|
433
|
+
onRetry: handleErrorRetry,
|
|
434
|
+
inheritDimensions: inheritDimensions,
|
|
435
|
+
isSelected: isSelected
|
|
436
|
+
});
|
|
437
|
+
}
|
|
230
438
|
});
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import LinkGlyph from '@atlaskit/icon/core/migration/link';
|
|
3
|
+
import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
|
|
3
4
|
import { useThemeObserver } from '@atlaskit/tokens';
|
|
4
5
|
import { getPreviewUrlWithTheme, isProfileType } from '../../../utils';
|
|
5
6
|
import { ExpandedFrame } from '../components/ExpandedFrame';
|
|
6
|
-
import { Frame } from '../components/Frame';
|
|
7
|
+
import { Frame, FrameUpdated } from '../components/Frame';
|
|
7
8
|
import { ImageIcon } from '../components/ImageIcon';
|
|
8
9
|
import { useEmbedResolvePostMessageListener } from '../useEmbedResolvePostMessageListener';
|
|
9
|
-
|
|
10
|
+
const FrameComponent = componentWithFG('rovo_chat_embed_card_dwell_and_hover_metrics', FrameUpdated, Frame);
|
|
11
|
+
const EmbedCardResolvedViewOld = /*#__PURE__*/React.forwardRef(({
|
|
10
12
|
link,
|
|
11
13
|
context,
|
|
12
14
|
onClick,
|
|
@@ -75,4 +77,90 @@ export const EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(({
|
|
|
75
77
|
title: text,
|
|
76
78
|
extensionKey: extensionKey
|
|
77
79
|
}));
|
|
78
|
-
});
|
|
80
|
+
});
|
|
81
|
+
const EmbedCardResolvedViewUpdated = /*#__PURE__*/React.forwardRef(({
|
|
82
|
+
link,
|
|
83
|
+
context,
|
|
84
|
+
onClick,
|
|
85
|
+
isSelected,
|
|
86
|
+
frameStyle,
|
|
87
|
+
preview,
|
|
88
|
+
title,
|
|
89
|
+
isTrusted,
|
|
90
|
+
testId = 'embed-card-resolved-view',
|
|
91
|
+
inheritDimensions,
|
|
92
|
+
onIframeDwell,
|
|
93
|
+
onIframeFocus,
|
|
94
|
+
onIframeMouseEnter,
|
|
95
|
+
onIframeMouseLeave,
|
|
96
|
+
isSupportTheming,
|
|
97
|
+
type,
|
|
98
|
+
CompetitorPrompt,
|
|
99
|
+
hideIconLoadingSkeleton,
|
|
100
|
+
extensionKey
|
|
101
|
+
}, embedIframeRef) => {
|
|
102
|
+
const iconFromContext = context === null || context === void 0 ? void 0 : context.icon;
|
|
103
|
+
const src = typeof iconFromContext === 'string' ? iconFromContext : undefined;
|
|
104
|
+
const text = title || (context === null || context === void 0 ? void 0 : context.text);
|
|
105
|
+
const linkGlyph = React.useMemo(() => /*#__PURE__*/React.createElement(LinkGlyph, {
|
|
106
|
+
label: "icon",
|
|
107
|
+
LEGACY_size: "small",
|
|
108
|
+
testId: "embed-card-fallback-icon",
|
|
109
|
+
color: "currentColor"
|
|
110
|
+
}), []);
|
|
111
|
+
let icon = React.useMemo(() => {
|
|
112
|
+
if ( /*#__PURE__*/React.isValidElement(iconFromContext)) {
|
|
113
|
+
return iconFromContext;
|
|
114
|
+
}
|
|
115
|
+
return /*#__PURE__*/React.createElement(ImageIcon, {
|
|
116
|
+
src: src,
|
|
117
|
+
default: linkGlyph,
|
|
118
|
+
appearance: isProfileType(type) ? 'round' : 'square',
|
|
119
|
+
hideLoadingSkeleton: hideIconLoadingSkeleton
|
|
120
|
+
});
|
|
121
|
+
}, [iconFromContext, src, linkGlyph, type, hideIconLoadingSkeleton]);
|
|
122
|
+
useEmbedResolvePostMessageListener({
|
|
123
|
+
url: link,
|
|
124
|
+
embedIframeRef
|
|
125
|
+
});
|
|
126
|
+
const themeState = useThemeObserver();
|
|
127
|
+
let previewUrl = preview === null || preview === void 0 ? void 0 : preview.src;
|
|
128
|
+
if (previewUrl && isSupportTheming) {
|
|
129
|
+
previewUrl = getPreviewUrlWithTheme(previewUrl, themeState);
|
|
130
|
+
}
|
|
131
|
+
const [isMouseOver, setMouseOver] = React.useState(false);
|
|
132
|
+
return /*#__PURE__*/React.createElement(ExpandedFrame, {
|
|
133
|
+
isSelected: isSelected,
|
|
134
|
+
frameStyle: frameStyle,
|
|
135
|
+
href: link,
|
|
136
|
+
testId: testId,
|
|
137
|
+
icon: icon,
|
|
138
|
+
text: text,
|
|
139
|
+
onClick: onClick,
|
|
140
|
+
inheritDimensions: inheritDimensions,
|
|
141
|
+
setOverflow: false,
|
|
142
|
+
CompetitorPrompt: CompetitorPrompt,
|
|
143
|
+
onContentMouseEnter: () => {
|
|
144
|
+
setMouseOver(true);
|
|
145
|
+
onIframeMouseEnter === null || onIframeMouseEnter === void 0 ? void 0 : onIframeMouseEnter();
|
|
146
|
+
},
|
|
147
|
+
onContentMouseLeave: () => {
|
|
148
|
+
setMouseOver(false);
|
|
149
|
+
onIframeMouseLeave === null || onIframeMouseLeave === void 0 ? void 0 : onIframeMouseLeave();
|
|
150
|
+
}
|
|
151
|
+
}, /*#__PURE__*/React.createElement(FrameComponent, {
|
|
152
|
+
url: previewUrl,
|
|
153
|
+
isTrusted: isTrusted,
|
|
154
|
+
testId: testId,
|
|
155
|
+
ref: embedIframeRef,
|
|
156
|
+
onIframeDwell: onIframeDwell,
|
|
157
|
+
onIframeFocus: onIframeFocus,
|
|
158
|
+
onIframeMouseEnter: onIframeMouseEnter,
|
|
159
|
+
onIframeMouseLeave: onIframeMouseLeave,
|
|
160
|
+
isMouseOver: isMouseOver,
|
|
161
|
+
title: text,
|
|
162
|
+
extensionKey: extensionKey
|
|
163
|
+
}));
|
|
164
|
+
});
|
|
165
|
+
const EmbedCardResolvedViewWithFG = componentWithFG('rovo_chat_embed_card_dwell_and_hover_metrics', EmbedCardResolvedViewUpdated, EmbedCardResolvedViewOld);
|
|
166
|
+
export { EmbedCardResolvedViewWithFG as EmbedCardResolvedView };
|
|
@@ -11,17 +11,13 @@ const BooleanInputPrompt = ({
|
|
|
11
11
|
displayName,
|
|
12
12
|
defaultValue
|
|
13
13
|
} = userInputPrompt;
|
|
14
|
-
return (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}) => /*#__PURE__*/React.createElement(Checkbox, _extends({}, fieldProps, {
|
|
23
|
-
label: displayName
|
|
24
|
-
})))
|
|
25
|
-
);
|
|
14
|
+
return /*#__PURE__*/React.createElement(CheckboxField, {
|
|
15
|
+
name: variableName,
|
|
16
|
+
defaultIsChecked: defaultValue || false
|
|
17
|
+
}, ({
|
|
18
|
+
fieldProps
|
|
19
|
+
}) => /*#__PURE__*/React.createElement(Checkbox, _extends({}, fieldProps, {
|
|
20
|
+
label: displayName
|
|
21
|
+
})));
|
|
26
22
|
};
|
|
27
23
|
export default BooleanInputPrompt;
|
|
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import AKLink from '@atlaskit/link';
|
|
4
4
|
import { withLinkClickedEvent } from '../../../utils/analytics/click';
|
|
5
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
6
5
|
const Anchor = withLinkClickedEvent('a');
|
|
7
6
|
export const LinkComponent = withLinkClickedEvent(AKLink);
|
|
8
7
|
const Hyperlink = ({
|
|
@@ -12,11 +12,9 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
12
12
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
13
13
|
const PACKAGE_DATA = {
|
|
14
14
|
packageName: "@atlaskit/smart-card",
|
|
15
|
-
packageVersion: "
|
|
15
|
+
packageVersion: "0.0.0-development",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
20
18
|
const Anchor = withLinkClickedEvent('a');
|
|
21
19
|
export const LinkComponent = withLinkClickedEvent(AKLink);
|
|
22
20
|
const LinkUrl = ({
|
|
@@ -51,10 +51,7 @@ export var useSmartCardActions = function useSmartCardActions(id, url) {
|
|
|
51
51
|
resourceUrl = _args.length > 0 && _args[0] !== undefined ? _args[0] : url;
|
|
52
52
|
isReloading = _args.length > 1 && _args[1] !== undefined ? _args[1] : false;
|
|
53
53
|
isMetadataRequest = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
|
|
54
|
-
return _context.abrupt("return",
|
|
55
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
56
|
-
|
|
57
|
-
resolveUrl(resourceUrl, isReloading, isMetadataRequest, id));
|
|
54
|
+
return _context.abrupt("return", resolveUrl(resourceUrl, isReloading, isMetadataRequest, id));
|
|
58
55
|
case 4:
|
|
59
56
|
case "end":
|
|
60
57
|
return _context.stop();
|
|
@@ -42,22 +42,12 @@ var useResolve = function useResolve() {
|
|
|
42
42
|
_context.next = 9;
|
|
43
43
|
break;
|
|
44
44
|
}
|
|
45
|
-
return _context.abrupt("return", connections.client
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
50
|
-
|
|
51
|
-
handleResolvedLinkResponse(url, response, isReloading, isMetadataRequest)
|
|
52
|
-
);
|
|
53
|
-
})
|
|
54
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
55
|
-
.catch(function (error) {
|
|
45
|
+
return _context.abrupt("return", connections.client.fetchData(url, isReloading).then(function (response) {
|
|
46
|
+
return handleResolvedLinkResponse(url, response, isReloading, isMetadataRequest);
|
|
47
|
+
}).catch(function (error) {
|
|
56
48
|
return handleResolvedLinkError(url, error, undefined, isMetadataRequest);
|
|
57
49
|
}));
|
|
58
50
|
case 9:
|
|
59
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
60
|
-
|
|
61
51
|
addMetadataToExperience('smart-link-rendered', id, {
|
|
62
52
|
cached: true
|
|
63
53
|
});
|
|
@@ -116,8 +116,6 @@ var useResponse = function useResponse() {
|
|
|
116
116
|
* https://react-redux.js.org/api/batch
|
|
117
117
|
*/
|
|
118
118
|
unstable_batchedUpdates(function () {
|
|
119
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
120
|
-
|
|
121
119
|
handleResolvedLinkSuccess(resourceUrl, response, isReloading, isMetadataRequest);
|
|
122
120
|
});
|
|
123
121
|
}, [handleResolvedLinkError, handleResolvedLinkSuccess, hasAuthFlowSupported]);
|
|
@@ -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: "
|
|
7
|
+
packageVersion: "0.0.0-development"
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -133,7 +133,6 @@ var getDisplayName = function getDisplayName(WrappedComponent) {
|
|
|
133
133
|
if (typeof WrappedComponent === 'string') {
|
|
134
134
|
return WrappedComponent;
|
|
135
135
|
}
|
|
136
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
137
136
|
return WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
138
137
|
};
|
|
139
138
|
export function withLinkClickedEvent(WrappedComponent) {
|