@atlaskit/smart-card 45.13.3 → 45.13.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 +16 -0
- package/analytics.spec.yaml +35 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-metadata--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-composition--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-blocker--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-critical--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-high--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-highest--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-low--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-lowest--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-major--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-medium--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-minor--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-trivial--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-false-platform-sl-3p-preauth-better-hovercard-false.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-false-platform-sl-3p-preauth-better-hovercard-true.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-true-platform-sl-3p-preauth-better-hovercard-false.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-true-platform-sl-3p-preauth-better-hovercard-true.png +2 -2
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/index.js +111 -10
- package/dist/cjs/view/EmbedCard/components/carousel/index.js +7 -2
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/UnauthorizedCarouselView.js +16 -1
- package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +10 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-metadata--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-composition--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-blocker--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-critical--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-high--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-highest--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-low--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-lowest--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-major--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-medium--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-minor--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-trivial--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-false-platform-sl-3p-preauth-better-hovercard-false.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-false-platform-sl-3p-preauth-better-hovercard-true.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-true-platform-sl-3p-preauth-better-hovercard-false.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-true-platform-sl-3p-preauth-better-hovercard-true.png +2 -2
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/index.js +51 -10
- package/dist/es2019/view/EmbedCard/components/carousel/index.js +7 -2
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/UnauthorizedCarouselView.js +16 -1
- package/dist/es2019/view/FlexibleCard/components/common/atlaskit-icon/index.js +9 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-metadata--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-composition--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-blocker--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-critical--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-high--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-highest--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-low--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-lowest--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-major--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-medium--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-minor--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card-icon/icon-type-priority-trivial--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-false-platform-sl-3p-preauth-better-hovercard-false.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-false-platform-sl-3p-preauth-better-hovercard-true.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-true-platform-sl-3p-preauth-better-hovercard-false.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-true-platform-sl-3p-preauth-better-hovercard-true.png +2 -2
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/index.js +91 -10
- package/dist/esm/view/EmbedCard/components/carousel/index.js +7 -2
- package/dist/esm/view/EmbedCard/views/unauthorized-view/UnauthorizedCarouselView.js +16 -1
- package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +10 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/common/analytics/generated/analytics.types.d.ts +19 -3
- package/dist/types/common/ui/icons/priority-blocker-icon.d.ts +1 -0
- package/dist/types/common/ui/icons/priority-critical-icon.d.ts +1 -0
- package/dist/types/common/ui/icons/priority-high-icon.d.ts +1 -0
- package/dist/types/common/ui/icons/priority-highest-icon.d.ts +1 -0
- package/dist/types/common/ui/icons/priority-low-icon.d.ts +1 -0
- package/dist/types/common/ui/icons/priority-lowest-icon.d.ts +1 -0
- package/dist/types/common/ui/icons/priority-major-icon.d.ts +1 -0
- package/dist/types/common/ui/icons/priority-medium-icon.d.ts +1 -0
- package/dist/types/common/ui/icons/priority-minor-icon.d.ts +1 -0
- package/dist/types/common/ui/icons/priority-trivial-icon.d.ts +1 -0
- package/dist/types/view/EmbedCard/components/carousel/index.d.ts +4 -2
- package/dist/types/view/EmbedCard/components/carousel/types.d.ts +6 -0
- package/package.json +7 -4
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:cd8bc16db0eebc4cfd0f8882a3483ed84905e78317f8d6ff1d053d720b9b05f4
|
|
3
|
+
size 220298
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:cd8bc16db0eebc4cfd0f8882a3483ed84905e78317f8d6ff1d053d720b9b05f4
|
|
3
|
+
size 220298
|
|
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
2
2
|
export const context = {
|
|
3
3
|
componentName: 'smart-cards',
|
|
4
4
|
packageName: "@atlaskit/smart-card" || '',
|
|
5
|
-
packageVersion: "45.13.
|
|
5
|
+
packageVersion: "45.13.4" || ''
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import Loadable from 'react-loadable';
|
|
4
4
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
|
+
import { token } from '@atlaskit/tokens/get-token';
|
|
5
6
|
import { themeObjectToString } from '@atlaskit/tokens/theme-state-transformer';
|
|
6
7
|
import { IconType, SmartLinkSize } from '../constants';
|
|
7
8
|
import extractFileFormatIcon from '../extractors/flexible/icon/extract-file-formatIcon';
|
|
@@ -310,34 +311,74 @@ export const getLazyIcons = () => {
|
|
|
310
311
|
},
|
|
311
312
|
// Local priority icons (custom SVG components)
|
|
312
313
|
[IconType.PriorityBlocker]: {
|
|
313
|
-
default: () => import( /* webpackChunkName: "@atlaskit-
|
|
314
|
+
default: () => fg('platform_sl_priority_icon') ? import( /* webpackChunkName: "@atlaskit-internal_glyphPriorityBlocker" */'@atlaskit/icon/core/priority-blocker').then(module => ({
|
|
315
|
+
default: props => /*#__PURE__*/React.createElement(module.default, _extends({}, props, {
|
|
316
|
+
color: token('color.icon.accent.red')
|
|
317
|
+
}))
|
|
318
|
+
})) : import( /* webpackChunkName: "@atlaskit-internal_glyphBlocker" */'../common/ui/icons/priority-blocker-icon')
|
|
314
319
|
},
|
|
315
320
|
[IconType.PriorityCritical]: {
|
|
316
|
-
default: () => import( /* webpackChunkName: "@atlaskit-
|
|
321
|
+
default: () => fg('platform_sl_priority_icon') ? import( /* webpackChunkName: "@atlaskit-internal_glyphPriorityCritical" */'@atlaskit/icon/core/priority-critical').then(module => ({
|
|
322
|
+
default: props => /*#__PURE__*/React.createElement(module.default, _extends({}, props, {
|
|
323
|
+
color: token('color.icon.accent.red')
|
|
324
|
+
}))
|
|
325
|
+
})) : import( /* webpackChunkName: "@atlaskit-internal_glyphCritical" */'../common/ui/icons/priority-critical-icon')
|
|
317
326
|
},
|
|
318
327
|
[IconType.PriorityHigh]: {
|
|
319
|
-
default: () => import( /* webpackChunkName: "@atlaskit-
|
|
328
|
+
default: () => fg('platform_sl_priority_icon') ? import( /* webpackChunkName: "@atlaskit-internal_glyphPriorityHigh" */'@atlaskit/icon/core/priority-high').then(module => ({
|
|
329
|
+
default: props => /*#__PURE__*/React.createElement(module.default, _extends({}, props, {
|
|
330
|
+
color: token('color.icon.accent.red')
|
|
331
|
+
}))
|
|
332
|
+
})) : import( /* webpackChunkName: "@atlaskit-internal_glyphHigh" */'../common/ui/icons/priority-high-icon')
|
|
320
333
|
},
|
|
321
334
|
[IconType.PriorityHighest]: {
|
|
322
|
-
default: () => import( /* webpackChunkName: "@atlaskit-
|
|
335
|
+
default: () => fg('platform_sl_priority_icon') ? import( /* webpackChunkName: "@atlaskit-internal_glyphPriorityHighest" */'@atlaskit/icon/core/priority-highest').then(module => ({
|
|
336
|
+
default: props => /*#__PURE__*/React.createElement(module.default, _extends({}, props, {
|
|
337
|
+
color: token('color.icon.accent.red')
|
|
338
|
+
}))
|
|
339
|
+
})) : import( /* webpackChunkName: "@atlaskit-internal_glyphHighest" */'../common/ui/icons/priority-highest-icon')
|
|
323
340
|
},
|
|
324
341
|
[IconType.PriorityLow]: {
|
|
325
|
-
default: () => import( /* webpackChunkName: "@atlaskit-
|
|
342
|
+
default: () => fg('platform_sl_priority_icon') ? import( /* webpackChunkName: "@atlaskit-internal_glyphPriorityLow" */'@atlaskit/icon/core/priority-low').then(module => ({
|
|
343
|
+
default: props => /*#__PURE__*/React.createElement(module.default, _extends({}, props, {
|
|
344
|
+
color: token('color.icon.accent.blue')
|
|
345
|
+
}))
|
|
346
|
+
})) : import( /* webpackChunkName: "@atlaskit-internal_glyphLow" */'../common/ui/icons/priority-low-icon')
|
|
326
347
|
},
|
|
327
348
|
[IconType.PriorityLowest]: {
|
|
328
|
-
default: () => import( /* webpackChunkName: "@atlaskit-
|
|
349
|
+
default: () => fg('platform_sl_priority_icon') ? import( /* webpackChunkName: "@atlaskit-internal_glyphPriorityLowest" */'@atlaskit/icon/core/priority-lowest').then(module => ({
|
|
350
|
+
default: props => /*#__PURE__*/React.createElement(module.default, _extends({}, props, {
|
|
351
|
+
color: token('color.icon.accent.blue')
|
|
352
|
+
}))
|
|
353
|
+
})) : import( /* webpackChunkName: "@atlaskit-internal_glyphLowest" */'../common/ui/icons/priority-lowest-icon')
|
|
329
354
|
},
|
|
330
355
|
[IconType.PriorityMajor]: {
|
|
331
|
-
default: () => import( /* webpackChunkName: "@atlaskit-
|
|
356
|
+
default: () => fg('platform_sl_priority_icon') ? import( /* webpackChunkName: "@atlaskit-internal_glyphPriorityMajor" */'@atlaskit/icon/core/priority-major').then(module => ({
|
|
357
|
+
default: props => /*#__PURE__*/React.createElement(module.default, _extends({}, props, {
|
|
358
|
+
color: token('color.icon.accent.red')
|
|
359
|
+
}))
|
|
360
|
+
})) : import( /* webpackChunkName: "@atlaskit-internal_glyphMajor" */'../common/ui/icons/priority-major-icon')
|
|
332
361
|
},
|
|
333
362
|
[IconType.PriorityMedium]: {
|
|
334
|
-
default: () => import( /* webpackChunkName: "@atlaskit-
|
|
363
|
+
default: () => fg('platform_sl_priority_icon') ? import( /* webpackChunkName: "@atlaskit-internal_glyphPriorityMedium" */'@atlaskit/icon/core/priority-medium').then(module => ({
|
|
364
|
+
default: props => /*#__PURE__*/React.createElement(module.default, _extends({}, props, {
|
|
365
|
+
color: token('color.icon.accent.orange')
|
|
366
|
+
}))
|
|
367
|
+
})) : import( /* webpackChunkName: "@atlaskit-internal_glyphMedium" */'../common/ui/icons/priority-medium-icon')
|
|
335
368
|
},
|
|
336
369
|
[IconType.PriorityMinor]: {
|
|
337
|
-
default: () => import( /* webpackChunkName: "@atlaskit-
|
|
370
|
+
default: () => fg('platform_sl_priority_icon') ? import( /* webpackChunkName: "@atlaskit-internal_glyphPriorityMinor" */'@atlaskit/icon/core/priority-minor').then(module => ({
|
|
371
|
+
default: props => /*#__PURE__*/React.createElement(module.default, _extends({}, props, {
|
|
372
|
+
color: token('color.icon.accent.blue')
|
|
373
|
+
}))
|
|
374
|
+
})) : import( /* webpackChunkName: "@atlaskit-internal_glyphMinor" */'../common/ui/icons/priority-minor-icon')
|
|
338
375
|
},
|
|
339
376
|
[IconType.PriorityTrivial]: {
|
|
340
|
-
default: () => import( /* webpackChunkName: "@atlaskit-
|
|
377
|
+
default: () => fg('platform_sl_priority_icon') ? import( /* webpackChunkName: "@atlaskit-internal_glyphPriorityTrivial" */'@atlaskit/icon/core/priority-trivial').then(module => ({
|
|
378
|
+
default: props => /*#__PURE__*/React.createElement(module.default, _extends({}, props, {
|
|
379
|
+
color: token('color.icon.accent.gray')
|
|
380
|
+
}))
|
|
381
|
+
})) : import( /* webpackChunkName: "@atlaskit-internal_glyphTrivial" */'../common/ui/icons/priority-trivial-icon')
|
|
341
382
|
}
|
|
342
383
|
};
|
|
343
384
|
};
|
|
@@ -31,6 +31,7 @@ const Carousel = ({
|
|
|
31
31
|
iconLabel,
|
|
32
32
|
initialSlideIndex = 0,
|
|
33
33
|
items,
|
|
34
|
+
onNextClick,
|
|
34
35
|
onPrimaryButtonClick,
|
|
35
36
|
primaryButtonLabel,
|
|
36
37
|
testId = 'embed-card-teaser-carousel'
|
|
@@ -62,8 +63,9 @@ const Carousel = ({
|
|
|
62
63
|
}, []);
|
|
63
64
|
const goNext = useCallback(() => {
|
|
64
65
|
hasNavigated.current = true;
|
|
66
|
+
onNextClick === null || onNextClick === void 0 ? void 0 : onNextClick(items[activeIndex].id);
|
|
65
67
|
setActiveIndex(current => (current + 1) % items.length);
|
|
66
|
-
}, [items
|
|
68
|
+
}, [items, activeIndex, onNextClick]);
|
|
67
69
|
const goPrev = useCallback(() => {
|
|
68
70
|
hasNavigated.current = true;
|
|
69
71
|
setActiveIndex(current => Math.max(0, current - 1));
|
|
@@ -75,6 +77,9 @@ const Carousel = ({
|
|
|
75
77
|
hasNavigated.current = true;
|
|
76
78
|
setActiveIndex(index);
|
|
77
79
|
}, [activeIndex]);
|
|
80
|
+
const handlePrimaryButtonClick = useCallback(() => {
|
|
81
|
+
onPrimaryButtonClick === null || onPrimaryButtonClick === void 0 ? void 0 : onPrimaryButtonClick(items[activeIndex].id);
|
|
82
|
+
}, [onPrimaryButtonClick, items, activeIndex]);
|
|
78
83
|
const currentSlide = items[activeIndex];
|
|
79
84
|
const isFirstSlide = activeIndex === 0;
|
|
80
85
|
const isLastSlide = activeIndex === items.length - 1;
|
|
@@ -93,7 +98,7 @@ const Carousel = ({
|
|
|
93
98
|
iconLabel: iconLabel,
|
|
94
99
|
image: currentSlide.image,
|
|
95
100
|
title: currentSlide.title,
|
|
96
|
-
onPrimaryButtonClick: onPrimaryButtonClick,
|
|
101
|
+
onPrimaryButtonClick: onPrimaryButtonClick ? handlePrimaryButtonClick : undefined,
|
|
97
102
|
onBackClick: !isFirstSlide ? goPrev : undefined,
|
|
98
103
|
onDotClick: goTo,
|
|
99
104
|
onNextClick: !isLastSlide ? goNext : undefined,
|
|
@@ -77,6 +77,7 @@ const UnauthorizedCarouselView = ({
|
|
|
77
77
|
const items = useMemo(() => {
|
|
78
78
|
if (!canAuthorize) {
|
|
79
79
|
return [{
|
|
80
|
+
id: 'no-auth-available',
|
|
80
81
|
title: intl.formatMessage(messages.unauthorised_account_name_no_provider),
|
|
81
82
|
description: intl.formatMessage(messages.unauthorised_account_description_no_provider),
|
|
82
83
|
image: /*#__PURE__*/React.createElement(NoAuthAvailableImage, null)
|
|
@@ -94,6 +95,7 @@ const UnauthorizedCarouselView = ({
|
|
|
94
95
|
// We only have special text for Google Drive and i18n select takes only one word (no space).
|
|
95
96
|
const i18nSelectContext = (context === null || context === void 0 ? void 0 : context.text) === 'Google Drive' ? 'Google' : context === null || context === void 0 ? void 0 : context.text;
|
|
96
97
|
const slides = [{
|
|
98
|
+
id: 'smart-link-benefit',
|
|
97
99
|
title: intl.formatMessage(messages.connect_link_account_embed_carousel_sl_title),
|
|
98
100
|
description: intl.formatMessage(messages.connect_link_account_embed_carousel_sl_description, {
|
|
99
101
|
context: i18nSelectContext,
|
|
@@ -109,6 +111,7 @@ const UnauthorizedCarouselView = ({
|
|
|
109
111
|
// we show additional Rovo-specific teaser slides to encourage the user to connect their account.
|
|
110
112
|
if (rovoOptions !== null && rovoOptions !== void 0 && rovoOptions.isRovoEnabled) {
|
|
111
113
|
slides.push({
|
|
114
|
+
id: 'rovo-search-benefit',
|
|
112
115
|
title: intl.formatMessage(messages.connect_link_account_embed_carousel_rovo_title),
|
|
113
116
|
description: intl.formatMessage(messages.connect_link_account_embed_carousel_rovo_description, {
|
|
114
117
|
context: providerName,
|
|
@@ -125,6 +128,7 @@ const UnauthorizedCarouselView = ({
|
|
|
125
128
|
}
|
|
126
129
|
if (rovoOptions !== null && rovoOptions !== void 0 && rovoOptions.isRovoEnabled && rovoOptions !== null && rovoOptions !== void 0 && rovoOptions.isRovoLLMEnabled) {
|
|
127
130
|
slides.push({
|
|
131
|
+
id: 'rovo-chat-benefit',
|
|
128
132
|
title: intl.formatMessage(messages.connect_link_account_embed_carousel_rovochat_title),
|
|
129
133
|
description: intl.formatMessage(messages.connect_link_account_embed_carousel_rovochat_description, {
|
|
130
134
|
context: providerName
|
|
@@ -140,12 +144,22 @@ const UnauthorizedCarouselView = ({
|
|
|
140
144
|
}
|
|
141
145
|
return slides;
|
|
142
146
|
}, [canAuthorize, context, intl, product, providerName, providerIcon, rovoOptions]);
|
|
143
|
-
const handleOnAuthorizeClick = useCallback(
|
|
147
|
+
const handleOnAuthorizeClick = useCallback(slideId => {
|
|
144
148
|
if (onAuthorize) {
|
|
145
149
|
fireEvent('track.applicationAccount.authStarted', {});
|
|
150
|
+
fireEvent('ui.button.clicked.carouselConnect', {
|
|
151
|
+
display: 'embed',
|
|
152
|
+
slideId
|
|
153
|
+
});
|
|
146
154
|
onAuthorize();
|
|
147
155
|
}
|
|
148
156
|
}, [onAuthorize, fireEvent]);
|
|
157
|
+
const handleOnNextClick = useCallback(slideId => {
|
|
158
|
+
fireEvent('ui.button.clicked.carouselNext', {
|
|
159
|
+
display: 'embed',
|
|
160
|
+
slideId
|
|
161
|
+
});
|
|
162
|
+
}, [fireEvent]);
|
|
149
163
|
const buttonLabel = context !== null && context !== void 0 && context.text ? intl.formatMessage(messages.connect_3p_account, {
|
|
150
164
|
context: context.text
|
|
151
165
|
}) : intl.formatMessage(messages.connect_link_account_card);
|
|
@@ -176,6 +190,7 @@ const UnauthorizedCarouselView = ({
|
|
|
176
190
|
icon: context === null || context === void 0 ? void 0 : context.icon,
|
|
177
191
|
iconLabel: context === null || context === void 0 ? void 0 : context.text,
|
|
178
192
|
items: items,
|
|
193
|
+
onNextClick: handleOnNextClick,
|
|
179
194
|
onPrimaryButtonClick: canAuthorize ? handleOnAuthorizeClick : undefined,
|
|
180
195
|
primaryButtonLabel: buttonLabel,
|
|
181
196
|
testId: `${testId}-carousel`
|
|
@@ -23,8 +23,9 @@ const importIcon = importFn => {
|
|
|
23
23
|
const getBlogIcon = () => require('../../../../../common/ui/icons/blog-icon').default;
|
|
24
24
|
const getDocumentIcon = () => require('../../../../../common/ui/icons/page-icon').default;
|
|
25
25
|
const getLiveDocumentIcon = () => require('../../../../../common/ui/icons/live-document-icon').default;
|
|
26
|
+
const PRIORITY_ICONS = [IconType.PriorityBlocker, IconType.PriorityCritical, IconType.PriorityHigh, IconType.PriorityHighest, IconType.PriorityLow, IconType.PriorityLowest, IconType.PriorityMajor, IconType.PriorityMedium, IconType.PriorityMinor, IconType.PriorityTrivial];
|
|
26
27
|
const isCoreIcon = icon => {
|
|
27
|
-
return [IconType.Project, IconType.Template, IconType.Forbidden, IconType.Default, IconType.Error, IconType.Attachment, IconType.CheckItem, IconType.Component, IconType.Comment, IconType.View, IconType.React, IconType.Vote, IconType.PriorityUndefined, IconType.ProgrammingLanguage, IconType.Subscriber, IconType.SubTasksProgress].includes(icon);
|
|
28
|
+
return [IconType.Project, IconType.Template, IconType.Forbidden, IconType.Default, IconType.Error, IconType.Attachment, IconType.CheckItem, IconType.Component, IconType.Comment, IconType.View, IconType.React, IconType.Vote, IconType.PriorityUndefined, IconType.ProgrammingLanguage, IconType.Subscriber, IconType.SubTasksProgress, ...(fg('platform_sl_priority_icon') ? PRIORITY_ICONS : [])].includes(icon);
|
|
28
29
|
};
|
|
29
30
|
const AtlaskitIcon = ({
|
|
30
31
|
icon,
|
|
@@ -88,6 +89,13 @@ const AtlaskitIcon = ({
|
|
|
88
89
|
});
|
|
89
90
|
case SmartLinkSize.Large:
|
|
90
91
|
case SmartLinkSize.XLarge:
|
|
92
|
+
if (PRIORITY_ICONS.includes(icon) && fg('platform_sl_priority_icon')) {
|
|
93
|
+
return /*#__PURE__*/React.createElement(ImportedIcon, {
|
|
94
|
+
label: label,
|
|
95
|
+
testId: testId,
|
|
96
|
+
color: color
|
|
97
|
+
});
|
|
98
|
+
}
|
|
91
99
|
let appearance;
|
|
92
100
|
if (icon === IconType.Error || icon === IconType.Forbidden) {
|
|
93
101
|
appearance = 'redBold';
|
|
@@ -9,7 +9,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
9
9
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
10
10
|
const PACKAGE_DATA = {
|
|
11
11
|
packageName: "@atlaskit/smart-card",
|
|
12
|
-
packageVersion: "45.13.
|
|
12
|
+
packageVersion: "45.13.4",
|
|
13
13
|
componentName: 'linkUrl'
|
|
14
14
|
};
|
|
15
15
|
const LinkUrl = ({
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:ff920567e7c479cb4b392387a65d13782dbd2d0ba8f5c2e151468ff763b05745
|
|
3
|
+
size 155671
|
package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-composition--default.png
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:c291fcaaf70a8fe7fb591f81b8cb847f9fed6a41bff8b68b4fc3537858c63327
|
|
3
|
+
size 103954
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:b1f967736efa7f07f65cde83bfd59c6034e1f7f7271eeadcce4eddd72abae460
|
|
3
|
+
size 909
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:8afc83fc97fe9a18ae1e22b07b5740802daa92c3c5c3d0afcf92a047acd466d0
|
|
3
|
+
size 693
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:eb628b90b7507b2d8dd0a9fa25bb38ddbfe3ed139ab745ecfe5d3b7baf8c2ee8
|
|
3
|
+
size 578
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:e13590c476875e065a8e5a4107da0ec08f57906f4f50d933180baeed8de41485
|
|
3
|
+
size 735
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:13a75abc78d4f38d5000684f61edf516e53e8ab1553af7a6a02b8423cf86acb4
|
|
3
|
+
size 538
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:5d01a73fff315767f18623a554df194bf7ff52652df8c02a9dc615b4ad3c2245
|
|
3
|
+
size 718
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:d4945d7a7f3a66a0e55692d2e13220913ea15a7cefb5ecdcd36ed78d616aae53
|
|
3
|
+
size 898
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:4661af0db6c199053587fa1fdea292a078d09c14bfa11c75898409799b47f124
|
|
3
|
+
size 391
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:8d038fc0b7e46d84dbc71ca95a76438ab2bfb836d7e603651c12c2a20051ddbf
|
|
3
|
+
size 881
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:d3f200ff0ce9d4b1db2062033076ccfe9865a5d750c44842e00fd47331100348
|
|
3
|
+
size 868
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:06012e2c14c38c3fc9da9fa230c9fc55dd0b011c7f5756b930968f1a88700828
|
|
3
|
+
size 220083
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:06012e2c14c38c3fc9da9fa230c9fc55dd0b011c7f5756b930968f1a88700828
|
|
3
|
+
size 220083
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:cd8bc16db0eebc4cfd0f8882a3483ed84905e78317f8d6ff1d053d720b9b05f4
|
|
3
|
+
size 220298
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:cd8bc16db0eebc4cfd0f8882a3483ed84905e78317f8d6ff1d053d720b9b05f4
|
|
3
|
+
size 220298
|
|
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export var context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card" || '',
|
|
7
|
-
packageVersion: "45.13.
|
|
7
|
+
packageVersion: "45.13.4" || ''
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import Loadable from 'react-loadable';
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
+
import { token } from '@atlaskit/tokens/get-token';
|
|
9
10
|
import { themeObjectToString } from '@atlaskit/tokens/theme-state-transformer';
|
|
10
11
|
import { IconType, SmartLinkSize } from '../constants';
|
|
11
12
|
import extractFileFormatIcon from '../extractors/flexible/icon/extract-file-formatIcon';
|
|
@@ -476,43 +477,123 @@ export var getLazyIcons = function getLazyIcons() {
|
|
|
476
477
|
}
|
|
477
478
|
}), IconType.PriorityBlocker, {
|
|
478
479
|
default: function _default() {
|
|
479
|
-
return import( /* webpackChunkName: "@atlaskit-
|
|
480
|
+
return fg('platform_sl_priority_icon') ? import( /* webpackChunkName: "@atlaskit-internal_glyphPriorityBlocker" */'@atlaskit/icon/core/priority-blocker').then(function (module) {
|
|
481
|
+
return {
|
|
482
|
+
default: function _default(props) {
|
|
483
|
+
return /*#__PURE__*/React.createElement(module.default, _extends({}, props, {
|
|
484
|
+
color: token('color.icon.accent.red')
|
|
485
|
+
}));
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
}) : import( /* webpackChunkName: "@atlaskit-internal_glyphBlocker" */'../common/ui/icons/priority-blocker-icon');
|
|
480
489
|
}
|
|
481
490
|
}), IconType.PriorityCritical, {
|
|
482
491
|
default: function _default() {
|
|
483
|
-
return import( /* webpackChunkName: "@atlaskit-
|
|
492
|
+
return fg('platform_sl_priority_icon') ? import( /* webpackChunkName: "@atlaskit-internal_glyphPriorityCritical" */'@atlaskit/icon/core/priority-critical').then(function (module) {
|
|
493
|
+
return {
|
|
494
|
+
default: function _default(props) {
|
|
495
|
+
return /*#__PURE__*/React.createElement(module.default, _extends({}, props, {
|
|
496
|
+
color: token('color.icon.accent.red')
|
|
497
|
+
}));
|
|
498
|
+
}
|
|
499
|
+
};
|
|
500
|
+
}) : import( /* webpackChunkName: "@atlaskit-internal_glyphCritical" */'../common/ui/icons/priority-critical-icon');
|
|
484
501
|
}
|
|
485
502
|
}), IconType.PriorityHigh, {
|
|
486
503
|
default: function _default() {
|
|
487
|
-
return import( /* webpackChunkName: "@atlaskit-
|
|
504
|
+
return fg('platform_sl_priority_icon') ? import( /* webpackChunkName: "@atlaskit-internal_glyphPriorityHigh" */'@atlaskit/icon/core/priority-high').then(function (module) {
|
|
505
|
+
return {
|
|
506
|
+
default: function _default(props) {
|
|
507
|
+
return /*#__PURE__*/React.createElement(module.default, _extends({}, props, {
|
|
508
|
+
color: token('color.icon.accent.red')
|
|
509
|
+
}));
|
|
510
|
+
}
|
|
511
|
+
};
|
|
512
|
+
}) : import( /* webpackChunkName: "@atlaskit-internal_glyphHigh" */'../common/ui/icons/priority-high-icon');
|
|
488
513
|
}
|
|
489
514
|
}), IconType.PriorityHighest, {
|
|
490
515
|
default: function _default() {
|
|
491
|
-
return import( /* webpackChunkName: "@atlaskit-
|
|
516
|
+
return fg('platform_sl_priority_icon') ? import( /* webpackChunkName: "@atlaskit-internal_glyphPriorityHighest" */'@atlaskit/icon/core/priority-highest').then(function (module) {
|
|
517
|
+
return {
|
|
518
|
+
default: function _default(props) {
|
|
519
|
+
return /*#__PURE__*/React.createElement(module.default, _extends({}, props, {
|
|
520
|
+
color: token('color.icon.accent.red')
|
|
521
|
+
}));
|
|
522
|
+
}
|
|
523
|
+
};
|
|
524
|
+
}) : import( /* webpackChunkName: "@atlaskit-internal_glyphHighest" */'../common/ui/icons/priority-highest-icon');
|
|
492
525
|
}
|
|
493
526
|
}), IconType.PriorityLow, {
|
|
494
527
|
default: function _default() {
|
|
495
|
-
return import( /* webpackChunkName: "@atlaskit-
|
|
528
|
+
return fg('platform_sl_priority_icon') ? import( /* webpackChunkName: "@atlaskit-internal_glyphPriorityLow" */'@atlaskit/icon/core/priority-low').then(function (module) {
|
|
529
|
+
return {
|
|
530
|
+
default: function _default(props) {
|
|
531
|
+
return /*#__PURE__*/React.createElement(module.default, _extends({}, props, {
|
|
532
|
+
color: token('color.icon.accent.blue')
|
|
533
|
+
}));
|
|
534
|
+
}
|
|
535
|
+
};
|
|
536
|
+
}) : import( /* webpackChunkName: "@atlaskit-internal_glyphLow" */'../common/ui/icons/priority-low-icon');
|
|
496
537
|
}
|
|
497
538
|
}), IconType.PriorityLowest, {
|
|
498
539
|
default: function _default() {
|
|
499
|
-
return import( /* webpackChunkName: "@atlaskit-
|
|
540
|
+
return fg('platform_sl_priority_icon') ? import( /* webpackChunkName: "@atlaskit-internal_glyphPriorityLowest" */'@atlaskit/icon/core/priority-lowest').then(function (module) {
|
|
541
|
+
return {
|
|
542
|
+
default: function _default(props) {
|
|
543
|
+
return /*#__PURE__*/React.createElement(module.default, _extends({}, props, {
|
|
544
|
+
color: token('color.icon.accent.blue')
|
|
545
|
+
}));
|
|
546
|
+
}
|
|
547
|
+
};
|
|
548
|
+
}) : import( /* webpackChunkName: "@atlaskit-internal_glyphLowest" */'../common/ui/icons/priority-lowest-icon');
|
|
500
549
|
}
|
|
501
550
|
}), IconType.PriorityMajor, {
|
|
502
551
|
default: function _default() {
|
|
503
|
-
return import( /* webpackChunkName: "@atlaskit-
|
|
552
|
+
return fg('platform_sl_priority_icon') ? import( /* webpackChunkName: "@atlaskit-internal_glyphPriorityMajor" */'@atlaskit/icon/core/priority-major').then(function (module) {
|
|
553
|
+
return {
|
|
554
|
+
default: function _default(props) {
|
|
555
|
+
return /*#__PURE__*/React.createElement(module.default, _extends({}, props, {
|
|
556
|
+
color: token('color.icon.accent.red')
|
|
557
|
+
}));
|
|
558
|
+
}
|
|
559
|
+
};
|
|
560
|
+
}) : import( /* webpackChunkName: "@atlaskit-internal_glyphMajor" */'../common/ui/icons/priority-major-icon');
|
|
504
561
|
}
|
|
505
562
|
}), _defineProperty(_defineProperty(_defineProperty(_ref3, IconType.PriorityMedium, {
|
|
506
563
|
default: function _default() {
|
|
507
|
-
return import( /* webpackChunkName: "@atlaskit-
|
|
564
|
+
return fg('platform_sl_priority_icon') ? import( /* webpackChunkName: "@atlaskit-internal_glyphPriorityMedium" */'@atlaskit/icon/core/priority-medium').then(function (module) {
|
|
565
|
+
return {
|
|
566
|
+
default: function _default(props) {
|
|
567
|
+
return /*#__PURE__*/React.createElement(module.default, _extends({}, props, {
|
|
568
|
+
color: token('color.icon.accent.orange')
|
|
569
|
+
}));
|
|
570
|
+
}
|
|
571
|
+
};
|
|
572
|
+
}) : import( /* webpackChunkName: "@atlaskit-internal_glyphMedium" */'../common/ui/icons/priority-medium-icon');
|
|
508
573
|
}
|
|
509
574
|
}), IconType.PriorityMinor, {
|
|
510
575
|
default: function _default() {
|
|
511
|
-
return import( /* webpackChunkName: "@atlaskit-
|
|
576
|
+
return fg('platform_sl_priority_icon') ? import( /* webpackChunkName: "@atlaskit-internal_glyphPriorityMinor" */'@atlaskit/icon/core/priority-minor').then(function (module) {
|
|
577
|
+
return {
|
|
578
|
+
default: function _default(props) {
|
|
579
|
+
return /*#__PURE__*/React.createElement(module.default, _extends({}, props, {
|
|
580
|
+
color: token('color.icon.accent.blue')
|
|
581
|
+
}));
|
|
582
|
+
}
|
|
583
|
+
};
|
|
584
|
+
}) : import( /* webpackChunkName: "@atlaskit-internal_glyphMinor" */'../common/ui/icons/priority-minor-icon');
|
|
512
585
|
}
|
|
513
586
|
}), IconType.PriorityTrivial, {
|
|
514
587
|
default: function _default() {
|
|
515
|
-
return import( /* webpackChunkName: "@atlaskit-
|
|
588
|
+
return fg('platform_sl_priority_icon') ? import( /* webpackChunkName: "@atlaskit-internal_glyphPriorityTrivial" */'@atlaskit/icon/core/priority-trivial').then(function (module) {
|
|
589
|
+
return {
|
|
590
|
+
default: function _default(props) {
|
|
591
|
+
return /*#__PURE__*/React.createElement(module.default, _extends({}, props, {
|
|
592
|
+
color: token('color.icon.accent.gray')
|
|
593
|
+
}));
|
|
594
|
+
}
|
|
595
|
+
};
|
|
596
|
+
}) : import( /* webpackChunkName: "@atlaskit-internal_glyphTrivial" */'../common/ui/icons/priority-trivial-icon');
|
|
516
597
|
}
|
|
517
598
|
});
|
|
518
599
|
};
|
|
@@ -33,6 +33,7 @@ var Carousel = function Carousel(_ref) {
|
|
|
33
33
|
_ref$initialSlideInde = _ref.initialSlideIndex,
|
|
34
34
|
initialSlideIndex = _ref$initialSlideInde === void 0 ? 0 : _ref$initialSlideInde,
|
|
35
35
|
items = _ref.items,
|
|
36
|
+
onNextClick = _ref.onNextClick,
|
|
36
37
|
onPrimaryButtonClick = _ref.onPrimaryButtonClick,
|
|
37
38
|
primaryButtonLabel = _ref.primaryButtonLabel,
|
|
38
39
|
_ref$testId = _ref.testId,
|
|
@@ -73,10 +74,11 @@ var Carousel = function Carousel(_ref) {
|
|
|
73
74
|
}, []);
|
|
74
75
|
var goNext = useCallback(function () {
|
|
75
76
|
hasNavigated.current = true;
|
|
77
|
+
onNextClick === null || onNextClick === void 0 || onNextClick(items[activeIndex].id);
|
|
76
78
|
setActiveIndex(function (current) {
|
|
77
79
|
return (current + 1) % items.length;
|
|
78
80
|
});
|
|
79
|
-
}, [items
|
|
81
|
+
}, [items, activeIndex, onNextClick]);
|
|
80
82
|
var goPrev = useCallback(function () {
|
|
81
83
|
hasNavigated.current = true;
|
|
82
84
|
setActiveIndex(function (current) {
|
|
@@ -90,6 +92,9 @@ var Carousel = function Carousel(_ref) {
|
|
|
90
92
|
hasNavigated.current = true;
|
|
91
93
|
setActiveIndex(index);
|
|
92
94
|
}, [activeIndex]);
|
|
95
|
+
var handlePrimaryButtonClick = useCallback(function () {
|
|
96
|
+
onPrimaryButtonClick === null || onPrimaryButtonClick === void 0 || onPrimaryButtonClick(items[activeIndex].id);
|
|
97
|
+
}, [onPrimaryButtonClick, items, activeIndex]);
|
|
93
98
|
var currentSlide = items[activeIndex];
|
|
94
99
|
var isFirstSlide = activeIndex === 0;
|
|
95
100
|
var isLastSlide = activeIndex === items.length - 1;
|
|
@@ -108,7 +113,7 @@ var Carousel = function Carousel(_ref) {
|
|
|
108
113
|
iconLabel: iconLabel,
|
|
109
114
|
image: currentSlide.image,
|
|
110
115
|
title: currentSlide.title,
|
|
111
|
-
onPrimaryButtonClick: onPrimaryButtonClick,
|
|
116
|
+
onPrimaryButtonClick: onPrimaryButtonClick ? handlePrimaryButtonClick : undefined,
|
|
112
117
|
onBackClick: !isFirstSlide ? goPrev : undefined,
|
|
113
118
|
onDotClick: goTo,
|
|
114
119
|
onNextClick: !isLastSlide ? goNext : undefined,
|