@atlaskit/smart-card 44.22.0 → 44.23.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-false.png +2 -2
  3. package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-true.png +2 -2
  4. package/dist/cjs/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-false-platform-sl-3p-preauth-better-hovercard-false.png +2 -2
  5. package/dist/cjs/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-false-platform-sl-3p-preauth-better-hovercard-true.png +2 -2
  6. package/dist/cjs/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-true-platform-sl-3p-preauth-better-hovercard-false.png +2 -2
  7. package/dist/cjs/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-true-platform-sl-3p-preauth-better-hovercard-true.png +2 -2
  8. package/dist/cjs/extractors/common/icon/extractIconFromDocument.js +6 -14
  9. package/dist/cjs/state/hooks/use-smart-link-cross-product-url-wrapper/index.js +18 -7
  10. package/dist/cjs/utils/analytics/analytics.js +1 -1
  11. package/dist/cjs/utils/index.js +23 -75
  12. package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +34 -36
  13. package/dist/cjs/view/LinkUrl/index.js +1 -1
  14. package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-false.png +2 -2
  15. package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-true.png +2 -2
  16. package/dist/es2019/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-false-platform-sl-3p-preauth-better-hovercard-false.png +2 -2
  17. package/dist/es2019/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-false-platform-sl-3p-preauth-better-hovercard-true.png +2 -2
  18. package/dist/es2019/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-true-platform-sl-3p-preauth-better-hovercard-false.png +2 -2
  19. package/dist/es2019/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-true-platform-sl-3p-preauth-better-hovercard-true.png +2 -2
  20. package/dist/es2019/extractors/common/icon/extractIconFromDocument.js +6 -14
  21. package/dist/es2019/state/hooks/use-smart-link-cross-product-url-wrapper/index.js +13 -5
  22. package/dist/es2019/utils/analytics/analytics.js +1 -1
  23. package/dist/es2019/utils/index.js +3 -26
  24. package/dist/es2019/view/FlexibleCard/components/common/atlaskit-icon/index.js +34 -36
  25. package/dist/es2019/view/LinkUrl/index.js +1 -1
  26. package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-false.png +2 -2
  27. package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-true.png +2 -2
  28. package/dist/esm/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-false-platform-sl-3p-preauth-better-hovercard-false.png +2 -2
  29. package/dist/esm/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-false-platform-sl-3p-preauth-better-hovercard-true.png +2 -2
  30. package/dist/esm/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-true-platform-sl-3p-preauth-better-hovercard-false.png +2 -2
  31. package/dist/esm/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-true-platform-sl-3p-preauth-better-hovercard-true.png +2 -2
  32. package/dist/esm/extractors/common/icon/extractIconFromDocument.js +6 -14
  33. package/dist/esm/state/hooks/use-smart-link-cross-product-url-wrapper/index.js +17 -7
  34. package/dist/esm/utils/analytics/analytics.js +1 -1
  35. package/dist/esm/utils/index.js +23 -63
  36. package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +34 -36
  37. package/dist/esm/view/LinkUrl/index.js +1 -1
  38. package/package.json +6 -6
@@ -13,17 +13,25 @@ const useSmartLinkCrossProductUrlWrapperFallback = _args => identityUrlWrapper;
13
13
  const useSmartLinkCrossProductUrlWrapper = ({
14
14
  details
15
15
  }) => {
16
- var _product$toLowerCase;
16
+ var _effectiveProduct$toL;
17
17
  const {
18
18
  product,
19
- bridgeProduct
19
+ bridgeProduct,
20
+ xpcProduct,
21
+ xpcSubProduct
20
22
  } = useSmartLinkContext();
23
+ // xpcProduct takes precedence over product — it identifies the host product for XPC analytics
24
+ // without affecting link resolution (which uses the `product` prop separately).
25
+ const effectiveProduct = xpcProduct !== null && xpcProduct !== void 0 ? xpcProduct : product;
21
26
  const wrapUrl = useCrossProductUrlWrapper({
22
27
  bridge: bridgeProduct !== null && bridgeProduct !== void 0 ? bridgeProduct : SMART_LINKS_XPC_BRIDGE,
23
- product: (_product$toLowerCase = product === null || product === void 0 ? void 0 : product.toLowerCase()) !== null && _product$toLowerCase !== void 0 ? _product$toLowerCase : 'unknown'
28
+ product: (_effectiveProduct$toL = effectiveProduct === null || effectiveProduct === void 0 ? void 0 : effectiveProduct.toLowerCase()) !== null && _effectiveProduct$toL !== void 0 ? _effectiveProduct$toL : 'unknown',
29
+ ...(xpcSubProduct ? {
30
+ subProduct: xpcSubProduct
31
+ } : {})
24
32
  });
25
33
  return useCallback(url => {
26
- if (!getIsFirstPartyLink(details) || !product) {
34
+ if (!getIsFirstPartyLink(details) || !effectiveProduct) {
27
35
  return url;
28
36
  }
29
37
  let parsedUrl;
@@ -36,6 +44,6 @@ const useSmartLinkCrossProductUrlWrapper = ({
36
44
  return url;
37
45
  }
38
46
  return wrapUrl(url);
39
- }, [details, product, wrapUrl]);
47
+ }, [details, effectiveProduct, wrapUrl]);
40
48
  };
41
49
  export const useSmartLinkCrossProductUrlWrapperGated = functionWithFG('platform_smartlink_xpc_url_wrapping', useSmartLinkCrossProductUrlWrapper, useSmartLinkCrossProductUrlWrapperFallback);
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
2
2
  export const context = {
3
3
  componentName: 'smart-cards',
4
4
  packageName: "@atlaskit/smart-card" || '',
5
- packageVersion: "44.21.0" || ''
5
+ packageVersion: "44.23.0" || ''
6
6
  };
7
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
8
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -186,32 +186,9 @@ export const getLazyIcons = () => {
186
186
  default: () => import( /* webpackChunkName: "@atlaskit-internal_glyphSketch" */'@atlaskit/icon-file-type/glyph/sketch/16'),
187
187
  large: () => import( /* webpackChunkName: "@atlaskit-internal_glyphSketch" */'@atlaskit/icon-file-type/glyph/sketch/24')
188
188
  },
189
- // @atlaskit/object/* (object icons with 16/24 size variants)
190
- ...(fg('platform_sl_icons_refactor') ? {
191
- [IconType.Blog]: {
192
- default: () => import( /* webpackChunkName: "@atlaskit-internal_glyphBlog" */'@atlaskit/object/blog'),
193
- large: () => import( /* webpackChunkName: "@atlaskit-internal_glyphBlog" */'@atlaskit/object/tile/blog').then(module => ({
194
- default: props => /*#__PURE__*/React.createElement(module.default, _extends({}, props, {
195
- size: "small"
196
- }))
197
- }))
198
- },
199
- [IconType.LiveDocument]: {
200
- default: () => import( /* webpackChunkName: "@atlaskit-internal_glyphPageLiveDoc" */'@atlaskit/object/page-live-doc'),
201
- large: () => import( /* webpackChunkName: "@atlaskit-internal_glyphPageLiveDoc" */'@atlaskit/object/tile/page-live-doc').then(module => ({
202
- default: props => /*#__PURE__*/React.createElement(module.default, _extends({}, props, {
203
- size: "small"
204
- }))
205
- }))
206
- }
207
- } : {
208
- [IconType.Blog]: {
209
- default: () => import( /* webpackChunkName: "@atlaskit-internal_glyphBlock" */'../common/ui/icons/blog-icon')
210
- },
211
- [IconType.LiveDocument]: {
212
- default: () => import( /* webpackChunkName: "@atlaskit-internal_glyphPageLiveDoc" */'../common/ui/icons/live-document-icon')
213
- }
214
- }),
189
+ // Keep blog/live-document out of the lazy map on purpose.
190
+ // These icons should be present in SSR markup so hydration does not cause
191
+ // a visible empty-state-then-pop-in transition in Smart Link consumers.
215
192
  [IconType.Branch]: {
216
193
  default: () => import( /* webpackChunkName: "@atlaskit-internal_glyphBranch" */'@atlaskit/object/branch'),
217
194
  large: () => import( /* webpackChunkName: "@atlaskit-internal_glyphBranch" */'@atlaskit/object/tile/branch').then(module => ({
@@ -33,42 +33,40 @@ const AtlaskitIcon = ({
33
33
  size = SmartLinkSize.Medium,
34
34
  isTiledIcon
35
35
  }) => {
36
- if (!fg('platform_sl_icons_refactor')) {
37
- // Check for synchronously loaded icons first for SSR purposes.
38
- // Require these icons only inside this branch to avoid evaluating legacy icon
39
- // wrapper modules when the icon refactor is enabled.
40
- switch (icon) {
41
- case IconType.Document:
42
- {
43
- const DocumentIcon = getDocumentIcon();
44
- return /*#__PURE__*/React.createElement(DocumentIcon, {
45
- label: label !== null && label !== void 0 ? label : 'document',
46
- testId: testId,
47
- size: size,
48
- isTiledIcon: isTiledIcon
49
- });
50
- }
51
- case IconType.Blog:
52
- {
53
- const BlogIcon = getBlogIcon();
54
- return /*#__PURE__*/React.createElement(BlogIcon, {
55
- label: label !== null && label !== void 0 ? label : 'blog',
56
- testId: testId,
57
- size: size,
58
- isTiledIcon: isTiledIcon
59
- });
60
- }
61
- case IconType.LiveDocument:
62
- {
63
- const LiveDocumentIcon = getLiveDocumentIcon();
64
- return /*#__PURE__*/React.createElement(LiveDocumentIcon, {
65
- label: label !== null && label !== void 0 ? label : 'live-doc',
66
- testId: testId,
67
- size: size,
68
- isTiledIcon: isTiledIcon
69
- });
70
- }
71
- }
36
+ // Intentionally keep these three icon types synchronous and outside lazy imports.
37
+ // These icons should be present in SSR markup so hydration does not cause a
38
+ // visible empty-state-then-pop-in transition in Smart Link consumers.
39
+ switch (icon) {
40
+ case IconType.Document:
41
+ {
42
+ const DocumentIcon = getDocumentIcon();
43
+ return /*#__PURE__*/React.createElement(DocumentIcon, {
44
+ label: label !== null && label !== void 0 ? label : 'document',
45
+ testId: testId,
46
+ size: size,
47
+ isTiledIcon: isTiledIcon
48
+ });
49
+ }
50
+ case IconType.Blog:
51
+ {
52
+ const BlogIcon = getBlogIcon();
53
+ return /*#__PURE__*/React.createElement(BlogIcon, {
54
+ label: label !== null && label !== void 0 ? label : 'blog',
55
+ testId: testId,
56
+ size: size,
57
+ isTiledIcon: isTiledIcon
58
+ });
59
+ }
60
+ case IconType.LiveDocument:
61
+ {
62
+ const LiveDocumentIcon = getLiveDocumentIcon();
63
+ return /*#__PURE__*/React.createElement(LiveDocumentIcon, {
64
+ label: label !== null && label !== void 0 ? label : 'live-doc',
65
+ testId: testId,
66
+ size: size,
67
+ isTiledIcon: isTiledIcon
68
+ });
69
+ }
72
70
  }
73
71
  const importFn = getIconImportFn(icon, size);
74
72
  if (!importFn) {
@@ -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: "44.21.0",
12
+ packageVersion: "44.23.0",
13
13
  componentName: 'linkUrl'
14
14
  };
15
15
  const LinkUrl = ({
@@ -1,3 +1,3 @@
1
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:d750a5131240af4f7d635606bfe3b2d20b734bd64e7ba8b3ced70d4fc666f41b
3
- size 22011
2
+ oid sha256:e4e629c90112ffa47189f9d7084394fcd9a217bf624a1b05b5adb76909268c96
3
+ size 22340
@@ -1,3 +1,3 @@
1
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:94d62ea32479515465c359fbb0e4c962187bae2f87a37231f9de61788071fec6
3
- size 36260
2
+ oid sha256:9d850871e06f9ed1baa276db443eb1747b92e8d5576bbe2af83f7978ddff4652
3
+ size 36435
@@ -1,3 +1,3 @@
1
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5dd0715aa5a28d5dc0263fc187627914219ace1c9cf49a379e2d207b5e622d15
3
- size 218534
2
+ oid sha256:889ac946e251a99b4da6d9a75cab61cdd97a1649ead5018faa97d6e9a180e9f0
3
+ size 218408
@@ -1,3 +1,3 @@
1
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5dd0715aa5a28d5dc0263fc187627914219ace1c9cf49a379e2d207b5e622d15
3
- size 218534
2
+ oid sha256:889ac946e251a99b4da6d9a75cab61cdd97a1649ead5018faa97d6e9a180e9f0
3
+ size 218408
@@ -1,3 +1,3 @@
1
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5c8db1939f2c20b398ba8513683b382e45bd1fdd49be7c2c9b265f45b7a157af
3
- size 218745
2
+ oid sha256:d3d9be35e64429a385cfdbfb97e6acf1c220377632d238d33bf9fa42bfa03155
3
+ size 218616
@@ -1,3 +1,3 @@
1
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5c8db1939f2c20b398ba8513683b382e45bd1fdd49be7c2c9b265f45b7a157af
3
- size 218745
2
+ oid sha256:d3d9be35e64429a385cfdbfb97e6acf1c220377632d238d33bf9fa42bfa03155
3
+ size 218616
@@ -1,8 +1,6 @@
1
1
  import React from 'react';
2
2
  import DocumentFilledIcon from '@atlaskit/icon/core/file';
3
3
  import { isConfluenceGenerator } from '@atlaskit/link-extractors';
4
- import BlogIconObject from '@atlaskit/object/blog';
5
- import LiveDocumentIconObject from '@atlaskit/object/page-live-doc';
6
4
  import { fg } from '@atlaskit/platform-feature-flags';
7
5
  import { getIconForFileType } from '../../../utils';
8
6
  import { prioritiseIcon } from './prioritiseIcon';
@@ -59,12 +57,9 @@ var documentTypeToIcon = function documentTypeToIcon(type, opts) {
59
57
  switch (type) {
60
58
  case 'schema:BlogPosting':
61
59
  {
62
- if (fg('platform_sl_icons_refactor')) {
63
- return /*#__PURE__*/React.createElement(BlogIconObject, {
64
- label: documentLabel(opts, 'blog'),
65
- testId: "blog-icon"
66
- });
67
- }
60
+ // Intentionally keep this icon on a synchronous require()-based path.
61
+ // This icon must be present in SSR markup so hydration does not cause a
62
+ // visible empty-state-then-pop-in transition for Smart Links.
68
63
  var BlogIconWrapped = getBlogIconWrapped();
69
64
  return /*#__PURE__*/React.createElement(BlogIconWrapped, {
70
65
  label: documentLabel(opts, 'blog'),
@@ -125,12 +120,9 @@ var documentTypeToIcon = function documentTypeToIcon(type, opts) {
125
120
  var digitalDocumentToIcon = function digitalDocumentToIcon(opts) {
126
121
  var _opts$provider;
127
122
  if ((_opts$provider = opts.provider) !== null && _opts$provider !== void 0 && _opts$provider.id && isConfluenceGenerator(opts.provider.id)) {
128
- if (fg('platform_sl_icons_refactor')) {
129
- return /*#__PURE__*/React.createElement(LiveDocumentIconObject, {
130
- label: documentLabel(opts, 'live document'),
131
- testId: "live-doc-icon"
132
- });
133
- }
123
+ // Intentionally keep this icon on a synchronous require()-based path.
124
+ // This icon must be present in SSR markup so hydration does not cause a
125
+ // visible empty-state-then-pop-in transition for Smart Links.
134
126
  var LiveDocumentIconWrapped = getLiveDocumentIconWrapped();
135
127
  return /*#__PURE__*/React.createElement(LiveDocumentIconWrapped, {
136
128
  label: documentLabel(opts, 'live document'),
@@ -1,3 +1,6 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ 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; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1
4
  import { useCallback } from 'react';
2
5
  import { useCrossProductUrlWrapper } from '@atlaskit/analytics-cross-product/useCrossProductUrlWrapper';
3
6
  import { useSmartLinkContext } from '@atlaskit/link-provider';
@@ -15,17 +18,24 @@ var useSmartLinkCrossProductUrlWrapperFallback = function useSmartLinkCrossProdu
15
18
  return identityUrlWrapper;
16
19
  };
17
20
  var useSmartLinkCrossProductUrlWrapper = function useSmartLinkCrossProductUrlWrapper(_ref) {
18
- var _product$toLowerCase;
21
+ var _effectiveProduct$toL;
19
22
  var details = _ref.details;
20
23
  var _useSmartLinkContext = useSmartLinkContext(),
21
24
  product = _useSmartLinkContext.product,
22
- bridgeProduct = _useSmartLinkContext.bridgeProduct;
23
- var wrapUrl = useCrossProductUrlWrapper({
25
+ bridgeProduct = _useSmartLinkContext.bridgeProduct,
26
+ xpcProduct = _useSmartLinkContext.xpcProduct,
27
+ xpcSubProduct = _useSmartLinkContext.xpcSubProduct;
28
+ // xpcProduct takes precedence over product — it identifies the host product for XPC analytics
29
+ // without affecting link resolution (which uses the `product` prop separately).
30
+ var effectiveProduct = xpcProduct !== null && xpcProduct !== void 0 ? xpcProduct : product;
31
+ var wrapUrl = useCrossProductUrlWrapper(_objectSpread({
24
32
  bridge: bridgeProduct !== null && bridgeProduct !== void 0 ? bridgeProduct : SMART_LINKS_XPC_BRIDGE,
25
- product: (_product$toLowerCase = product === null || product === void 0 ? void 0 : product.toLowerCase()) !== null && _product$toLowerCase !== void 0 ? _product$toLowerCase : 'unknown'
26
- });
33
+ product: (_effectiveProduct$toL = effectiveProduct === null || effectiveProduct === void 0 ? void 0 : effectiveProduct.toLowerCase()) !== null && _effectiveProduct$toL !== void 0 ? _effectiveProduct$toL : 'unknown'
34
+ }, xpcSubProduct ? {
35
+ subProduct: xpcSubProduct
36
+ } : {}));
27
37
  return useCallback(function (url) {
28
- if (!getIsFirstPartyLink(details) || !product) {
38
+ if (!getIsFirstPartyLink(details) || !effectiveProduct) {
29
39
  return url;
30
40
  }
31
41
  var parsedUrl;
@@ -38,6 +48,6 @@ var useSmartLinkCrossProductUrlWrapper = function useSmartLinkCrossProductUrlWra
38
48
  return url;
39
49
  }
40
50
  return wrapUrl(url);
41
- }, [details, product, wrapUrl]);
51
+ }, [details, effectiveProduct, wrapUrl]);
42
52
  };
43
53
  export var useSmartLinkCrossProductUrlWrapperGated = functionWithFG('platform_smartlink_xpc_url_wrapping', useSmartLinkCrossProductUrlWrapper, useSmartLinkCrossProductUrlWrapperFallback);
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
4
4
  export var context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card" || '',
7
- packageVersion: "44.21.0" || ''
7
+ packageVersion: "44.23.0" || ''
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,10 +1,8 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
- import _extends from "@babel/runtime/helpers/extends";
3
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ import _extends from "@babel/runtime/helpers/extends";
4
4
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
5
5
  import _regeneratorRuntime from "@babel/runtime/regenerator";
6
- 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; }
7
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
8
6
  import React from 'react';
9
7
  import Loadable from 'react-loadable';
10
8
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -74,8 +72,8 @@ export var getIconForFileType = function getIconForFileType(fileMimeType, showIc
74
72
  };
75
73
  // prettier-ignore
76
74
  export var getLazyIcons = function getLazyIcons() {
77
- var _objectSpread2, _objectSpread3;
78
- return _objectSpread(_objectSpread((_objectSpread2 = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_objectSpread2, IconType.Document, {
75
+ var _ref3;
76
+ return _ref3 = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref3, IconType.Document, {
79
77
  default: function _default() {
80
78
  return import( /* webpackChunkName: "@atlaskit-internal_page-icon" */'../common/ui/icons/page-icon');
81
79
  }
@@ -115,7 +113,7 @@ export var getLazyIcons = function getLazyIcons() {
115
113
  default: function _default() {
116
114
  return import( /* webpackChunkName: "@atlaskit-internal_video-icon" */'../common/ui/icons/video-icon');
117
115
  }
118
- }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_objectSpread2, IconType.Project, {
116
+ }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref3, IconType.Project, {
119
117
  default: function _default() {
120
118
  return import( /* webpackChunkName: "@atlaskit-internal_glyphProject" */'@atlaskit/icon/core/people-group');
121
119
  }
@@ -155,7 +153,7 @@ export var getLazyIcons = function getLazyIcons() {
155
153
  default: function _default() {
156
154
  return import( /* webpackChunkName: "@atlaskit-internal_glyphComment" */'@atlaskit/icon/core/eye-open');
157
155
  }
158
- }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_objectSpread2, IconType.React, {
156
+ }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref3, IconType.React, {
159
157
  default: function _default() {
160
158
  return import( /* webpackChunkName: "@atlaskit-internal_glyphComment" */'@atlaskit/icon/core/thumbs-up');
161
159
  }
@@ -207,7 +205,7 @@ export var getLazyIcons = function getLazyIcons() {
207
205
  large: function large() {
208
206
  return import( /* webpackChunkName: "@atlaskit-internal_glyphGoogleDocs" */'@atlaskit/icon-file-type/glyph/google-doc/24');
209
207
  }
210
- }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_objectSpread2, IconType.GoogleForms, {
208
+ }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref3, IconType.GoogleForms, {
211
209
  default: function _default() {
212
210
  return import( /* webpackChunkName: "@atlaskit-internal_glyphGoogleForms" */'@atlaskit/icon-file-type/glyph/google-form/16');
213
211
  },
@@ -263,45 +261,7 @@ export var getLazyIcons = function getLazyIcons() {
263
261
  large: function large() {
264
262
  return import( /* webpackChunkName: "@atlaskit-internal_glyphSketch" */'@atlaskit/icon-file-type/glyph/sketch/24');
265
263
  }
266
- })), fg('platform_sl_icons_refactor') ? _defineProperty(_defineProperty({}, IconType.Blog, {
267
- default: function _default() {
268
- return import( /* webpackChunkName: "@atlaskit-internal_glyphBlog" */'@atlaskit/object/blog');
269
- },
270
- large: function large() {
271
- return import( /* webpackChunkName: "@atlaskit-internal_glyphBlog" */'@atlaskit/object/tile/blog').then(function (module) {
272
- return {
273
- default: function _default(props) {
274
- return /*#__PURE__*/React.createElement(module.default, _extends({}, props, {
275
- size: "small"
276
- }));
277
- }
278
- };
279
- });
280
- }
281
- }), IconType.LiveDocument, {
282
- default: function _default() {
283
- return import( /* webpackChunkName: "@atlaskit-internal_glyphPageLiveDoc" */'@atlaskit/object/page-live-doc');
284
- },
285
- large: function large() {
286
- return import( /* webpackChunkName: "@atlaskit-internal_glyphPageLiveDoc" */'@atlaskit/object/tile/page-live-doc').then(function (module) {
287
- return {
288
- default: function _default(props) {
289
- return /*#__PURE__*/React.createElement(module.default, _extends({}, props, {
290
- size: "small"
291
- }));
292
- }
293
- };
294
- });
295
- }
296
- }) : _defineProperty(_defineProperty({}, IconType.Blog, {
297
- default: function _default() {
298
- return import( /* webpackChunkName: "@atlaskit-internal_glyphBlock" */'../common/ui/icons/blog-icon');
299
- }
300
- }), IconType.LiveDocument, {
301
- default: function _default() {
302
- return import( /* webpackChunkName: "@atlaskit-internal_glyphPageLiveDoc" */'../common/ui/icons/live-document-icon');
303
- }
304
- })), {}, (_objectSpread3 = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_objectSpread3, IconType.Branch, {
264
+ }), IconType.Branch, {
305
265
  default: function _default() {
306
266
  return import( /* webpackChunkName: "@atlaskit-internal_glyphBranch" */'@atlaskit/object/branch');
307
267
  },
@@ -331,7 +291,7 @@ export var getLazyIcons = function getLazyIcons() {
331
291
  };
332
292
  });
333
293
  }
334
- }), IconType.PullRequest, {
294
+ }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref3, IconType.PullRequest, {
335
295
  default: function _default() {
336
296
  return import( /* webpackChunkName: "@atlaskit-internal_glyphPullRequest" */'@atlaskit/object/pull-request');
337
297
  },
@@ -451,7 +411,7 @@ export var getLazyIcons = function getLazyIcons() {
451
411
  };
452
412
  });
453
413
  }
454
- }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_objectSpread3, IconType.Story, {
414
+ }), IconType.Story, {
455
415
  default: function _default() {
456
416
  return import( /* webpackChunkName: "@atlaskit-internal_glyphStory" */'@atlaskit/object/story');
457
417
  },
@@ -481,7 +441,7 @@ export var getLazyIcons = function getLazyIcons() {
481
441
  };
482
442
  });
483
443
  }
484
- }), IconType.Task, {
444
+ }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref3, IconType.Task, {
485
445
  default: function _default() {
486
446
  return import( /* webpackChunkName: "@atlaskit-internal_glyphTask" */'@atlaskit/object/task');
487
447
  },
@@ -498,8 +458,8 @@ export var getLazyIcons = function getLazyIcons() {
498
458
  }
499
459
  }), IconType.Confluence, {
500
460
  default: function _default() {
501
- return import( /* webpackChunkName: "@atlaskit-internal_glyphConfluence" */'@atlaskit/logo/confluence-icon').then(function (_ref3) {
502
- var ConfluenceIcon = _ref3.ConfluenceIcon;
461
+ return import( /* webpackChunkName: "@atlaskit-internal_glyphConfluence" */'@atlaskit/logo/confluence-icon').then(function (_ref) {
462
+ var ConfluenceIcon = _ref.ConfluenceIcon;
503
463
  return {
504
464
  default: ConfluenceIcon
505
465
  };
@@ -507,8 +467,8 @@ export var getLazyIcons = function getLazyIcons() {
507
467
  }
508
468
  }), IconType.Jira, {
509
469
  default: function _default() {
510
- return import( /* webpackChunkName: "@atlaskit-internal_glyphJira" */'@atlaskit/logo/jira-icon').then(function (_ref4) {
511
- var JiraIcon = _ref4.JiraIcon;
470
+ return import( /* webpackChunkName: "@atlaskit-internal_glyphJira" */'@atlaskit/logo/jira-icon').then(function (_ref2) {
471
+ var JiraIcon = _ref2.JiraIcon;
512
472
  return {
513
473
  default: JiraIcon
514
474
  };
@@ -534,7 +494,7 @@ export var getLazyIcons = function getLazyIcons() {
534
494
  default: function _default() {
535
495
  return import( /* webpackChunkName: "@atlaskit-internal_glyphLow" */'../common/ui/icons/priority-low-icon');
536
496
  }
537
- }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_objectSpread3, IconType.PriorityLowest, {
497
+ }), IconType.PriorityLowest, {
538
498
  default: function _default() {
539
499
  return import( /* webpackChunkName: "@atlaskit-internal_glyphLowest" */'../common/ui/icons/priority-lowest-icon');
540
500
  }
@@ -542,7 +502,7 @@ export var getLazyIcons = function getLazyIcons() {
542
502
  default: function _default() {
543
503
  return import( /* webpackChunkName: "@atlaskit-internal_glyphMajor" */'../common/ui/icons/priority-major-icon');
544
504
  }
545
- }), IconType.PriorityMedium, {
505
+ }), _defineProperty(_defineProperty(_defineProperty(_ref3, IconType.PriorityMedium, {
546
506
  default: function _default() {
547
507
  return import( /* webpackChunkName: "@atlaskit-internal_glyphMedium" */'../common/ui/icons/priority-medium-icon');
548
508
  }
@@ -554,7 +514,7 @@ export var getLazyIcons = function getLazyIcons() {
554
514
  default: function _default() {
555
515
  return import( /* webpackChunkName: "@atlaskit-internal_glyphTrivial" */'../common/ui/icons/priority-trivial-icon');
556
516
  }
557
- })));
517
+ });
558
518
  };
559
519
  var getTypeToIconMap = function getTypeToIconMap(fileFormat) {
560
520
  var iconDescriptor = extractFileFormatIcon(fileFormat);
@@ -593,7 +553,7 @@ export var sleep = function sleep(ms) {
593
553
  });
594
554
  };
595
555
  var _importWithRetry = /*#__PURE__*/function () {
596
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(importFn) {
556
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(importFn) {
597
557
  var retries,
598
558
  interval,
599
559
  _args = arguments,
@@ -628,12 +588,12 @@ var _importWithRetry = /*#__PURE__*/function () {
628
588
  }, _callee, null, [[1, 3]]);
629
589
  }));
630
590
  return function importWithRetry(_x) {
631
- return _ref5.apply(this, arguments);
591
+ return _ref4.apply(this, arguments);
632
592
  };
633
593
  }();
634
594
  export { _importWithRetry as importWithRetry };
635
595
  export var downloadUrl = /*#__PURE__*/function () {
636
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(url) {
596
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(url) {
637
597
  var isIE11, isSafari, iframeName, link, iframe;
638
598
  return _regeneratorRuntime.wrap(function (_context2) {
639
599
  while (1) switch (_context2.prev = _context2.next) {
@@ -669,11 +629,11 @@ export var downloadUrl = /*#__PURE__*/function () {
669
629
  }, _callee2);
670
630
  }));
671
631
  return function downloadUrl(_x2) {
672
- return _ref6.apply(this, arguments);
632
+ return _ref5.apply(this, arguments);
673
633
  };
674
634
  }();
675
635
  export var openUrl = /*#__PURE__*/function () {
676
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(url) {
636
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(url) {
677
637
  return _regeneratorRuntime.wrap(function (_context3) {
678
638
  while (1) switch (_context3.prev = _context3.next) {
679
639
  case 0:
@@ -691,7 +651,7 @@ export var openUrl = /*#__PURE__*/function () {
691
651
  }, _callee3);
692
652
  }));
693
653
  return function openUrl(_x3) {
694
- return _ref7.apply(this, arguments);
654
+ return _ref6.apply(this, arguments);
695
655
  };
696
656
  }();
697
657
 
@@ -45,42 +45,40 @@ var AtlaskitIcon = function AtlaskitIcon(_ref) {
45
45
  _ref$size = _ref.size,
46
46
  size = _ref$size === void 0 ? SmartLinkSize.Medium : _ref$size,
47
47
  isTiledIcon = _ref.isTiledIcon;
48
- if (!fg('platform_sl_icons_refactor')) {
49
- // Check for synchronously loaded icons first for SSR purposes.
50
- // Require these icons only inside this branch to avoid evaluating legacy icon
51
- // wrapper modules when the icon refactor is enabled.
52
- switch (icon) {
53
- case IconType.Document:
54
- {
55
- var DocumentIcon = getDocumentIcon();
56
- return /*#__PURE__*/React.createElement(DocumentIcon, {
57
- label: label !== null && label !== void 0 ? label : 'document',
58
- testId: testId,
59
- size: size,
60
- isTiledIcon: isTiledIcon
61
- });
62
- }
63
- case IconType.Blog:
64
- {
65
- var BlogIcon = getBlogIcon();
66
- return /*#__PURE__*/React.createElement(BlogIcon, {
67
- label: label !== null && label !== void 0 ? label : 'blog',
68
- testId: testId,
69
- size: size,
70
- isTiledIcon: isTiledIcon
71
- });
72
- }
73
- case IconType.LiveDocument:
74
- {
75
- var LiveDocumentIcon = getLiveDocumentIcon();
76
- return /*#__PURE__*/React.createElement(LiveDocumentIcon, {
77
- label: label !== null && label !== void 0 ? label : 'live-doc',
78
- testId: testId,
79
- size: size,
80
- isTiledIcon: isTiledIcon
81
- });
82
- }
83
- }
48
+ // Intentionally keep these three icon types synchronous and outside lazy imports.
49
+ // These icons should be present in SSR markup so hydration does not cause a
50
+ // visible empty-state-then-pop-in transition in Smart Link consumers.
51
+ switch (icon) {
52
+ case IconType.Document:
53
+ {
54
+ var DocumentIcon = getDocumentIcon();
55
+ return /*#__PURE__*/React.createElement(DocumentIcon, {
56
+ label: label !== null && label !== void 0 ? label : 'document',
57
+ testId: testId,
58
+ size: size,
59
+ isTiledIcon: isTiledIcon
60
+ });
61
+ }
62
+ case IconType.Blog:
63
+ {
64
+ var BlogIcon = getBlogIcon();
65
+ return /*#__PURE__*/React.createElement(BlogIcon, {
66
+ label: label !== null && label !== void 0 ? label : 'blog',
67
+ testId: testId,
68
+ size: size,
69
+ isTiledIcon: isTiledIcon
70
+ });
71
+ }
72
+ case IconType.LiveDocument:
73
+ {
74
+ var LiveDocumentIcon = getLiveDocumentIcon();
75
+ return /*#__PURE__*/React.createElement(LiveDocumentIcon, {
76
+ label: label !== null && label !== void 0 ? label : 'live-doc',
77
+ testId: testId,
78
+ size: size,
79
+ isTiledIcon: isTiledIcon
80
+ });
81
+ }
84
82
  }
85
83
  var importFn = getIconImportFn(icon, size);
86
84
  if (!importFn) {
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
12
12
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
13
13
  var PACKAGE_DATA = {
14
14
  packageName: "@atlaskit/smart-card",
15
- packageVersion: "44.21.0",
15
+ packageVersion: "44.23.0",
16
16
  componentName: 'linkUrl'
17
17
  };
18
18
  var LinkUrl = function LinkUrl(_ref) {