@atlaskit/smart-card 46.10.2 → 46.10.3
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 +12 -0
- package/analytics.spec.yaml +2 -39
- package/compass.yml +3 -0
- package/dist/cjs/messages.js +15 -45
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/index.js +1 -9
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.js +14 -5
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-dropdown-item/index.js +4 -1
- package/dist/cjs/view/FlexibleCard/components/actions/action/index.js +1 -0
- package/dist/cjs/view/FlexibleCard/components/actions/preview-action/index.js +13 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/messages.js +15 -57
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/index.js +1 -9
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/index.js +12 -5
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-dropdown-item/index.js +3 -0
- package/dist/es2019/view/FlexibleCard/components/actions/action/index.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/actions/preview-action/index.js +13 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/messages.js +15 -45
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/EmbedCard/views/unauthorized-view/index.js +1 -9
- package/dist/esm/view/FlexibleCard/components/actions/action/action-button/index.js +14 -5
- package/dist/esm/view/FlexibleCard/components/actions/action/action-dropdown-item/index.js +4 -1
- package/dist/esm/view/FlexibleCard/components/actions/action/index.js +1 -0
- package/dist/esm/view/FlexibleCard/components/actions/preview-action/index.js +13 -2
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/common/analytics/generated/analytics.types.d.ts +1 -17
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/view/EmbedCard/views/unauthorized-view/index.d.ts +2 -2
- package/dist/types/view/FlexibleCard/components/actions/action/action-dropdown-item/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/actions/action/action-dropdown-item/types.d.ts +1 -0
- package/package.json +5 -5
- package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-dropbox-in-atlas-slide1--default.png +0 -3
- package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide1--default.png +0 -3
- package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide2--default.png +0 -3
- package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide3--default.png +0 -3
- package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide1--default.png +0 -3
- package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide2--default.png +0 -3
- package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide3--default.png +0 -3
- package/dist/cjs/view/EmbedCard/components/carousel/CarouselSlide.compiled.css +0 -64
- package/dist/cjs/view/EmbedCard/components/carousel/CarouselSlide.js +0 -158
- package/dist/cjs/view/EmbedCard/components/carousel/index.compiled.css +0 -12
- package/dist/cjs/view/EmbedCard/components/carousel/index.js +0 -127
- package/dist/cjs/view/EmbedCard/components/carousel/types.js +0 -5
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/UnauthorizedCarouselView.js +0 -207
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/carousel-images/IconSlot.compiled.css +0 -7
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/carousel-images/IconSlot.js +0 -31
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/carousel-images/LazyRovoChatBenefitImage.js +0 -16
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/carousel-images/LazyRovoSearchBenefitImage.js +0 -16
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/carousel-images/NoAuthAvailableImage.compiled.css +0 -6
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/carousel-images/NoAuthAvailableImage.js +0 -22
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/carousel-images/ProductIcon.js +0 -47
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/carousel-images/RovoChatBenefitImage.js +0 -359
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/carousel-images/RovoSearchBenefitImage.js +0 -281
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/carousel-images/SmartLinkBenefitImage.js +0 -364
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/carousel-images/assets/rovo-chat-avatar.png +0 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-dropbox-in-atlas-slide1--default.png +0 -3
- package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide1--default.png +0 -3
- package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide2--default.png +0 -3
- package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide3--default.png +0 -3
- package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide1--default.png +0 -3
- package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide2--default.png +0 -3
- package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide3--default.png +0 -3
- package/dist/es2019/view/EmbedCard/components/carousel/CarouselSlide.compiled.css +0 -64
- package/dist/es2019/view/EmbedCard/components/carousel/CarouselSlide.js +0 -145
- package/dist/es2019/view/EmbedCard/components/carousel/index.compiled.css +0 -12
- package/dist/es2019/view/EmbedCard/components/carousel/index.js +0 -105
- package/dist/es2019/view/EmbedCard/components/carousel/types.js +0 -1
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/UnauthorizedCarouselView.js +0 -200
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/carousel-images/IconSlot.compiled.css +0 -7
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/carousel-images/IconSlot.js +0 -25
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/carousel-images/LazyRovoChatBenefitImage.js +0 -3
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/carousel-images/LazyRovoSearchBenefitImage.js +0 -3
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/carousel-images/NoAuthAvailableImage.compiled.css +0 -6
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/carousel-images/NoAuthAvailableImage.js +0 -13
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/carousel-images/ProductIcon.js +0 -40
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/carousel-images/RovoChatBenefitImage.js +0 -353
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/carousel-images/RovoSearchBenefitImage.js +0 -269
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/carousel-images/SmartLinkBenefitImage.js +0 -358
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/carousel-images/assets/rovo-chat-avatar.png +0 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-dropbox-in-atlas-slide1--default.png +0 -3
- package/dist/esm/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide1--default.png +0 -3
- package/dist/esm/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide2--default.png +0 -3
- package/dist/esm/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide3--default.png +0 -3
- package/dist/esm/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide1--default.png +0 -3
- package/dist/esm/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide2--default.png +0 -3
- package/dist/esm/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide3--default.png +0 -3
- package/dist/esm/view/EmbedCard/components/carousel/CarouselSlide.compiled.css +0 -64
- package/dist/esm/view/EmbedCard/components/carousel/CarouselSlide.js +0 -149
- package/dist/esm/view/EmbedCard/components/carousel/index.compiled.css +0 -12
- package/dist/esm/view/EmbedCard/components/carousel/index.js +0 -118
- package/dist/esm/view/EmbedCard/components/carousel/types.js +0 -1
- package/dist/esm/view/EmbedCard/views/unauthorized-view/UnauthorizedCarouselView.js +0 -198
- package/dist/esm/view/EmbedCard/views/unauthorized-view/carousel-images/IconSlot.compiled.css +0 -7
- package/dist/esm/view/EmbedCard/views/unauthorized-view/carousel-images/IconSlot.js +0 -24
- package/dist/esm/view/EmbedCard/views/unauthorized-view/carousel-images/LazyRovoChatBenefitImage.js +0 -5
- package/dist/esm/view/EmbedCard/views/unauthorized-view/carousel-images/LazyRovoSearchBenefitImage.js +0 -5
- package/dist/esm/view/EmbedCard/views/unauthorized-view/carousel-images/NoAuthAvailableImage.compiled.css +0 -6
- package/dist/esm/view/EmbedCard/views/unauthorized-view/carousel-images/NoAuthAvailableImage.js +0 -15
- package/dist/esm/view/EmbedCard/views/unauthorized-view/carousel-images/ProductIcon.js +0 -40
- package/dist/esm/view/EmbedCard/views/unauthorized-view/carousel-images/RovoChatBenefitImage.js +0 -352
- package/dist/esm/view/EmbedCard/views/unauthorized-view/carousel-images/RovoSearchBenefitImage.js +0 -274
- package/dist/esm/view/EmbedCard/views/unauthorized-view/carousel-images/SmartLinkBenefitImage.js +0 -357
- package/dist/esm/view/EmbedCard/views/unauthorized-view/carousel-images/assets/rovo-chat-avatar.png +0 -0
- package/dist/types/view/EmbedCard/components/carousel/CarouselSlide.d.ts +0 -39
- package/dist/types/view/EmbedCard/components/carousel/index.d.ts +0 -26
- package/dist/types/view/EmbedCard/components/carousel/types.d.ts +0 -32
- package/dist/types/view/EmbedCard/views/unauthorized-view/UnauthorizedCarouselView.d.ts +0 -4
- package/dist/types/view/EmbedCard/views/unauthorized-view/carousel-images/IconSlot.d.ts +0 -14
- package/dist/types/view/EmbedCard/views/unauthorized-view/carousel-images/LazyRovoChatBenefitImage.d.ts +0 -3
- package/dist/types/view/EmbedCard/views/unauthorized-view/carousel-images/LazyRovoSearchBenefitImage.d.ts +0 -3
- package/dist/types/view/EmbedCard/views/unauthorized-view/carousel-images/NoAuthAvailableImage.d.ts +0 -7
- package/dist/types/view/EmbedCard/views/unauthorized-view/carousel-images/ProductIcon.d.ts +0 -9
- package/dist/types/view/EmbedCard/views/unauthorized-view/carousel-images/RovoChatBenefitImage.d.ts +0 -8
- package/dist/types/view/EmbedCard/views/unauthorized-view/carousel-images/RovoSearchBenefitImage.d.ts +0 -8
- package/dist/types/view/EmbedCard/views/unauthorized-view/carousel-images/SmartLinkBenefitImage.d.ts +0 -7
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
import "./index.compiled.css";
|
|
4
|
-
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
-
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
6
|
-
import { Box } from '@atlaskit/primitives/compiled/box';
|
|
7
|
-
import CarouselSlide from './CarouselSlide';
|
|
8
|
-
var styles = {
|
|
9
|
-
carousel: "_1reo15vq _18m915vq _1e0c1txw _1bsb1osq _4t3i1osq _kqswh2mm"
|
|
10
|
-
};
|
|
11
|
-
var fadeIn = null;
|
|
12
|
-
var slideWrapperMap = {
|
|
13
|
-
static: "_1bsb1osq _4t3i1osq",
|
|
14
|
-
animated: "_1bsb1osq _4t3i1osq _j7hq1wwu _5sagjx92 _1pglafbj _1o511hrf _bl8aglyw _2hwzhgkh"
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Derives layout size bucket from pixel dimensions.
|
|
18
|
-
* Used instead of CSS @container queries (which are blocked by the linter)
|
|
19
|
-
* to control which elements are shown at different card sizes.
|
|
20
|
-
*/
|
|
21
|
-
var getSize = function getSize(width, height) {
|
|
22
|
-
if (width < 200 || height < 100) {
|
|
23
|
-
return 'minimal';
|
|
24
|
-
}
|
|
25
|
-
if (width < 400 || height < 140) {
|
|
26
|
-
return 'compact';
|
|
27
|
-
}
|
|
28
|
-
return 'full';
|
|
29
|
-
};
|
|
30
|
-
var Carousel = function Carousel(_ref) {
|
|
31
|
-
var icon = _ref.icon,
|
|
32
|
-
iconLabel = _ref.iconLabel,
|
|
33
|
-
_ref$initialSlideInde = _ref.initialSlideIndex,
|
|
34
|
-
initialSlideIndex = _ref$initialSlideInde === void 0 ? 0 : _ref$initialSlideInde,
|
|
35
|
-
items = _ref.items,
|
|
36
|
-
onNextClick = _ref.onNextClick,
|
|
37
|
-
onPrimaryButtonClick = _ref.onPrimaryButtonClick,
|
|
38
|
-
primaryButtonLabel = _ref.primaryButtonLabel,
|
|
39
|
-
_ref$testId = _ref.testId,
|
|
40
|
-
testId = _ref$testId === void 0 ? 'embed-card-teaser-carousel' : _ref$testId;
|
|
41
|
-
var _useState = useState(initialSlideIndex),
|
|
42
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
43
|
-
activeIndex = _useState2[0],
|
|
44
|
-
setActiveIndex = _useState2[1];
|
|
45
|
-
var _useState3 = useState('full'),
|
|
46
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
47
|
-
size = _useState4[0],
|
|
48
|
-
setSize = _useState4[1];
|
|
49
|
-
|
|
50
|
-
// Tracks whether the user has navigated at least once.
|
|
51
|
-
// The first slide is rendered statically (no animation) to avoid any
|
|
52
|
-
// CSS animation running during SSR or on the initial paint.
|
|
53
|
-
var hasNavigated = useRef(false);
|
|
54
|
-
var containerRef = useRef(null);
|
|
55
|
-
|
|
56
|
-
// Observe the carousel container's size and update the layout bucket.
|
|
57
|
-
useEffect(function () {
|
|
58
|
-
var el = containerRef.current;
|
|
59
|
-
if (!el) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
var observer = new ResizeObserver(function (_ref2) {
|
|
63
|
-
var _ref3 = _slicedToArray(_ref2, 1),
|
|
64
|
-
entry = _ref3[0];
|
|
65
|
-
var _entry$contentRect = entry.contentRect,
|
|
66
|
-
width = _entry$contentRect.width,
|
|
67
|
-
height = _entry$contentRect.height;
|
|
68
|
-
setSize(getSize(width, height));
|
|
69
|
-
});
|
|
70
|
-
observer.observe(el);
|
|
71
|
-
return function () {
|
|
72
|
-
return observer.disconnect();
|
|
73
|
-
};
|
|
74
|
-
}, []);
|
|
75
|
-
var goNext = useCallback(function () {
|
|
76
|
-
hasNavigated.current = true;
|
|
77
|
-
onNextClick === null || onNextClick === void 0 || onNextClick(items[activeIndex].id);
|
|
78
|
-
setActiveIndex(function (current) {
|
|
79
|
-
return (current + 1) % items.length;
|
|
80
|
-
});
|
|
81
|
-
}, [items, activeIndex, onNextClick]);
|
|
82
|
-
var goTo = useCallback(function (index) {
|
|
83
|
-
if (index === activeIndex) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
hasNavigated.current = true;
|
|
87
|
-
setActiveIndex(index);
|
|
88
|
-
}, [activeIndex]);
|
|
89
|
-
var handlePrimaryButtonClick = useCallback(function () {
|
|
90
|
-
onPrimaryButtonClick === null || onPrimaryButtonClick === void 0 || onPrimaryButtonClick(items[activeIndex].id);
|
|
91
|
-
}, [onPrimaryButtonClick, items, activeIndex]);
|
|
92
|
-
var currentSlide = items[activeIndex];
|
|
93
|
-
var isLastSlide = activeIndex === items.length - 1;
|
|
94
|
-
return /*#__PURE__*/React.createElement(Box, {
|
|
95
|
-
ref: containerRef,
|
|
96
|
-
xcss: styles.carousel,
|
|
97
|
-
testId: testId
|
|
98
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
99
|
-
key: activeIndex,
|
|
100
|
-
xcss: slideWrapperMap[hasNavigated.current ? 'animated' : 'static'],
|
|
101
|
-
"aria-live": "polite"
|
|
102
|
-
}, /*#__PURE__*/React.createElement(CarouselSlide, {
|
|
103
|
-
primaryButtonLabel: primaryButtonLabel,
|
|
104
|
-
description: currentSlide.description,
|
|
105
|
-
icon: icon,
|
|
106
|
-
iconLabel: iconLabel,
|
|
107
|
-
image: currentSlide.image,
|
|
108
|
-
title: currentSlide.title,
|
|
109
|
-
onPrimaryButtonClick: onPrimaryButtonClick ? handlePrimaryButtonClick : undefined,
|
|
110
|
-
onDotClick: goTo,
|
|
111
|
-
onNextClick: !isLastSlide ? goNext : undefined,
|
|
112
|
-
size: size,
|
|
113
|
-
slideIndex: activeIndex,
|
|
114
|
-
testId: "".concat(testId, "-slide"),
|
|
115
|
-
totalSlides: items.length
|
|
116
|
-
})));
|
|
117
|
-
};
|
|
118
|
-
export default Carousel;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import React, { Suspense, useCallback, useMemo } from 'react';
|
|
2
|
-
import { useIntl } from 'react-intl';
|
|
3
|
-
import { di } from 'react-magnetic-di';
|
|
4
|
-
import LinkGlyph from '@atlaskit/icon/core/link';
|
|
5
|
-
import SmartLinkIcon from '@atlaskit/icon/core/smart-link';
|
|
6
|
-
import IconTile from '@atlaskit/icon/icon-tile';
|
|
7
|
-
import Image from '@atlaskit/image/image';
|
|
8
|
-
import { useAnalyticsEvents } from '../../../../common/analytics/generated/use-analytics-events';
|
|
9
|
-
import { messages } from '../../../../messages';
|
|
10
|
-
import useRovoConfig from '../../../../state/hooks/use-rovo-config';
|
|
11
|
-
import Carousel from '../../components/carousel';
|
|
12
|
-
import { ExpandedFrame } from '../../components/ExpandedFrame';
|
|
13
|
-
import { ImageIcon } from '../../components/ImageIcon';
|
|
14
|
-
import LazyRovoChatBenefitImage from './carousel-images/LazyRovoChatBenefitImage';
|
|
15
|
-
import LazyRovoSearchBenefitImage from './carousel-images/LazyRovoSearchBenefitImage';
|
|
16
|
-
import NoAuthAvailableImage from './carousel-images/NoAuthAvailableImage';
|
|
17
|
-
import ProductIcon from './carousel-images/ProductIcon';
|
|
18
|
-
import SmartLinkBenefitImage from './carousel-images/SmartLinkBenefitImage';
|
|
19
|
-
var PARENT_PRODUCT = {
|
|
20
|
-
ATLAS: 'ATLAS',
|
|
21
|
-
BITBUCKET: 'BITBUCKET',
|
|
22
|
-
CONFLUENCE: 'CONFLUENCE',
|
|
23
|
-
CSM: 'JIRA',
|
|
24
|
-
JPD: 'JIRA',
|
|
25
|
-
JSM: 'JIRA',
|
|
26
|
-
JSW: 'JIRA',
|
|
27
|
-
JWM: 'JIRA',
|
|
28
|
-
TRELLO: 'TRELLO'
|
|
29
|
-
};
|
|
30
|
-
var PRODUCT_COMPANION = {
|
|
31
|
-
ATLAS: 'ATLAS',
|
|
32
|
-
BITBUCKET: 'BITBUCKET',
|
|
33
|
-
CONFLUENCE: 'JIRA',
|
|
34
|
-
JIRA: 'CONFLUENCE',
|
|
35
|
-
TRELLO: 'TRELLO'
|
|
36
|
-
};
|
|
37
|
-
var UnauthorizedCarouselView = function UnauthorizedCarouselView(_ref) {
|
|
38
|
-
var context = _ref.context,
|
|
39
|
-
frameStyle = _ref.frameStyle,
|
|
40
|
-
inheritDimensions = _ref.inheritDimensions,
|
|
41
|
-
isSelected = _ref.isSelected,
|
|
42
|
-
onAuthorize = _ref.onAuthorize,
|
|
43
|
-
onClick = _ref.onClick,
|
|
44
|
-
_ref$testId = _ref.testId,
|
|
45
|
-
testId = _ref$testId === void 0 ? 'embed-card-unauthorized-view' : _ref$testId,
|
|
46
|
-
url = _ref.url;
|
|
47
|
-
var intl = useIntl();
|
|
48
|
-
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
49
|
-
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
50
|
-
var _useRovoConfig = useRovoConfig(),
|
|
51
|
-
rovoOptions = _useRovoConfig.rovoOptions,
|
|
52
|
-
product = _useRovoConfig.product;
|
|
53
|
-
var canAuthorize = typeof onAuthorize === 'function';
|
|
54
|
-
var providerName = context === null || context === void 0 ? void 0 : context.text;
|
|
55
|
-
var providerIcon = useMemo(function () {
|
|
56
|
-
var _ref2, _context$iconLabel;
|
|
57
|
-
var iconLabel = (_ref2 = (_context$iconLabel = context === null || context === void 0 ? void 0 : context.iconLabel) !== null && _context$iconLabel !== void 0 ? _context$iconLabel : context === null || context === void 0 ? void 0 : context.text) !== null && _ref2 !== void 0 ? _ref2 : '';
|
|
58
|
-
if (typeof (context === null || context === void 0 ? void 0 : context.icon) === 'string') {
|
|
59
|
-
return /*#__PURE__*/React.createElement(Image, {
|
|
60
|
-
src: context.icon,
|
|
61
|
-
alt: iconLabel
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
if (context !== null && context !== void 0 && context.icon) {
|
|
65
|
-
return context.icon;
|
|
66
|
-
}
|
|
67
|
-
return /*#__PURE__*/React.createElement(IconTile, {
|
|
68
|
-
appearance: "blue",
|
|
69
|
-
icon: SmartLinkIcon,
|
|
70
|
-
label: iconLabel,
|
|
71
|
-
size: "small",
|
|
72
|
-
testId: "embed-card-fallback-icon"
|
|
73
|
-
});
|
|
74
|
-
}, [context]);
|
|
75
|
-
var items = useMemo(function () {
|
|
76
|
-
if (!canAuthorize) {
|
|
77
|
-
return [{
|
|
78
|
-
id: 'no-auth-available',
|
|
79
|
-
title: intl.formatMessage(messages.unauthorised_account_name_no_provider),
|
|
80
|
-
description: intl.formatMessage(messages.unauthorised_account_description_no_provider),
|
|
81
|
-
image: /*#__PURE__*/React.createElement(NoAuthAvailableImage, null)
|
|
82
|
-
}];
|
|
83
|
-
}
|
|
84
|
-
var parentProduct = product ? PARENT_PRODUCT[product] : undefined;
|
|
85
|
-
var parentProductIcon = /*#__PURE__*/React.createElement(ProductIcon, {
|
|
86
|
-
product: parentProduct
|
|
87
|
-
});
|
|
88
|
-
var parentProductAlt = parentProduct ? PRODUCT_COMPANION[parentProduct] : parentProduct;
|
|
89
|
-
var parentProductIconAlt = /*#__PURE__*/React.createElement(ProductIcon, {
|
|
90
|
-
product: parentProductAlt
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
// We only have special text for Google Drive and i18n select takes only one word (no space).
|
|
94
|
-
var i18nSelectContext = (context === null || context === void 0 ? void 0 : context.text) === 'Google Drive' ? 'Google' : context === null || context === void 0 ? void 0 : context.text;
|
|
95
|
-
var slides = [{
|
|
96
|
-
id: 'smart-link-benefit',
|
|
97
|
-
title: intl.formatMessage(messages.connect_link_account_embed_carousel_sl_title),
|
|
98
|
-
description: intl.formatMessage(messages.connect_link_account_embed_carousel_sl_description, {
|
|
99
|
-
context: i18nSelectContext,
|
|
100
|
-
product: parentProduct
|
|
101
|
-
}),
|
|
102
|
-
image: /*#__PURE__*/React.createElement(SmartLinkBenefitImage, {
|
|
103
|
-
productIcon: parentProductIcon,
|
|
104
|
-
providerIcon: providerIcon
|
|
105
|
-
})
|
|
106
|
-
}];
|
|
107
|
-
|
|
108
|
-
// If the link has an unauthorized status and provides an onAuthorize callback,
|
|
109
|
-
// it is likely a 3P (third-party) link and is supported by Rovo. In that case,
|
|
110
|
-
// we show additional Rovo-specific teaser slides to encourage the user to connect their account.
|
|
111
|
-
if (rovoOptions !== null && rovoOptions !== void 0 && rovoOptions.isRovoEnabled) {
|
|
112
|
-
slides.push({
|
|
113
|
-
id: 'rovo-search-benefit',
|
|
114
|
-
title: intl.formatMessage(messages.connect_link_account_embed_carousel_rovo_title),
|
|
115
|
-
description: intl.formatMessage(messages.connect_link_account_embed_carousel_rovo_description, {
|
|
116
|
-
context: providerName,
|
|
117
|
-
product: parentProduct
|
|
118
|
-
}),
|
|
119
|
-
image: /*#__PURE__*/React.createElement(Suspense, {
|
|
120
|
-
fallback: null
|
|
121
|
-
}, /*#__PURE__*/React.createElement(LazyRovoSearchBenefitImage, {
|
|
122
|
-
productIcon: parentProductIcon,
|
|
123
|
-
productIconAlt: parentProductIconAlt,
|
|
124
|
-
providerIcon: providerIcon
|
|
125
|
-
}))
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
if (rovoOptions !== null && rovoOptions !== void 0 && rovoOptions.isRovoEnabled && rovoOptions !== null && rovoOptions !== void 0 && rovoOptions.isRovoLLMEnabled) {
|
|
129
|
-
slides.push({
|
|
130
|
-
id: 'rovo-chat-benefit',
|
|
131
|
-
title: intl.formatMessage(messages.connect_link_account_embed_carousel_rovochat_title),
|
|
132
|
-
description: intl.formatMessage(messages.connect_link_account_embed_carousel_rovochat_description, {
|
|
133
|
-
context: providerName
|
|
134
|
-
}),
|
|
135
|
-
image: /*#__PURE__*/React.createElement(Suspense, {
|
|
136
|
-
fallback: null
|
|
137
|
-
}, /*#__PURE__*/React.createElement(LazyRovoChatBenefitImage, {
|
|
138
|
-
productIcon: parentProductIcon,
|
|
139
|
-
productIconAlt: parentProductIconAlt,
|
|
140
|
-
providerIcon: providerIcon
|
|
141
|
-
}))
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
return slides;
|
|
145
|
-
}, [canAuthorize, context, intl, product, providerName, providerIcon, rovoOptions]);
|
|
146
|
-
var handleOnAuthorizeClick = useCallback(function (slideId) {
|
|
147
|
-
if (onAuthorize) {
|
|
148
|
-
fireEvent('track.applicationAccount.authStarted', {});
|
|
149
|
-
fireEvent('ui.button.clicked.carouselConnect', {
|
|
150
|
-
display: 'embed',
|
|
151
|
-
slideId: slideId
|
|
152
|
-
});
|
|
153
|
-
onAuthorize();
|
|
154
|
-
}
|
|
155
|
-
}, [onAuthorize, fireEvent]);
|
|
156
|
-
var handleOnNextClick = useCallback(function (slideId) {
|
|
157
|
-
fireEvent('ui.button.clicked.carouselNext', {
|
|
158
|
-
display: 'embed',
|
|
159
|
-
slideId: slideId
|
|
160
|
-
});
|
|
161
|
-
}, [fireEvent]);
|
|
162
|
-
var buttonLabel = context !== null && context !== void 0 && context.text ? intl.formatMessage(messages.connect_3p_account, {
|
|
163
|
-
context: context.text
|
|
164
|
-
}) : intl.formatMessage(messages.connect_link_account_card);
|
|
165
|
-
var icon = useMemo(function () {
|
|
166
|
-
if ( /*#__PURE__*/React.isValidElement(context === null || context === void 0 ? void 0 : context.icon)) {
|
|
167
|
-
return context.icon;
|
|
168
|
-
}
|
|
169
|
-
return /*#__PURE__*/React.createElement(ImageIcon, {
|
|
170
|
-
default: /*#__PURE__*/React.createElement(LinkGlyph, {
|
|
171
|
-
label: "icon",
|
|
172
|
-
color: "currentColor"
|
|
173
|
-
}),
|
|
174
|
-
src: typeof (context === null || context === void 0 ? void 0 : context.icon) === 'string' ? context.icon : undefined
|
|
175
|
-
});
|
|
176
|
-
}, [context === null || context === void 0 ? void 0 : context.icon]);
|
|
177
|
-
return /*#__PURE__*/React.createElement(ExpandedFrame, {
|
|
178
|
-
allowScrollBar: true,
|
|
179
|
-
frameStyle: frameStyle !== null && frameStyle !== void 0 ? frameStyle : 'show',
|
|
180
|
-
href: url,
|
|
181
|
-
icon: icon,
|
|
182
|
-
isSelected: isSelected,
|
|
183
|
-
inheritDimensions: inheritDimensions,
|
|
184
|
-
onClick: onClick,
|
|
185
|
-
setOverflow: true,
|
|
186
|
-
testId: testId,
|
|
187
|
-
text: context === null || context === void 0 ? void 0 : context.text
|
|
188
|
-
}, /*#__PURE__*/React.createElement(Carousel, {
|
|
189
|
-
icon: context === null || context === void 0 ? void 0 : context.icon,
|
|
190
|
-
iconLabel: context === null || context === void 0 ? void 0 : context.text,
|
|
191
|
-
items: items,
|
|
192
|
-
onNextClick: handleOnNextClick,
|
|
193
|
-
onPrimaryButtonClick: canAuthorize ? handleOnAuthorizeClick : undefined,
|
|
194
|
-
primaryButtonLabel: buttonLabel,
|
|
195
|
-
testId: "".concat(testId, "-carousel")
|
|
196
|
-
}));
|
|
197
|
-
};
|
|
198
|
-
export default UnauthorizedCarouselView;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/* IconSlot.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
-
import "./IconSlot.compiled.css";
|
|
3
|
-
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import React from 'react';
|
|
5
|
-
var iconSlotDivStyles = null;
|
|
6
|
-
var IconSlot = function IconSlot(_ref) {
|
|
7
|
-
var icon = _ref.icon,
|
|
8
|
-
x = _ref.x,
|
|
9
|
-
y = _ref.y,
|
|
10
|
-
w = _ref.w,
|
|
11
|
-
h = _ref.h;
|
|
12
|
-
if (!icon) {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
return /*#__PURE__*/React.createElement("foreignObject", {
|
|
16
|
-
x: x,
|
|
17
|
-
y: y,
|
|
18
|
-
width: w,
|
|
19
|
-
height: h
|
|
20
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
21
|
-
className: ax(["_2rko12b0 _1reo15vq _18m915vq _1bsb1osq _4t3i1osq _1e0c1txw _4cvr1h6o _1bah1h6o"])
|
|
22
|
-
}, icon));
|
|
23
|
-
};
|
|
24
|
-
export default IconSlot;
|
package/dist/esm/view/EmbedCard/views/unauthorized-view/carousel-images/NoAuthAvailableImage.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/* NoAuthAvailableImage.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
-
import "./NoAuthAvailableImage.compiled.css";
|
|
3
|
-
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { Box } from '@atlaskit/primitives/compiled/box';
|
|
6
|
-
import { UnauthorizedSVG } from '../unauthorized-svg';
|
|
7
|
-
var styles = {
|
|
8
|
-
container: "_1bsb1osq _1e0c1txw _4cvr1h6o _1bah1h6o _ca0q1ejb _n3td1ejb"
|
|
9
|
-
};
|
|
10
|
-
var NoAuthAvailableImage = function NoAuthAvailableImage() {
|
|
11
|
-
return /*#__PURE__*/React.createElement(Box, {
|
|
12
|
-
xcss: styles.container
|
|
13
|
-
}, /*#__PURE__*/React.createElement(UnauthorizedSVG, null));
|
|
14
|
-
};
|
|
15
|
-
export default NoAuthAvailableImage;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AtlassianIcon } from '@atlaskit/logo/atlassian-icon';
|
|
3
|
-
import { BitbucketIcon } from '@atlaskit/logo/bitbucket-icon';
|
|
4
|
-
import { ConfluenceIcon } from '@atlaskit/logo/confluence-icon';
|
|
5
|
-
import { JiraIcon } from '@atlaskit/logo/jira-icon';
|
|
6
|
-
import { ProjectsIcon } from '@atlaskit/logo/projects/icon';
|
|
7
|
-
import { TrelloIcon } from '@atlaskit/logo/trello-icon';
|
|
8
|
-
var ProductIcon = function ProductIcon(_ref) {
|
|
9
|
-
var product = _ref.product,
|
|
10
|
-
_ref$size = _ref.size,
|
|
11
|
-
size = _ref$size === void 0 ? 'xsmall' : _ref$size;
|
|
12
|
-
switch (product) {
|
|
13
|
-
case 'ATLAS':
|
|
14
|
-
return /*#__PURE__*/React.createElement(ProjectsIcon, {
|
|
15
|
-
size: size
|
|
16
|
-
});
|
|
17
|
-
case 'BITBUCKET':
|
|
18
|
-
return /*#__PURE__*/React.createElement(BitbucketIcon, {
|
|
19
|
-
size: size
|
|
20
|
-
});
|
|
21
|
-
case 'CONFLUENCE':
|
|
22
|
-
return /*#__PURE__*/React.createElement(ConfluenceIcon, {
|
|
23
|
-
size: size
|
|
24
|
-
});
|
|
25
|
-
case 'JIRA':
|
|
26
|
-
return /*#__PURE__*/React.createElement(JiraIcon, {
|
|
27
|
-
size: size
|
|
28
|
-
});
|
|
29
|
-
case 'TRELLO':
|
|
30
|
-
return /*#__PURE__*/React.createElement(TrelloIcon, {
|
|
31
|
-
size: size
|
|
32
|
-
});
|
|
33
|
-
default:
|
|
34
|
-
return /*#__PURE__*/React.createElement(AtlassianIcon, {
|
|
35
|
-
appearance: "brand",
|
|
36
|
-
size: size
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
export default ProductIcon;
|