@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
@@ -16,6 +16,7 @@ var _transformSmartLinkSizeToIconTileSize = require("../../../../../common/ui/ic
16
16
  var _constants = require("../../../../../constants");
17
17
  var _getLazyIcons = require("../../../../../utils/get-lazy-icons");
18
18
  var _isIconSizeLarge = require("../../../../../utils/is-icon-size-large");
19
+ var _lazyComponent = require("../../../../../utils/lazy-component");
19
20
  var getIconImportFn = function getIconImportFn(icon, size) {
20
21
  var item = (0, _getLazyIcons.getLazyIcons)()[icon];
21
22
  if ((0, _isIconSizeLarge.isIconSizeLarge)(size) && item !== null && item !== void 0 && item.large) {
@@ -23,6 +24,16 @@ var getIconImportFn = function getIconImportFn(icon, size) {
23
24
  }
24
25
  return item === null || item === void 0 ? void 0 : item.default;
25
26
  };
27
+
28
+ // Only used when platform_sl_replace_react_loadable is on. Kept separate from getIconImportFn so
29
+ // the gate-off path is unchanged.
30
+ var getLazyIcon = function getLazyIcon(icon, size) {
31
+ var item = (0, _getLazyIcons.getLazyIcons)()[icon];
32
+ if ((0, _isIconSizeLarge.isIconSizeLarge)(size) && item !== null && item !== void 0 && item.large) {
33
+ return (0, _lazyComponent.getLazyIconComponent)("".concat(icon, ":large"), item.large);
34
+ }
35
+ return item !== null && item !== void 0 && item.default ? (0, _lazyComponent.getLazyIconComponent)("".concat(icon, ":default"), item.default) : undefined;
36
+ };
26
37
  var importIcon = function importIcon(importFn) {
27
38
  return (0, _reactLoadable.default)({
28
39
  loader: function loader() {
@@ -90,11 +101,19 @@ var AtlaskitIcon = function AtlaskitIcon(_ref) {
90
101
  });
91
102
  }
92
103
  }
93
- var importFn = getIconImportFn(icon, size);
94
- if (!importFn) {
95
- return null;
104
+ var ImportedIcon;
105
+ if ((0, _fg.fg)('platform_sl_replace_react_loadable')) {
106
+ ImportedIcon = getLazyIcon(icon, size);
107
+ if (!ImportedIcon) {
108
+ return null;
109
+ }
110
+ } else {
111
+ var importFn = getIconImportFn(icon, size);
112
+ if (!importFn) {
113
+ return null;
114
+ }
115
+ ImportedIcon = importIcon(importFn);
96
116
  }
97
- var ImportedIcon = importIcon(importFn);
98
117
  if (isCoreIcon(icon)) {
99
118
  var color;
100
119
  if (icon === _constants.IconType.Error || icon === _constants.IconType.Forbidden) {
@@ -19,7 +19,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
19
19
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
20
20
  var PACKAGE_DATA = {
21
21
  packageName: "@atlaskit/smart-card",
22
- packageVersion: "46.10.1",
22
+ packageVersion: "46.10.3",
23
23
  componentName: 'linkUrl'
24
24
  };
25
25
  var LinkUrl = function LinkUrl(_ref) {
@@ -160,63 +160,6 @@ export const messages = defineMessages({
160
160
  defaultMessage: 'To show a preview of this link, connect your {context} account.',
161
161
  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.'
162
162
  },
163
- connect_link_account_embed_carousel_dot_label: {
164
- id: 'fabric.linking.connect_link_account_embed_carousel_dot_label.non-final',
165
- defaultMessage: 'Go to slide {index} of {total}',
166
- description: 'Accessible label for a dot indicator button in the teaser carousel, describing which slide it navigates to'
167
- },
168
- connect_link_account_embed_carousel_dot_row_label: {
169
- id: 'fabric.linking.connect_link_account_embed_carousel_dot_row_label.non-final',
170
- defaultMessage: 'Slides',
171
- description: 'Accessible label for the group of dot indicator buttons in the teaser carousel'
172
- },
173
- connect_link_account_embed_carousel_button_next: {
174
- id: 'fabric.linking.connect_link_account_embed_carousel_button_next.non-final',
175
- defaultMessage: 'Next',
176
- description: 'A button to view next teaser on benefit of connecting account on Smart Link embed'
177
- },
178
- connect_link_account_embed_carousel_sl_description: {
179
- id: 'fabric.linking.connect_link_account_embed_carousel_sl_description.non-final',
180
- defaultMessage: `Embed live previews of {context, select,
181
- Google {Google Docs, Sheets, and Slides}
182
- other {{context}}} {product, select,
183
- BITBUCKET {right inside Bitbucket}
184
- CONFLUENCE {right inside Confluence and Jira}
185
- JIRA {right inside Confluence and Jira}
186
- TRELLO {right inside Trello}
187
- other {across Atlassian}}.`,
188
- 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.'
189
- },
190
- connect_link_account_embed_carousel_sl_title: {
191
- id: 'fabric.linking.connect_link_account_embed_carousel_sl_title.non-final',
192
- defaultMessage: 'Turn smart links into rich previews',
193
- description: 'A title on a teaser slide 1 on benefit of connecting account on Smart Link embed'
194
- },
195
- connect_link_account_embed_carousel_rovo_title: {
196
- id: 'fabric.linking.connect_link_account_embed_carousel_rovo_title.non-final',
197
- defaultMessage: 'Find everything in one search',
198
- description: 'A title on a teaser slide 2 on benefit of connecting account on Smart Link embed'
199
- },
200
- connect_link_account_embed_carousel_rovo_description: {
201
- id: 'fabric.linking.connect_link_account_embed_carousel_rovo_description.non-final',
202
- defaultMessage: `Access {context} files alongside your work in {product, select,
203
- BITBUCKET {Bitbucket}
204
- CONFLUENCE {Confluence and Jira}
205
- JIRA {Confluence and Jira}
206
- TRELLO {Trello}
207
- other {Atlassian}}. We'll always respect your {context} permissions.`,
208
- 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."
209
- },
210
- connect_link_account_embed_carousel_rovochat_title: {
211
- id: 'fabric.linking.connect_link_account_embed_carousel_rovochat_title.non-final',
212
- defaultMessage: 'Get help from Rovo',
213
- description: 'A title on a teaser slide 3 on benefit of connecting account on Smart Link embed'
214
- },
215
- connect_link_account_embed_carousel_rovochat_description: {
216
- id: 'fabric.linking.connect_link_account_embed_carousel_rovochat_description.non-final',
217
- defaultMessage: 'Rovo uses your {context} content to answer questions, summarise docs, and draft updates using the work you’ve already done.',
218
- description: 'A description on a teaser slide 3 on benefit of connecting account on Smart Link embed'
219
- },
220
163
  connect_link_account_success_flag_description: {
221
164
  id: 'fabric.linking.connect_link_account_success_flag_description',
222
165
  defaultMessage: 'Shared links now display rich previews.',
@@ -497,16 +440,31 @@ export const messages = defineMessages({
497
440
  defaultMessage: 'Open preview',
498
441
  description: 'Click to view a richer view of your content, without needing to navigate to it.'
499
442
  },
443
+ preview_with_title: {
444
+ id: 'smart-card.preview_with_title.ai-non-final',
445
+ defaultMessage: 'Open preview for {title}',
446
+ description: 'Accessible label for the smart link preview action. Opens a preview of the linked content. The {title} placeholder is the title of the linked resource, or its URL when no title is available.'
447
+ },
500
448
  preview_modal: {
501
449
  id: 'fabric.linking.preview_modal',
502
450
  defaultMessage: 'Open preview modal',
503
451
  description: 'Button used to view a modal view of your content without needing to navigate to it.'
504
452
  },
453
+ preview_modal_with_title: {
454
+ id: 'smart-card.preview_modal_with_title.ai-non-final',
455
+ defaultMessage: 'Open preview modal for {title}',
456
+ description: 'Accessible label for the smart link action that opens a preview modal. The {title} placeholder is the title of the linked resource, or its URL when no title is available.'
457
+ },
505
458
  preview_panel: {
506
459
  id: 'fabric.linking.preview_panel',
507
460
  defaultMessage: 'Open preview panel',
508
461
  description: 'Button used to view a side panel view of your content without needing to navigate to it.'
509
462
  },
463
+ preview_panel_with_title: {
464
+ id: 'smart-card.preview_panel_with_title.ai-non-final',
465
+ defaultMessage: 'Open preview panel for {title}',
466
+ description: 'Accessible label for the smart link action that opens a preview side panel. The {title} placeholder is the title of the linked resource, or its URL when no title is available.'
467
+ },
510
468
  preview_close: {
511
469
  id: 'fabric.linking.preview_close',
512
470
  defaultMessage: 'Close preview',
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
4
4
  export const context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card" || '',
7
- packageVersion: "46.10.1" || ''
7
+ packageVersion: "46.10.3" || ''
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
2
  import Loadable from 'react-loadable';
3
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
3
4
  import extractFileFormatIcon from '../extractors/flexible/icon/extract-file-formatIcon';
4
5
  import { getLazyIcons } from './get-lazy-icons';
6
+ import { getLazyIconComponent } from './lazy-component';
5
7
  const getTypeToIconMap = fileFormat => {
6
8
  var _lazyIcons$iconDescri, _iconDescriptor$label;
7
9
  const iconDescriptor = extractFileFormatIcon(fileFormat);
@@ -23,6 +25,18 @@ export const getIconForFileType = (fileMimeType, showIconLabel) => {
23
25
  if (!importCb) {
24
26
  return;
25
27
  }
28
+ if (fg('platform_sl_replace_react_loadable')) {
29
+ var _extractFileFormatIco;
30
+ const iconType = (_extractFileFormatIco = extractFileFormatIcon(fileMimeType.toLowerCase())) === null || _extractFileFormatIco === void 0 ? void 0 : _extractFileFormatIco.icon;
31
+ if (iconType) {
32
+ const LazyIcon = getLazyIconComponent(`${iconType}:default`, importCb);
33
+ const lazyLabel = (showIconLabel !== null && showIconLabel !== void 0 ? showIconLabel : true) ? icon[1] || '' : '';
34
+ return /*#__PURE__*/React.createElement(LazyIcon, {
35
+ testId: "document-file-format-icon",
36
+ label: lazyLabel
37
+ });
38
+ }
39
+ }
26
40
  const Icon = Loadable({
27
41
  loader: () => importCb().then(module => module.default),
28
42
  loading: () => null
@@ -0,0 +1,65 @@
1
+ import React, { lazy, Suspense } from 'react';
2
+ const RenderNothing = () => null;
3
+
4
+ /**
5
+ * `.catch` handler for a lazy loader: renders nothing if the chunk fails to load, instead of
6
+ * throwing to the nearest error boundary (matches `react-loadable` with `loading: () => null`).
7
+ *
8
+ * @example lazy(() => import('./Foo').catch(renderNothingOnLoadError))
9
+ */
10
+ export const renderNothingOnLoadError = () => ({
11
+ // Typed as `never` so the fallback is assignable to whatever component type the loader
12
+ // resolves to, and `lazy()` keeps inferring that component's props.
13
+ default: RenderNothing
14
+ });
15
+
16
+ /**
17
+ * Wraps a `React.lazy` component in its own `<Suspense fallback={null}>`, so it renders nothing
18
+ * while its chunk loads and never suspends (and blanks out) an ancestor such as the card itself.
19
+ *
20
+ * Call `lazy(() => import('...'))` inline at module scope and pass the result here, rather than
21
+ * passing a loader into a helper that calls `lazy()` for you. Product SSR tooling (e.g.
22
+ * Confluence's LoadableReactLazyBabelPlugin) only tracks and preloads `lazy()` calls whose loader
23
+ * reads no function parameters or other render-time values.
24
+ */
25
+ export const withSuspense = (LazyComponent, displayName) => {
26
+ // Typed loosely internally: TS cannot spread generic props onto a LazyExoticComponent.
27
+ // The returned component is still strictly typed as ComponentType<P>.
28
+ const Component = LazyComponent;
29
+ const LazyComponentWithSuspense = props => /*#__PURE__*/React.createElement(Suspense, {
30
+ fallback: null
31
+ }, /*#__PURE__*/React.createElement(Component, props));
32
+ if (displayName) {
33
+ LazyComponentWithSuspense.displayName = displayName;
34
+ }
35
+ return LazyComponentWithSuspense;
36
+ };
37
+ const lazyIconCache = new Map();
38
+
39
+ /**
40
+ * Returns a lazily loaded icon component for a dynamic icon import.
41
+ *
42
+ * Callers resolve the icon on every render, so the component is cached by `cacheKey` to keep a
43
+ * stable component identity across renders (otherwise React would remount and re-suspend the
44
+ * icon on every render). The cache entry is dropped if the chunk fails to load, so the next
45
+ * render retries the import.
46
+ *
47
+ * Prefer an inline module-scope `lazy(() => import('...'))` with `withSuspense` where the set of
48
+ * components is known up front, so product SSR tooling can preload the chunks. This helper is a
49
+ * deliberate exception for open-ended icon sets (any Atlaskit icon / file type) that cannot be
50
+ * enumerated statically: its loader reads render-time values, so SSR tooling cannot preload it.
51
+ *
52
+ * @param cacheKey Must uniquely identify the module `importFn` resolves to.
53
+ */
54
+ export const getLazyIconComponent = (cacheKey, importFn) => {
55
+ const cached = lazyIconCache.get(cacheKey);
56
+ if (cached) {
57
+ return cached;
58
+ }
59
+ const LazyIcon = withSuspense( /*#__PURE__*/lazy(() => importFn().catch(() => {
60
+ lazyIconCache.delete(cacheKey);
61
+ return renderNothingOnLoadError();
62
+ })), `lazy(${cacheKey})`);
63
+ lazyIconCache.set(cacheKey, LazyIcon);
64
+ return LazyIcon;
65
+ };
@@ -1,7 +1,7 @@
1
1
  /* ResolvedView.tsx generated by @compiled/babel-plugin v3.0.2 */
2
2
  import "./ResolvedView.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
- import React from 'react';
4
+ import React, { lazy } from 'react';
5
5
  import Loadable from 'react-loadable';
6
6
  import LinkGlyph from '@atlaskit/icon/core/link';
7
7
  import { useSmartLinkContext } from '@atlaskit/link-provider/use-smart-link-context';
@@ -15,6 +15,7 @@ import useEmbedRovoActionsFooterExperiment from '../../../state/hooks/use-embed-
15
15
  import useRovoConfig from '../../../state/hooks/use-rovo-config';
16
16
  import { getPreviewUrlWithEmbedContext } from '../../../utils/get-preview-url-with-theme';
17
17
  import { isProfileType } from '../../../utils/is-profile-type';
18
+ import { renderNothingOnLoadError, withSuspense } from '../../../utils/lazy-component';
18
19
  import { getRovoPostAuthPromptKeys } from '../../common/rovo-post-auth-prompts';
19
20
  import { ExpandedFrame } from '../components/ExpandedFrame';
20
21
  import { Frame } from '../components/Frame';
@@ -25,6 +26,9 @@ const EmbedRovoActionsFooter = Loadable({
25
26
  loading: () => null
26
27
  });
27
28
  EmbedRovoActionsFooter.displayName = 'lazy(EmbedRovoActionsFooter)';
29
+
30
+ // Inline module-scope lazy() so product SSR tooling can preload it before hydration.
31
+ const LazyEmbedRovoActionsFooter = withSuspense( /*#__PURE__*/lazy(() => import( /* webpackChunkName: "smart-card-embed-rovo-actions-footer" */'../components/rovo-actions-footer').catch(renderNothingOnLoadError)), 'lazy(EmbedRovoActionsFooter)');
28
32
  const styles = {
29
33
  contentWithFooter: "_1e0c1txw _2lx21bp4 _4t3i1osq _1tkeidpf",
30
34
  frameWithFooter: "_16jlkb7n _1tkeidpf",
@@ -62,7 +66,11 @@ const EmbedFrameWithRovoFooter = ({
62
66
  extensionKey: getExtensionKey(details)
63
67
  });
64
68
  }, [details, isEmbedRovoActionsFooterEnabled]);
65
- const footer = React.useMemo(() => rovoActionData && prompts.length > 0 ? /*#__PURE__*/React.createElement(EmbedRovoActionsFooter, {
69
+ const footer = React.useMemo(() => rovoActionData && prompts.length > 0 ? fg('platform_sl_replace_react_loadable') ? /*#__PURE__*/React.createElement(LazyEmbedRovoActionsFooter, {
70
+ actionData: rovoActionData,
71
+ prompts: prompts,
72
+ testId: `${testId}-rovo-actions-footer`
73
+ }) : /*#__PURE__*/React.createElement(EmbedRovoActionsFooter, {
66
74
  actionData: rovoActionData,
67
75
  prompts: prompts,
68
76
  testId: `${testId}-rovo-actions-footer`
@@ -2,13 +2,11 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useCallback, useMemo } from 'react';
3
3
  import { FormattedMessage } from 'react-intl';
4
4
  import Button from '@atlaskit/button/default/button';
5
- import FeatureGates from '@atlaskit/feature-gate-js-client/feature-gates';
6
5
  import { useAnalyticsEvents } from '../../../../common/analytics/generated/use-analytics-events';
7
6
  import { messages } from '../../../../messages';
8
7
  import UnauthorisedViewContent from '../../../common/UnauthorisedViewContent';
9
8
  import UnresolvedView from '../unresolved-view';
10
9
  import { UnauthorizedSVG } from './unauthorized-svg';
11
- import UnauthorizedCarouselView from './UnauthorizedCarouselView';
12
10
  const UnauthorizedView = ({
13
11
  context,
14
12
  extensionKey,
@@ -90,10 +88,4 @@ const UnauthorizedView = ({
90
88
  text: context === null || context === void 0 ? void 0 : context.text
91
89
  }));
92
90
  };
93
- const UnauthorizedViewGated = props => {
94
- if (FeatureGates.initializeCompleted() && FeatureGates.getExperimentValue('platform_sl_embed_preauth_teaser_exp', 'isEnabled', false)) {
95
- return /*#__PURE__*/React.createElement(UnauthorizedCarouselView, props);
96
- }
97
- return /*#__PURE__*/React.createElement(UnauthorizedView, props);
98
- };
99
- export default UnauthorizedViewGated;
91
+ export default UnauthorizedView;
@@ -8,6 +8,7 @@ import IconButton from '@atlaskit/button/icon/button';
8
8
  import LinkIconButton from '@atlaskit/button/icon/link';
9
9
  import LinkButton from '@atlaskit/button/link';
10
10
  import LoadingButton from '@atlaskit/button/loading-button';
11
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
11
12
  import { Box } from '@atlaskit/primitives/compiled/box';
12
13
  import Tooltip from '@atlaskit/tooltip/Tooltip';
13
14
  import { ActionName, SmartLinkSize } from '../../../../../../constants';
@@ -60,6 +61,7 @@ const ActionButtonRefresh = /*#__PURE__*/forwardRef(({
60
61
  }, ref) => {
61
62
  var _context$actions;
62
63
  const iconOnly = !content;
64
+ const isPreviewA11yLabelEnabled = fg('platform_smart_link_preview_a11y_label');
63
65
  const context = useFlexibleUiContext();
64
66
  const {
65
67
  product
@@ -75,6 +77,11 @@ const ActionButtonRefresh = /*#__PURE__*/forwardRef(({
75
77
  const icon = iconBefore || iconAfter;
76
78
  const iconFn = icon ? () => icon : undefined;
77
79
  if (iconOnly && iconFn) {
80
+ const label = isPreviewA11yLabelEnabled ? ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : tooltipMessage : tooltipMessage;
81
+ const tooltip = isPreviewA11yLabelEnabled ? {
82
+ ...tooltipOptions,
83
+ content: tooltipMessage
84
+ } : tooltipOptions;
78
85
  if (isLinkButton && iconFn) {
79
86
  return /*#__PURE__*/React.createElement(LinkIconButton, {
80
87
  appearance: IconButtonAppearanceMap[appearance],
@@ -82,11 +89,11 @@ const ActionButtonRefresh = /*#__PURE__*/forwardRef(({
82
89
  href: href,
83
90
  isDisabled: isDisabled,
84
91
  isTooltipDisabled: false,
85
- label: tooltipMessage,
92
+ label: label,
86
93
  onClick: onButtonClick(onClick),
87
94
  spacing: spacing,
88
95
  testId: testId,
89
- tooltip: tooltipOptions
96
+ tooltip: tooltip
90
97
  });
91
98
  }
92
99
  return /*#__PURE__*/React.createElement(IconButton, {
@@ -95,11 +102,11 @@ const ActionButtonRefresh = /*#__PURE__*/forwardRef(({
95
102
  isDisabled: isDisabled,
96
103
  isLoading: isLoading,
97
104
  isTooltipDisabled: false,
98
- label: tooltipMessage,
105
+ label: label,
99
106
  onClick: onButtonClick(onClick),
100
107
  spacing: spacing,
101
108
  testId: testId,
102
- tooltip: tooltipOptions
109
+ tooltip: tooltip
103
110
  });
104
111
  }
105
112
  const iconBeforeFn = iconBefore ? () => iconBefore : undefined;
@@ -136,7 +143,7 @@ const ActionButtonRefresh = /*#__PURE__*/forwardRef(({
136
143
  spacing: spacing,
137
144
  testId: testId
138
145
  }, content));
139
- }, [appearance, ariaLabel, content, href, iconAfter, iconBefore, iconOnly, isDisabled, isLoading, onButtonClick, onClick, size, testId, tooltipMessage]);
146
+ }, [appearance, ariaLabel, content, href, iconAfter, iconBefore, iconOnly, isDisabled, isLoading, isPreviewA11yLabelEnabled, onButtonClick, onClick, size, testId, tooltipMessage]);
140
147
  return /*#__PURE__*/React.createElement(Box, {
141
148
  testId: `${testId}-button-wrapper`,
142
149
  ref: ref,
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
2
  import DropdownItem from '@atlaskit/dropdown-menu/dropdown-menu-item';
3
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
3
4
  import { handleOnClick } from '../../../../../../utils/handle-on-click';
4
5
  const ActionDropdownItem = ({
6
+ ariaLabel,
5
7
  content,
6
8
  iconAfter,
7
9
  iconBefore,
@@ -9,6 +11,7 @@ const ActionDropdownItem = ({
9
11
  onClick,
10
12
  testId
11
13
  }) => /*#__PURE__*/React.createElement(DropdownItem, {
14
+ "aria-label": fg('platform_smart_link_preview_a11y_label') ? ariaLabel : undefined,
12
15
  elemAfter: iconAfter,
13
16
  elemBefore: iconBefore,
14
17
  isDisabled: isLoading,
@@ -67,6 +67,7 @@ const Action = ({
67
67
  }
68
68
  if (isDropdownItem) {
69
69
  return /*#__PURE__*/React.createElement(ActionDropdownItem, {
70
+ ariaLabel: ariaLabel,
70
71
  content: content,
71
72
  iconAfter: iconAfter,
72
73
  iconBefore: iconBefore,
@@ -3,12 +3,9 @@ import "./main.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { defineMessages, useIntl } from 'react-intl';
6
- import Heading from '@atlaskit/heading/heading';
7
6
  import AutomationIcon from '@atlaskit/icon/core/automation';
8
- import { useModal } from '@atlaskit/modal-dialog/hooks';
9
7
  import ModalHeader from '@atlaskit/modal-dialog/modal-header';
10
8
  import ModalTitle from '@atlaskit/modal-dialog/modal-title';
11
- import { fg } from '@atlaskit/platform-feature-flags/fg';
12
9
  import { Box } from '@atlaskit/primitives/compiled/box';
13
10
  import { Inline } from '@atlaskit/primitives/compiled/inline';
14
11
  import { Stack } from '@atlaskit/primitives/compiled/stack';
@@ -35,9 +32,6 @@ export const AutomationModalHeader = ({
35
32
  initialised,
36
33
  rules
37
34
  } = useAutomationMenu();
38
- const {
39
- titleId
40
- } = useModal();
41
35
  const showDescription = initialised && rules.length > 0 && !!modalDescription;
42
36
  return /*#__PURE__*/React.createElement(ModalHeader, {
43
37
  hasCloseButton: true
@@ -53,10 +47,7 @@ export const AutomationModalHeader = ({
53
47
  label: formatMessage(i18n.modalHeaderIconLabel),
54
48
  color: "var(--ds-icon-accent-green, #22A06B)",
55
49
  spacing: "compact"
56
- })), fg('platform_dst_modal-dialog-use-modal-title') ? /*#__PURE__*/React.createElement(ModalTitle, null, modalTitle) : /*#__PURE__*/React.createElement(Heading, {
57
- size: "medium",
58
- id: titleId
59
- }, modalTitle)), showDescription && /*#__PURE__*/React.createElement(Box, {
50
+ })), /*#__PURE__*/React.createElement(ModalTitle, null, modalTitle)), showDescription && /*#__PURE__*/React.createElement(Box, {
60
51
  xcss: styles.modalDescriptionStyle
61
52
  }, modalDescription)));
62
53
  };
@@ -1,10 +1,12 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
2
+ import React, { lazy } from 'react';
3
3
  import { FormattedMessage, useIntl } from 'react-intl';
4
4
  import FeatureGates from '@atlaskit/feature-gate-js-client/feature-gates';
5
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
5
6
  import { ActionName } from '../../../../../constants';
6
7
  import { messages } from '../../../../../messages';
7
8
  import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context/useFlexibleUiContext';
9
+ import { renderNothingOnLoadError, withSuspense } from '../../../../../utils/lazy-component';
8
10
  import { importIcon } from '../../importIcon';
9
11
  import ServerAction from '../action/server-action';
10
12
  import { getFollowActionErrorMessage } from './utils';
@@ -20,7 +22,25 @@ const importIconMapper = {
20
22
  default: ProjectsIcon
21
23
  }))
22
24
  };
25
+
26
+ // Inline module-scope lazy() calls so product SSR tooling can preload them before hydration.
27
+ const lazyIconMapper = {
28
+ goal: withSuspense( /*#__PURE__*/lazy(() => import( /* webpackChunkName: "glyphGoal" */'./goal-icon').then(({
29
+ GoalIcon
30
+ }) => ({
31
+ default: GoalIcon
32
+ })).catch(renderNothingOnLoadError)), 'lazy(GoalIcon)'),
33
+ projects: withSuspense( /*#__PURE__*/lazy(() => import( /* webpackChunkName: "glyphProjects" */'./projects-icon').then(({
34
+ ProjectsIcon
35
+ }) => ({
36
+ default: ProjectsIcon
37
+ })).catch(renderNothingOnLoadError)), 'lazy(ProjectsIcon)')
38
+ };
23
39
  const getIcon = stackIconType => {
40
+ if (fg('platform_sl_replace_react_loadable')) {
41
+ var _lazyIconMapper$stack;
42
+ return (_lazyIconMapper$stack = lazyIconMapper[stackIconType]) !== null && _lazyIconMapper$stack !== void 0 ? _lazyIconMapper$stack : null;
43
+ }
24
44
  const importFn = importIconMapper[stackIconType];
25
45
  if (!importFn) {
26
46
  return null;
@@ -3,6 +3,7 @@ import React, { useCallback, useMemo } from 'react';
3
3
  import { FormattedMessage, useIntl } from 'react-intl';
4
4
  import MediaServicesActualSizeIcon from '@atlaskit/icon/core/grow-diagonal';
5
5
  import PanelRightIcon from '@atlaskit/icon/core/panel-right';
6
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
6
7
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
8
  import { ActionName } from '../../../../../constants';
8
9
  import { messages } from '../../../../../messages';
@@ -13,7 +14,7 @@ const PreviewAction = ({
13
14
  onClick: onClickCallback,
14
15
  ...props
15
16
  }) => {
16
- var _context$actions;
17
+ var _context$actions, _context$linkTitle, _context$linkTitle$te;
17
18
  const intl = useIntl();
18
19
  const context = useFlexibleUiContext();
19
20
  const invoke = useInvokeClientAction({});
@@ -56,8 +57,18 @@ const PreviewAction = ({
56
57
  return messages.preview_improved;
57
58
  }, [hasPreviewPanel]);
58
59
  const actionMessage = intl.formatMessage(actionLabel);
60
+ const title = context === null || context === void 0 ? void 0 : (_context$linkTitle = context.linkTitle) === null || _context$linkTitle === void 0 ? void 0 : (_context$linkTitle$te = _context$linkTitle.text) === null || _context$linkTitle$te === void 0 ? void 0 : _context$linkTitle$te.trim();
61
+ let actionLabelWithTitle = messages.preview_with_title;
62
+ if (actionLabel === messages.preview_panel) {
63
+ actionLabelWithTitle = messages.preview_panel_with_title;
64
+ } else if (actionLabel === messages.preview_modal) {
65
+ actionLabelWithTitle = messages.preview_modal_with_title;
66
+ }
67
+ const ariaLabel = fg('platform_smart_link_preview_a11y_label') && title ? intl.formatMessage(actionLabelWithTitle, {
68
+ title
69
+ }) : actionMessage;
59
70
  return data ? /*#__PURE__*/React.createElement(Action, _extends({
60
- ariaLabel: actionMessage,
71
+ ariaLabel: ariaLabel,
61
72
  content: actionMessage,
62
73
  icon: actionIcon(),
63
74
  onClick: onClick,
@@ -9,6 +9,7 @@ import { transformSmartLinkSizeToIconTileSize } from '../../../../../common/ui/i
9
9
  import { IconType, SmartLinkSize } from '../../../../../constants';
10
10
  import { getLazyIcons } from '../../../../../utils/get-lazy-icons';
11
11
  import { isIconSizeLarge } from '../../../../../utils/is-icon-size-large';
12
+ import { getLazyIconComponent } from '../../../../../utils/lazy-component';
12
13
  const getIconImportFn = (icon, size) => {
13
14
  const item = getLazyIcons()[icon];
14
15
  if (isIconSizeLarge(size) && item !== null && item !== void 0 && item.large) {
@@ -16,6 +17,16 @@ const getIconImportFn = (icon, size) => {
16
17
  }
17
18
  return item === null || item === void 0 ? void 0 : item.default;
18
19
  };
20
+
21
+ // Only used when platform_sl_replace_react_loadable is on. Kept separate from getIconImportFn so
22
+ // the gate-off path is unchanged.
23
+ const getLazyIcon = (icon, size) => {
24
+ const item = getLazyIcons()[icon];
25
+ if (isIconSizeLarge(size) && item !== null && item !== void 0 && item.large) {
26
+ return getLazyIconComponent(`${icon}:large`, item.large);
27
+ }
28
+ return item !== null && item !== void 0 && item.default ? getLazyIconComponent(`${icon}:default`, item.default) : undefined;
29
+ };
19
30
  const importIcon = importFn => {
20
31
  return Loadable({
21
32
  loader: () => importFn().then(module => module.default),
@@ -71,11 +82,19 @@ const AtlaskitIcon = ({
71
82
  });
72
83
  }
73
84
  }
74
- const importFn = getIconImportFn(icon, size);
75
- if (!importFn) {
76
- return null;
85
+ let ImportedIcon;
86
+ if (fg('platform_sl_replace_react_loadable')) {
87
+ ImportedIcon = getLazyIcon(icon, size);
88
+ if (!ImportedIcon) {
89
+ return null;
90
+ }
91
+ } else {
92
+ const importFn = getIconImportFn(icon, size);
93
+ if (!importFn) {
94
+ return null;
95
+ }
96
+ ImportedIcon = importIcon(importFn);
77
97
  }
78
- const ImportedIcon = importIcon(importFn);
79
98
  if (isCoreIcon(icon)) {
80
99
  let color;
81
100
  if (icon === IconType.Error || icon === IconType.Forbidden) {
@@ -9,7 +9,7 @@ import LinkWarningModal from './LinkWarningModal';
9
9
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
10
10
  const PACKAGE_DATA = {
11
11
  packageName: "@atlaskit/smart-card",
12
- packageVersion: "46.10.1",
12
+ packageVersion: "46.10.3",
13
13
  componentName: 'linkUrl'
14
14
  };
15
15
  const LinkUrl = ({