@atlaskit/smart-card 46.10.2 → 46.10.4

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