@atlaskit/smart-card 45.11.2 → 45.12.1
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 +54 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide1--default.png +3 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide2--default.png +3 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide3--default.png +3 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide1--default.png +3 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide2--default.png +3 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide3--default.png +3 -0
- package/dist/cjs/messages.js +35 -25
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/analytics/click.js +4 -69
- package/dist/cjs/view/EmbedCard/components/carousel/CarouselSlide.compiled.css +16 -4
- package/dist/cjs/view/EmbedCard/components/carousel/CarouselSlide.js +67 -27
- package/dist/cjs/view/EmbedCard/components/carousel/index.compiled.css +2 -2
- package/dist/cjs/view/EmbedCard/components/carousel/index.js +13 -5
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/UnauthorizedCarouselView.js +191 -0
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/carousel-images/IconSlot.compiled.css +7 -0
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/carousel-images/IconSlot.js +31 -0
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/carousel-images/LazyRovoChatBenefitImage.js +16 -0
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/carousel-images/LazyRovoSearchBenefitImage.js +16 -0
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/carousel-images/NoAuthAvailableImage.compiled.css +6 -0
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/carousel-images/NoAuthAvailableImage.js +22 -0
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/carousel-images/ProductIcon.js +47 -0
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/carousel-images/RovoChatBenefitImage.js +359 -0
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/carousel-images/RovoSearchBenefitImage.js +281 -0
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/carousel-images/SmartLinkBenefitImage.js +502 -0
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/carousel-images/assets/rovo-chat-avatar.png +0 -0
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/index.js +9 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide1--default.png +3 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide2--default.png +3 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide3--default.png +3 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide1--default.png +3 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide2--default.png +3 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide3--default.png +3 -0
- package/dist/es2019/messages.js +49 -27
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/analytics/click.js +3 -66
- package/dist/es2019/view/EmbedCard/components/carousel/CarouselSlide.compiled.css +16 -4
- package/dist/es2019/view/EmbedCard/components/carousel/CarouselSlide.js +64 -27
- package/dist/es2019/view/EmbedCard/components/carousel/index.compiled.css +2 -2
- package/dist/es2019/view/EmbedCard/components/carousel/index.js +10 -5
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/UnauthorizedCarouselView.js +184 -0
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/carousel-images/IconSlot.compiled.css +7 -0
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/carousel-images/IconSlot.js +25 -0
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/carousel-images/LazyRovoChatBenefitImage.js +3 -0
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/carousel-images/LazyRovoSearchBenefitImage.js +3 -0
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/carousel-images/NoAuthAvailableImage.compiled.css +6 -0
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/carousel-images/NoAuthAvailableImage.js +13 -0
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/carousel-images/ProductIcon.js +40 -0
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/carousel-images/RovoChatBenefitImage.js +352 -0
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/carousel-images/RovoSearchBenefitImage.js +268 -0
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/carousel-images/SmartLinkBenefitImage.js +495 -0
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/carousel-images/assets/rovo-chat-avatar.png +0 -0
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/index.js +9 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide1--default.png +3 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide2--default.png +3 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide3--default.png +3 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide1--default.png +3 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide2--default.png +3 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide3--default.png +3 -0
- package/dist/esm/messages.js +35 -25
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/analytics/click.js +3 -68
- package/dist/esm/view/EmbedCard/components/carousel/CarouselSlide.compiled.css +16 -4
- package/dist/esm/view/EmbedCard/components/carousel/CarouselSlide.js +65 -27
- package/dist/esm/view/EmbedCard/components/carousel/index.compiled.css +2 -2
- package/dist/esm/view/EmbedCard/components/carousel/index.js +13 -5
- package/dist/esm/view/EmbedCard/views/unauthorized-view/UnauthorizedCarouselView.js +182 -0
- package/dist/esm/view/EmbedCard/views/unauthorized-view/carousel-images/IconSlot.compiled.css +7 -0
- package/dist/esm/view/EmbedCard/views/unauthorized-view/carousel-images/IconSlot.js +24 -0
- package/dist/esm/view/EmbedCard/views/unauthorized-view/carousel-images/LazyRovoChatBenefitImage.js +5 -0
- package/dist/esm/view/EmbedCard/views/unauthorized-view/carousel-images/LazyRovoSearchBenefitImage.js +5 -0
- package/dist/esm/view/EmbedCard/views/unauthorized-view/carousel-images/NoAuthAvailableImage.compiled.css +6 -0
- package/dist/esm/view/EmbedCard/views/unauthorized-view/carousel-images/NoAuthAvailableImage.js +15 -0
- package/dist/esm/view/EmbedCard/views/unauthorized-view/carousel-images/ProductIcon.js +40 -0
- package/dist/esm/view/EmbedCard/views/unauthorized-view/carousel-images/RovoChatBenefitImage.js +351 -0
- package/dist/esm/view/EmbedCard/views/unauthorized-view/carousel-images/RovoSearchBenefitImage.js +273 -0
- package/dist/esm/view/EmbedCard/views/unauthorized-view/carousel-images/SmartLinkBenefitImage.js +494 -0
- package/dist/esm/view/EmbedCard/views/unauthorized-view/carousel-images/assets/rovo-chat-avatar.png +0 -0
- package/dist/esm/view/EmbedCard/views/unauthorized-view/index.js +9 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/utils/analytics/click.d.ts +0 -2
- package/dist/types/utils/analytics/types.d.ts +0 -5
- package/dist/types/view/EmbedCard/components/carousel/CarouselSlide.d.ts +3 -1
- package/dist/types/view/EmbedCard/components/carousel/index.d.ts +3 -1
- package/dist/types/view/EmbedCard/views/unauthorized-view/UnauthorizedCarouselView.d.ts +4 -0
- package/dist/types/view/EmbedCard/views/unauthorized-view/carousel-images/IconSlot.d.ts +14 -0
- package/dist/types/view/EmbedCard/views/unauthorized-view/carousel-images/LazyRovoChatBenefitImage.d.ts +3 -0
- package/dist/types/view/EmbedCard/views/unauthorized-view/carousel-images/LazyRovoSearchBenefitImage.d.ts +3 -0
- package/dist/types/view/EmbedCard/views/unauthorized-view/carousel-images/NoAuthAvailableImage.d.ts +7 -0
- package/dist/types/view/EmbedCard/views/unauthorized-view/carousel-images/ProductIcon.d.ts +9 -0
- package/dist/types/view/EmbedCard/views/unauthorized-view/carousel-images/RovoChatBenefitImage.d.ts +8 -0
- package/dist/types/view/EmbedCard/views/unauthorized-view/carousel-images/RovoSearchBenefitImage.d.ts +8 -0
- package/dist/types/view/EmbedCard/views/unauthorized-view/carousel-images/SmartLinkBenefitImage.d.ts +6 -0
- package/dist/types/view/EmbedCard/views/unauthorized-view/index.d.ts +2 -2
- package/dist/types/view/EmbedCard/views/unauthorized-view/types.d.ts +1 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,59 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 45.12.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`1ab0d112d17a5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1ab0d112d17a5) -
|
|
8
|
+
[ux] Add images for pre-auth embed experiment carousol
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 45.12.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [`103ecc1edeedc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/103ecc1edeedc) -
|
|
16
|
+
Remove Confluence short link metadata from smart link clicked analytics payloads.
|
|
17
|
+
|
|
18
|
+
This removes the temporary `isConfluenceShortLink` field that was added to support an
|
|
19
|
+
investigation into Confluence short link usage. The investigation is complete, and the smart link
|
|
20
|
+
clicked analytics payload now returns to its previous shape.
|
|
21
|
+
|
|
22
|
+
This also removes the temporary `smart_link_confluence_short_link_analytics` experiment from
|
|
23
|
+
`editorExperimentsConfig` and the generated experiment key types. Consumers that checked this
|
|
24
|
+
temporary experiment can remove that branch.
|
|
25
|
+
|
|
26
|
+
Before:
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
if (expValEquals('smart_link_confluence_short_link_analytics', 'cohort', 'test')) {
|
|
30
|
+
trackLinkClicked({ isConfluenceShortLink });
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
After:
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
trackLinkClicked();
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Before:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
const { isConfluenceShortLink, ...payload } = event;
|
|
44
|
+
sendAnalytics(payload, { isShortLink: isConfluenceShortLink });
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
After:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
sendAnalytics(event);
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- Updated dependencies
|
|
56
|
+
|
|
3
57
|
## 45.11.2
|
|
4
58
|
|
|
5
59
|
### Patch Changes
|
package/dist/cjs/messages.js
CHANGED
|
@@ -171,49 +171,54 @@ var messages = exports.messages = (0, _reactIntl.defineMessages)({
|
|
|
171
171
|
defaultMessage: 'To show a preview of this link, connect your {context} account.',
|
|
172
172
|
description: 'Shown when a user does not have access to a link, but can connect their external account to view the link on card view. Displayed in byline.'
|
|
173
173
|
},
|
|
174
|
-
|
|
175
|
-
id: 'fabric.linking.
|
|
174
|
+
connect_link_account_embed_carousel_dot_label: {
|
|
175
|
+
id: 'fabric.linking.connect_link_account_embed_carousel_dot_label.non-final',
|
|
176
176
|
defaultMessage: 'Go to slide {index} of {total}',
|
|
177
177
|
description: 'Accessible label for a dot indicator button in the teaser carousel, describing which slide it navigates to'
|
|
178
178
|
},
|
|
179
|
-
|
|
180
|
-
id: 'fabric.linking.
|
|
179
|
+
connect_link_account_embed_carousel_dot_row_label: {
|
|
180
|
+
id: 'fabric.linking.connect_link_account_embed_carousel_dot_row_label.non-final',
|
|
181
181
|
defaultMessage: 'Slides',
|
|
182
182
|
description: 'Accessible label for the group of dot indicator buttons in the teaser carousel'
|
|
183
183
|
},
|
|
184
|
-
|
|
185
|
-
id: 'fabric.linking.
|
|
184
|
+
connect_link_account_embed_carousel_button_back: {
|
|
185
|
+
id: 'fabric.linking.connect_link_account_embed_carousel_button_back.non-final',
|
|
186
|
+
defaultMessage: 'Back',
|
|
187
|
+
description: 'Label for the back button in the embed card carousel teaser'
|
|
188
|
+
},
|
|
189
|
+
connect_link_account_embed_carousel_button_next: {
|
|
190
|
+
id: 'fabric.linking.connect_link_account_embed_carousel_button_next.non-final',
|
|
186
191
|
defaultMessage: 'Next',
|
|
187
192
|
description: 'A button to view next teaser on benefit of connecting account on Smart Link embed'
|
|
188
193
|
},
|
|
189
|
-
|
|
190
|
-
id: 'fabric.linking.
|
|
191
|
-
defaultMessage:
|
|
192
|
-
description: 'A description on a teaser slide 1 on benefit of connecting account on Smart Link embed'
|
|
194
|
+
connect_link_account_embed_carousel_sl_description: {
|
|
195
|
+
id: 'fabric.linking.connect_link_account_embed_carousel_sl_description.non-final',
|
|
196
|
+
defaultMessage: "Embed live previews of {context, select, \n\t\t\t\tGoogle {Google Docs, Sheets, and Slides} \n\t\t\t\tother {{context}}} {product, select, \n\t\t\t\tBITBUCKET {right inside Bitbucket}\n\t\t\t\tCONFLUENCE {right inside Confluence and Jira}\n\t\t\t\tJIRA {right inside Confluence and Jira}\n\t\t\t\tTRELLO {right inside Trello}\n\t\t\t\tother {across Atlassian}}.",
|
|
197
|
+
description: 'A description on a teaser slide 1 on benefit of connecting account on Smart Link embed.' + ' Example Google+CONFLUENCE: Embed live previews of Google Docs, Sheets, and Slides right inside Confluence and Jira.' + ' Example Google+TRELLO: Embed live previews of Google Docs, Sheets, and Slides right inside Trello.' + ' Example other+TRELLO: Embed live previews of Figma right inside Trello.' + ' Example other+other: Embed live previews of Figma across Atlassian.'
|
|
193
198
|
},
|
|
194
|
-
|
|
195
|
-
id: 'fabric.linking.
|
|
196
|
-
defaultMessage: '
|
|
199
|
+
connect_link_account_embed_carousel_sl_title: {
|
|
200
|
+
id: 'fabric.linking.connect_link_account_embed_carousel_sl_title.non-final',
|
|
201
|
+
defaultMessage: 'Turn smart links into rich previews',
|
|
197
202
|
description: 'A title on a teaser slide 1 on benefit of connecting account on Smart Link embed'
|
|
198
203
|
},
|
|
199
|
-
|
|
200
|
-
id: 'fabric.linking.
|
|
201
|
-
defaultMessage: '
|
|
204
|
+
connect_link_account_embed_carousel_rovo_title: {
|
|
205
|
+
id: 'fabric.linking.connect_link_account_embed_carousel_rovo_title.non-final',
|
|
206
|
+
defaultMessage: 'Find everything in one search',
|
|
202
207
|
description: 'A title on a teaser slide 2 on benefit of connecting account on Smart Link embed'
|
|
203
208
|
},
|
|
204
|
-
|
|
205
|
-
id: 'fabric.linking.
|
|
206
|
-
defaultMessage:
|
|
207
|
-
description: 'A description on a teaser slide 2 on benefit of connecting account on Smart Link embed'
|
|
209
|
+
connect_link_account_embed_carousel_rovo_description: {
|
|
210
|
+
id: 'fabric.linking.connect_link_account_embed_carousel_rovo_description.non-final',
|
|
211
|
+
defaultMessage: "Access {context} files alongside your work in {product, select, \n\t\t\t\tBITBUCKET {Bitbucket}\n\t\t\t\tCONFLUENCE {Confluence and Jira}\n\t\t\t\tJIRA {Confluence and Jira}\n\t\t\t\tTRELLO {Trello}\n\t\t\t\tother {Atlassian}}. We'll always respect your {context} permissions.",
|
|
212
|
+
description: 'A description on a teaser slide 2 on benefit of connecting account on Smart Link embed.' + " Example Figma+JIRA: Access Figma files alongside your work in Confluence and Jira. We'll always respect your Figma permissions." + " Example Figma+BITBUCKET: Access Figma files alongside your work in Bitbucket. We'll always respect your Figma permissions." + " Example Figma+other: Access Figma files alongside your work in Atlassian. We'll always respect your Figma permissions."
|
|
208
213
|
},
|
|
209
|
-
|
|
210
|
-
id: 'fabric.linking.
|
|
214
|
+
connect_link_account_embed_carousel_rovochat_title: {
|
|
215
|
+
id: 'fabric.linking.connect_link_account_embed_carousel_rovochat_title.non-final',
|
|
211
216
|
defaultMessage: 'Get help from Rovo',
|
|
212
217
|
description: 'A title on a teaser slide 3 on benefit of connecting account on Smart Link embed'
|
|
213
218
|
},
|
|
214
|
-
|
|
215
|
-
id: 'fabric.linking.
|
|
216
|
-
defaultMessage:
|
|
219
|
+
connect_link_account_embed_carousel_rovochat_description: {
|
|
220
|
+
id: 'fabric.linking.connect_link_account_embed_carousel_rovochat_description.non-final',
|
|
221
|
+
defaultMessage: 'Rovo uses your {context} content to answer questions, summarise docs, and draft updates using the work you’ve already done.',
|
|
217
222
|
description: 'A description on a teaser slide 3 on benefit of connecting account on Smart Link embed'
|
|
218
223
|
},
|
|
219
224
|
connect_link_account_success_flag_description: {
|
|
@@ -236,6 +241,11 @@ var messages = exports.messages = (0, _reactIntl.defineMessages)({
|
|
|
236
241
|
defaultMessage: 'Connect to {context}',
|
|
237
242
|
description: 'Shown on a button to connect user external account to their Atlassian account.'
|
|
238
243
|
},
|
|
244
|
+
connect_3p_account: {
|
|
245
|
+
id: 'fabric.linking.connect_3p_account.non-final',
|
|
246
|
+
defaultMessage: 'Connect {context}',
|
|
247
|
+
description: 'Shown on a button to connect user external 3P account to their Atlassian account, e.g. Connect Figma'
|
|
248
|
+
},
|
|
239
249
|
connect_inline_social_proof: {
|
|
240
250
|
id: 'fabric.linking.connect_inline_social_proof',
|
|
241
251
|
defaultMessage: 'Connect',
|
|
@@ -11,7 +11,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
11
11
|
var context = exports.context = {
|
|
12
12
|
componentName: 'smart-cards',
|
|
13
13
|
packageName: "@atlaskit/smart-card" || '',
|
|
14
|
-
packageVersion: "45.
|
|
14
|
+
packageVersion: "45.12.0" || ''
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -4,14 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.getKeys = exports.fireLinkClickedEvent = exports.
|
|
7
|
+
exports.getKeys = exports.fireLinkClickedEvent = exports.createLinkClickedPayload = exports.buttonMap = void 0;
|
|
8
8
|
exports.getLinkClickOutcome = getLinkClickOutcome;
|
|
9
9
|
exports.withLinkClickedEvent = withLinkClickedEvent;
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
12
|
var _userAgent = require("@atlaskit/linking-common/user-agent");
|
|
13
|
-
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
14
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
15
13
|
var _useLinkClicked = require("../../state/analytics/useLinkClicked");
|
|
16
14
|
var _analytics = require("./analytics");
|
|
17
15
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -80,7 +78,7 @@ function getLinkClickOutcome(e, clickType) {
|
|
|
80
78
|
}
|
|
81
79
|
return 'unknown';
|
|
82
80
|
}
|
|
83
|
-
var
|
|
81
|
+
var linkClickedEvent = function linkClickedEvent(_ref) {
|
|
84
82
|
var clickType = _ref.clickType,
|
|
85
83
|
clickOutcome = _ref.clickOutcome,
|
|
86
84
|
keysHeld = _ref.keysHeld,
|
|
@@ -97,26 +95,7 @@ var linkClickedEventOld = function linkClickedEventOld(_ref) {
|
|
|
97
95
|
}
|
|
98
96
|
};
|
|
99
97
|
};
|
|
100
|
-
var
|
|
101
|
-
var clickType = _ref2.clickType,
|
|
102
|
-
clickOutcome = _ref2.clickOutcome,
|
|
103
|
-
keysHeld = _ref2.keysHeld,
|
|
104
|
-
defaultPrevented = _ref2.defaultPrevented,
|
|
105
|
-
isConfluenceShortLink = _ref2.isConfluenceShortLink;
|
|
106
|
-
return {
|
|
107
|
-
action: 'clicked',
|
|
108
|
-
actionSubject: 'link',
|
|
109
|
-
eventType: 'ui',
|
|
110
|
-
attributes: {
|
|
111
|
-
clickType: clickType,
|
|
112
|
-
clickOutcome: clickOutcome,
|
|
113
|
-
keysHeld: keysHeld,
|
|
114
|
-
defaultPrevented: defaultPrevented,
|
|
115
|
-
isConfluenceShortLink: isConfluenceShortLink
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
var createLinkClickedPayloadOld = exports.createLinkClickedPayloadOld = function createLinkClickedPayloadOld(event) {
|
|
98
|
+
var createLinkClickedPayload = exports.createLinkClickedPayload = function createLinkClickedPayload(event) {
|
|
120
99
|
// Through the `detail` property, we're able to determine if the event is (most likely) triggered via keyboard
|
|
121
100
|
// https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail
|
|
122
101
|
var isKeyboard = event.nativeEvent.detail === 0;
|
|
@@ -127,7 +106,7 @@ var createLinkClickedPayloadOld = exports.createLinkClickedPayloadOld = function
|
|
|
127
106
|
var clickOutcome = getLinkClickOutcome(event, clickType);
|
|
128
107
|
var keysHeld = getKeys(event);
|
|
129
108
|
var defaultPrevented = event.defaultPrevented;
|
|
130
|
-
var linkClickedEventResult =
|
|
109
|
+
var linkClickedEventResult = linkClickedEvent({
|
|
131
110
|
clickType: clickType,
|
|
132
111
|
clickOutcome: clickOutcome,
|
|
133
112
|
keysHeld: keysHeld,
|
|
@@ -147,50 +126,6 @@ var createLinkClickedPayloadOld = exports.createLinkClickedPayloadOld = function
|
|
|
147
126
|
return linkClickedEventResult;
|
|
148
127
|
}
|
|
149
128
|
};
|
|
150
|
-
var createLinkClickedPayloadNew = exports.createLinkClickedPayloadNew = function createLinkClickedPayloadNew(event) {
|
|
151
|
-
// Through the `detail` property, we're able to determine if the event is (most likely) triggered via keyboard
|
|
152
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail
|
|
153
|
-
var isKeyboard = event.nativeEvent.detail === 0;
|
|
154
|
-
var clickType = isKeyboard ? 'keyboard' : buttonMap.get(event.button);
|
|
155
|
-
if (!clickType) {
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
var clickOutcome = getLinkClickOutcome(event, clickType);
|
|
159
|
-
var keysHeld = getKeys(event);
|
|
160
|
-
var defaultPrevented = event.defaultPrevented;
|
|
161
|
-
|
|
162
|
-
// Check if the URL is a Confluence shortLink (contains "/l/cp/")
|
|
163
|
-
var isConfluenceShortLink = false;
|
|
164
|
-
if (event.currentTarget instanceof HTMLAnchorElement) {
|
|
165
|
-
var url = event.currentTarget.href;
|
|
166
|
-
isConfluenceShortLink = url.includes('/l/cp/');
|
|
167
|
-
}
|
|
168
|
-
var linkClickedEventResult = linkClickedEventWithShortLink({
|
|
169
|
-
clickType: clickType,
|
|
170
|
-
clickOutcome: clickOutcome,
|
|
171
|
-
keysHeld: keysHeld,
|
|
172
|
-
defaultPrevented: defaultPrevented,
|
|
173
|
-
isConfluenceShortLink: isConfluenceShortLink
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
// if the current target is an anchor tag, we can get the href from it and use that as the url being navigated too.
|
|
177
|
-
if (event.currentTarget instanceof HTMLAnchorElement) {
|
|
178
|
-
var _url = event.currentTarget.href;
|
|
179
|
-
return _objectSpread(_objectSpread({}, linkClickedEventResult), {}, {
|
|
180
|
-
nonPrivacySafeAttributes: {
|
|
181
|
-
url: _url
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
} else {
|
|
185
|
-
// We can't get the href from the event target, so dont include the url or any non privacy safe attributes
|
|
186
|
-
return linkClickedEventResult;
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
var createLinkClickedPayload = exports.createLinkClickedPayload = (0, _platformFeatureFlagsReact.functionWithCondition)(function () {
|
|
190
|
-
return (0, _expValEquals.expValEquals)('smart_link_confluence_short_link_analytics', 'cohort', 'test');
|
|
191
|
-
},
|
|
192
|
-
// 12/17/2025: Clean up this feature gate once it's out in prod for 2 weeks - https://product-fabric.atlassian.net/browse/CCPERMS-5030
|
|
193
|
-
createLinkClickedPayloadNew, createLinkClickedPayloadOld);
|
|
194
129
|
var fireLinkClickedEvent = exports.fireLinkClickedEvent = function fireLinkClickedEvent(createAnalyticsEvent) {
|
|
195
130
|
return function (event) {
|
|
196
131
|
var overrides = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -1,23 +1,33 @@
|
|
|
1
1
|
._2rko1rr0{border-radius:var(--ds-radius-full,9999px)}
|
|
2
2
|
._zulp1ejb{gap:var(--ds-space-300,24px)}
|
|
3
|
+
._zulppxbi{gap:var(--ds-space-200,1pc)}
|
|
3
4
|
._zulpu2gc{gap:var(--ds-space-100,8px)}
|
|
4
|
-
._zulpze3t{gap:var(--ds-space-0,0)}.
|
|
5
|
+
._zulpze3t{gap:var(--ds-space-0,0)}._154iidpf{top:0}
|
|
6
|
+
._16jlkb7n{flex-grow:1}
|
|
7
|
+
._18m915vq{overflow-y:hidden}
|
|
5
8
|
._18m91wug{overflow-y:auto}
|
|
6
9
|
._19bv1jfw{padding-left:var(--ds-space-500,40px)}
|
|
7
10
|
._19bvpxbi{padding-left:var(--ds-space-200,1pc)}
|
|
8
11
|
._19bvze3t{padding-left:var(--ds-space-0,0)}
|
|
9
12
|
._1bah1h6o{justify-content:center}
|
|
13
|
+
._1bah1y6m{justify-content:flex-start}
|
|
14
|
+
._1bah1yb4{justify-content:space-between}
|
|
10
15
|
._1bsb1osq{width:100%}
|
|
11
16
|
._1bsb1tcg{width:24px}
|
|
12
17
|
._1bsb7vkz{width:1pc}
|
|
13
|
-
.
|
|
18
|
+
._1bsbftgi{width:8px}
|
|
14
19
|
._1e0c1txw{display:flex}
|
|
15
20
|
._1e0c1ule{display:block}
|
|
21
|
+
._1ltvidpf{left:0}
|
|
16
22
|
._1n261g80{flex-wrap:wrap}
|
|
23
|
+
._1n261q9c{flex-wrap:nowrap}
|
|
17
24
|
._1o9zidpf{flex-shrink:0}
|
|
18
25
|
._1o9zkb7n{flex-shrink:1}
|
|
19
26
|
._1oecfnf5{transition-duration:.2s}
|
|
27
|
+
._1reo15vq{overflow-x:hidden}
|
|
20
28
|
._1reo1wug{overflow-x:auto}
|
|
29
|
+
._1tkeidpf{min-height:0}
|
|
30
|
+
._1ul9idpf{min-width:0}
|
|
21
31
|
._2lx21bp4{flex-direction:column}
|
|
22
32
|
._2lx2vrvc{flex-direction:row}
|
|
23
33
|
._4cvr1fhb{align-items:stretch}
|
|
@@ -26,10 +36,10 @@
|
|
|
26
36
|
._4t3i1osq{height:100%}
|
|
27
37
|
._4t3i1tcg{height:24px}
|
|
28
38
|
._4t3i7vkz{height:1pc}
|
|
29
|
-
.
|
|
39
|
+
._4t3iftgi{height:8px}
|
|
30
40
|
._5ral1f51{object-fit:contain}
|
|
31
41
|
._6fl45ucs{transition-timing-function:ease}
|
|
32
|
-
.
|
|
42
|
+
._bfhk9pm7{background-color:var(--ds-background-information-subtle,#8fb8f6)}
|
|
33
43
|
._bfhki8nm{background-color:var(--ds-background-neutral,#0515240f)}
|
|
34
44
|
._bfhkjmqp{background-color:var(--ds-background-selected-bold,#1868db)}
|
|
35
45
|
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
@@ -40,6 +50,8 @@
|
|
|
40
50
|
._i0dlghg7{flex-basis:240px}
|
|
41
51
|
._i0dluuw1{flex-basis:200px}
|
|
42
52
|
._k8m01k61{transition-property:background-color}
|
|
53
|
+
._kqswh2mm{position:relative}
|
|
54
|
+
._kqswstnw{position:absolute}
|
|
43
55
|
._lcxvglyw{pointer-events:none}
|
|
44
56
|
._n3td1jfw{padding-bottom:var(--ds-space-500,40px)}
|
|
45
57
|
._n3tdpxbi{padding-bottom:var(--ds-space-200,1pc)}
|
|
@@ -2,64 +2,90 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
6
|
Object.defineProperty(exports, "__esModule", {
|
|
6
7
|
value: true
|
|
7
8
|
});
|
|
8
9
|
exports.default = void 0;
|
|
9
10
|
require("./CarouselSlide.compiled.css");
|
|
10
11
|
var _runtime = require("@compiled/react/runtime");
|
|
11
|
-
var _react =
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
13
|
var _reactIntl = require("react-intl");
|
|
13
14
|
var _new = _interopRequireDefault(require("@atlaskit/button/new"));
|
|
14
15
|
var _css = require("@atlaskit/css");
|
|
15
16
|
var _heading = _interopRequireDefault(require("@atlaskit/heading"));
|
|
17
|
+
var _smartLink = _interopRequireDefault(require("@atlaskit/icon/core/smart-link"));
|
|
18
|
+
var _iconTile = _interopRequireDefault(require("@atlaskit/icon/icon-tile"));
|
|
16
19
|
var _image = _interopRequireDefault(require("@atlaskit/image"));
|
|
17
20
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
18
21
|
var _messages = require("../../../../messages");
|
|
22
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
19
23
|
var styles = {
|
|
20
|
-
columnImage: "_16jlkb7n _1o9zkb7n _i0dlghg7
|
|
21
|
-
|
|
24
|
+
columnImage: "_16jlkb7n _1o9zkb7n _i0dlghg7 _1reo15vq _18m915vq _1e0c1txw _4cvr1fhb _1bah1y6m _1tkeidpf _1ul9idpf _bfhk9pm7",
|
|
25
|
+
imageContainer: "_kqswh2mm _1bsb1osq _4t3i1osq",
|
|
26
|
+
imageAbsolute: "_kqswstnw _154iidpf _1ltvidpf _1bsb1osq",
|
|
27
|
+
columnContent: "_zulp1ejb _16jlkb7n _1o9zkb7n _i0dluuw1 _1reo1wug _18m91wug _1e0c1txw _2lx21bp4 _1tkeidpf _ca0q1jfw _u5f31jfw _n3td1jfw _19bv1jfw _4cvr1y6m _1bah1yb4",
|
|
28
|
+
columnContentTop: "_zulppxbi _1e0c1txw _2lx21bp4 _4cvr1y6m _1bsb1osq",
|
|
29
|
+
columnContentBody: "_zulp1ejb _1e0c1txw _2lx21bp4 _4cvr1y6m _1bsb1osq",
|
|
22
30
|
columnContentCompact: "_ca0qpxbi _u5f3pxbi _n3tdpxbi _19bvpxbi",
|
|
23
|
-
dot: "_2rko1rr0
|
|
31
|
+
dot: "_2rko1rr0 _1bsbftgi _4t3iftgi _bfhki8nm _1oecfnf5 _k8m01k61 _6fl45ucs _lcxvglyw",
|
|
24
32
|
dotActive: "_bfhkjmqp",
|
|
25
33
|
dotPassable: "_2rko1rr0 _1e0c1txw _4cvr1h6o _1bah1h6o _1bsb7vkz _4t3i7vkz _bfhksm61 _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t",
|
|
26
34
|
icon: "_1o9zidpf _1bsb1tcg _4t3i1tcg _1e0c1txw _4cvr1h6o _1bah1h6o",
|
|
27
35
|
iconImage: "_1bsb1osq _4t3i1osq _5ral1f51",
|
|
28
36
|
image: "_1bsb1osq _c71l1wdt _5ral1f51 _rsufaqso _1e0c1ule",
|
|
29
37
|
rowButton: "_zulpu2gc _1e0c1txw _2lx2vrvc _1n261g80 _4cvr1h6o",
|
|
38
|
+
rowButtonNavGroup: "_zulpu2gc _1e0c1txw _2lx2vrvc _4cvr1h6o _1o9zidpf",
|
|
30
39
|
rowButtonCompact: "_1bsb1osq",
|
|
31
40
|
rowDot: "_zulpze3t _1e0c1txw _2lx2vrvc _4cvr1h6o",
|
|
32
41
|
rowIcon: "_zulpu2gc _1e0c1txw _4cvr1h6o",
|
|
33
|
-
slide: "
|
|
42
|
+
slide: "_1reo15vq _18m915vq _1e0c1txw _1n261q9c _1bsb1osq _4t3i1osq _4cvr1fhb _vchhusvi"
|
|
34
43
|
};
|
|
35
44
|
var CarouselSlide = function CarouselSlide(_ref) {
|
|
36
45
|
var icon = _ref.icon,
|
|
37
|
-
iconLabel = _ref.iconLabel,
|
|
46
|
+
_ref$iconLabel = _ref.iconLabel,
|
|
47
|
+
iconLabel = _ref$iconLabel === void 0 ? '' : _ref$iconLabel,
|
|
38
48
|
title = _ref.title,
|
|
39
49
|
description = _ref.description,
|
|
40
50
|
image = _ref.image,
|
|
41
51
|
primaryButtonLabel = _ref.primaryButtonLabel,
|
|
42
52
|
onPrimaryButtonClick = _ref.onPrimaryButtonClick,
|
|
53
|
+
onBackClick = _ref.onBackClick,
|
|
43
54
|
onDotClick = _ref.onDotClick,
|
|
44
55
|
onNextClick = _ref.onNextClick,
|
|
45
56
|
slideIndex = _ref.slideIndex,
|
|
46
57
|
totalSlides = _ref.totalSlides,
|
|
47
58
|
size = _ref.size,
|
|
48
59
|
_ref$testId = _ref.testId,
|
|
49
|
-
testId = _ref$testId === void 0 ? 'embed-card-
|
|
60
|
+
testId = _ref$testId === void 0 ? 'embed-card-carousel-slide' : _ref$testId;
|
|
50
61
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
51
62
|
formatMessage = _useIntl.formatMessage;
|
|
52
63
|
var isCompact = size !== 'full';
|
|
64
|
+
var showPrimaryButton = typeof onPrimaryButtonClick === 'function';
|
|
53
65
|
var showNavigation = totalSlides > 1;
|
|
54
|
-
var renderedIcon =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
var renderedIcon = (0, _react.useMemo)(function () {
|
|
67
|
+
if (typeof icon === 'string') {
|
|
68
|
+
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
69
|
+
xcss: styles.icon
|
|
70
|
+
}, /*#__PURE__*/_react.default.createElement(_image.default, {
|
|
71
|
+
src: icon,
|
|
72
|
+
alt: iconLabel,
|
|
73
|
+
className: (0, _runtime.ax)([styles.iconImage])
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
if (icon) {
|
|
77
|
+
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
78
|
+
xcss: styles.icon
|
|
79
|
+
}, icon);
|
|
80
|
+
}
|
|
81
|
+
return /*#__PURE__*/_react.default.createElement(_iconTile.default, {
|
|
82
|
+
appearance: "blue",
|
|
83
|
+
icon: _smartLink.default,
|
|
84
|
+
label: iconLabel,
|
|
85
|
+
size: "small",
|
|
86
|
+
testId: "embed-card-fallback-icon"
|
|
87
|
+
});
|
|
88
|
+
}, [icon, iconLabel]);
|
|
63
89
|
var renderedImage = image == null ? null : typeof image === 'string' ? /*#__PURE__*/_react.default.createElement(_image.default, {
|
|
64
90
|
src: image,
|
|
65
91
|
alt: title,
|
|
@@ -70,7 +96,9 @@ var CarouselSlide = function CarouselSlide(_ref) {
|
|
|
70
96
|
testId: testId
|
|
71
97
|
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
72
98
|
xcss: (0, _css.cx)(styles.columnContent, isCompact && styles.columnContentCompact)
|
|
73
|
-
},
|
|
99
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
100
|
+
xcss: styles.columnContentTop
|
|
101
|
+
}, showPrimaryButton && isCompact && /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
74
102
|
xcss: (0, _css.cx)(styles.rowButton, styles.rowButtonCompact)
|
|
75
103
|
}, /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
76
104
|
appearance: "primary",
|
|
@@ -82,22 +110,30 @@ var CarouselSlide = function CarouselSlide(_ref) {
|
|
|
82
110
|
}, renderedIcon), /*#__PURE__*/_react.default.createElement(_compiled.Box, null, /*#__PURE__*/_react.default.createElement(_heading.default, {
|
|
83
111
|
size: "medium",
|
|
84
112
|
testId: "".concat(testId, "-title")
|
|
85
|
-
}, title)), /*#__PURE__*/_react.default.createElement(_compiled.Box,
|
|
113
|
+
}, title)), /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
114
|
+
xcss: styles.columnContentBody
|
|
115
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, null, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
86
116
|
testId: "".concat(testId, "-description")
|
|
87
|
-
}, description)), /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
117
|
+
}, description)), (showPrimaryButton && !isCompact || showNavigation && (onNextClick || onBackClick)) && /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
88
118
|
xcss: styles.rowButton
|
|
89
|
-
}, !isCompact && /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
119
|
+
}, showPrimaryButton && !isCompact && /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
90
120
|
appearance: "primary",
|
|
91
121
|
onClick: onPrimaryButtonClick,
|
|
92
122
|
testId: "".concat(testId, "-connect")
|
|
93
|
-
}, primaryButtonLabel), showNavigation && onNextClick && /*#__PURE__*/_react.default.createElement(
|
|
123
|
+
}, primaryButtonLabel), showNavigation && (onBackClick || onNextClick) && /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
124
|
+
xcss: styles.rowButtonNavGroup
|
|
125
|
+
}, onBackClick && /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
126
|
+
appearance: "subtle",
|
|
127
|
+
onClick: onBackClick,
|
|
128
|
+
testId: "".concat(testId, "-back")
|
|
129
|
+
}, formatMessage(_messages.messages.connect_link_account_embed_carousel_button_back)), onNextClick && /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
94
130
|
appearance: "subtle",
|
|
95
131
|
onClick: onNextClick,
|
|
96
132
|
testId: "".concat(testId, "-next")
|
|
97
|
-
}, formatMessage(_messages.messages.
|
|
133
|
+
}, formatMessage(_messages.messages.connect_link_account_embed_carousel_button_next)))))), showNavigation && /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
98
134
|
xcss: styles.rowDot,
|
|
99
135
|
role: "group",
|
|
100
|
-
"aria-label": formatMessage(_messages.messages.
|
|
136
|
+
"aria-label": formatMessage(_messages.messages.connect_link_account_embed_carousel_dot_row_label)
|
|
101
137
|
}, Array.from({
|
|
102
138
|
length: totalSlides
|
|
103
139
|
}, function (_, i) {
|
|
@@ -107,7 +143,7 @@ var CarouselSlide = function CarouselSlide(_ref) {
|
|
|
107
143
|
onClick: function onClick() {
|
|
108
144
|
return onDotClick === null || onDotClick === void 0 ? void 0 : onDotClick(i);
|
|
109
145
|
},
|
|
110
|
-
"aria-label": formatMessage(_messages.messages.
|
|
146
|
+
"aria-label": formatMessage(_messages.messages.connect_link_account_embed_carousel_dot_label, {
|
|
111
147
|
index: i + 1,
|
|
112
148
|
total: totalSlides
|
|
113
149
|
}),
|
|
@@ -116,9 +152,13 @@ var CarouselSlide = function CarouselSlide(_ref) {
|
|
|
116
152
|
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
117
153
|
xcss: (0, _css.cx)(styles.dot, i === slideIndex && styles.dotActive)
|
|
118
154
|
}));
|
|
119
|
-
})))
|
|
155
|
+
}))), !isCompact && /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
120
156
|
xcss: styles.columnImage,
|
|
121
|
-
testId: "".concat(testId, "-image-panel")
|
|
122
|
-
},
|
|
157
|
+
testId: "".concat(testId, "-image-panel-").concat(slideIndex)
|
|
158
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
159
|
+
xcss: styles.imageContainer
|
|
160
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
161
|
+
xcss: styles.imageAbsolute
|
|
162
|
+
}, renderedImage))));
|
|
123
163
|
};
|
|
124
164
|
var _default = exports.default = CarouselSlide;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
._1reo15vq{overflow-x:hidden}
|
|
7
7
|
._4t3i1osq{height:100%}
|
|
8
8
|
._5sagjx92{animation-duration:.28s}
|
|
9
|
-
.
|
|
9
|
+
._j7hq1wwu{animation-name:kgnpaw5}
|
|
10
10
|
._kqswh2mm{position:relative}
|
|
11
|
-
@keyframes
|
|
11
|
+
@keyframes kgnpaw5{0%{opacity:0}to{opacity:1}}
|
|
12
12
|
@media (prefers-reduced-motion:reduce){._bl8aglyw{animation-name:none}._2hwzhgkh{animation-duration:.01ms}}
|
|
@@ -17,12 +17,10 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
17
17
|
var styles = {
|
|
18
18
|
carousel: "_1reo15vq _18m915vq _1e0c1txw _1bsb1osq _4t3i1osq _kqswh2mm"
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
// Slide enters from the right: translates from 40px right + fades in
|
|
22
|
-
var slideInFromRight = null;
|
|
20
|
+
var fadeIn = null;
|
|
23
21
|
var slideWrapperMap = {
|
|
24
22
|
static: "_1bsb1osq _4t3i1osq",
|
|
25
|
-
animated: "_1bsb1osq _4t3i1osq
|
|
23
|
+
animated: "_1bsb1osq _4t3i1osq _j7hq1wwu _5sagjx92 _1pglafbj _1o511hrf _bl8aglyw _2hwzhgkh"
|
|
26
24
|
};
|
|
27
25
|
/**
|
|
28
26
|
* Derives layout size bucket from pixel dimensions.
|
|
@@ -41,12 +39,14 @@ var getSize = function getSize(width, height) {
|
|
|
41
39
|
var Carousel = function Carousel(_ref) {
|
|
42
40
|
var icon = _ref.icon,
|
|
43
41
|
iconLabel = _ref.iconLabel,
|
|
42
|
+
_ref$initialSlideInde = _ref.initialSlideIndex,
|
|
43
|
+
initialSlideIndex = _ref$initialSlideInde === void 0 ? 0 : _ref$initialSlideInde,
|
|
44
44
|
items = _ref.items,
|
|
45
45
|
onPrimaryButtonClick = _ref.onPrimaryButtonClick,
|
|
46
46
|
primaryButtonLabel = _ref.primaryButtonLabel,
|
|
47
47
|
_ref$testId = _ref.testId,
|
|
48
48
|
testId = _ref$testId === void 0 ? 'embed-card-teaser-carousel' : _ref$testId;
|
|
49
|
-
var _useState = (0, _react.useState)(
|
|
49
|
+
var _useState = (0, _react.useState)(initialSlideIndex),
|
|
50
50
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
51
51
|
activeIndex = _useState2[0],
|
|
52
52
|
setActiveIndex = _useState2[1];
|
|
@@ -86,6 +86,12 @@ var Carousel = function Carousel(_ref) {
|
|
|
86
86
|
return (current + 1) % items.length;
|
|
87
87
|
});
|
|
88
88
|
}, [items.length]);
|
|
89
|
+
var goPrev = (0, _react.useCallback)(function () {
|
|
90
|
+
hasNavigated.current = true;
|
|
91
|
+
setActiveIndex(function (current) {
|
|
92
|
+
return Math.max(0, current - 1);
|
|
93
|
+
});
|
|
94
|
+
}, []);
|
|
89
95
|
var goTo = (0, _react.useCallback)(function (index) {
|
|
90
96
|
if (index === activeIndex) {
|
|
91
97
|
return;
|
|
@@ -94,6 +100,7 @@ var Carousel = function Carousel(_ref) {
|
|
|
94
100
|
setActiveIndex(index);
|
|
95
101
|
}, [activeIndex]);
|
|
96
102
|
var currentSlide = items[activeIndex];
|
|
103
|
+
var isFirstSlide = activeIndex === 0;
|
|
97
104
|
var isLastSlide = activeIndex === items.length - 1;
|
|
98
105
|
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
99
106
|
ref: containerRef,
|
|
@@ -111,6 +118,7 @@ var Carousel = function Carousel(_ref) {
|
|
|
111
118
|
image: currentSlide.image,
|
|
112
119
|
title: currentSlide.title,
|
|
113
120
|
onPrimaryButtonClick: onPrimaryButtonClick,
|
|
121
|
+
onBackClick: !isFirstSlide ? goPrev : undefined,
|
|
114
122
|
onDotClick: goTo,
|
|
115
123
|
onNextClick: !isLastSlide ? goNext : undefined,
|
|
116
124
|
size: size,
|