@atlaskit/smart-card 44.22.0 → 44.23.0

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 CHANGED
@@ -1,5 +1,16 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 44.23.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`d890e9e688ce5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d890e9e688ce5) -
8
+ Exposed subproduct and product for jira and townsquare
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
3
14
  ## 44.22.0
4
15
 
5
16
  ### Minor Changes
@@ -1,13 +1,17 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.useSmartLinkCrossProductUrlWrapperGated = exports.getIsFirstPartyLink = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
9
  var _react = require("react");
8
10
  var _useCrossProductUrlWrapper = require("@atlaskit/analytics-cross-product/useCrossProductUrlWrapper");
9
11
  var _linkProvider = require("@atlaskit/link-provider");
10
12
  var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
13
+ 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; }
14
+ 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) { (0, _defineProperty2.default)(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; }
11
15
  var SMART_LINKS_XPC_BRIDGE = 'smartLinks';
12
16
  var XPC_QUERY_PARAM = 'xpis';
13
17
  var getIsFirstPartyLink = exports.getIsFirstPartyLink = function getIsFirstPartyLink(details) {
@@ -21,17 +25,24 @@ var useSmartLinkCrossProductUrlWrapperFallback = function useSmartLinkCrossProdu
21
25
  return identityUrlWrapper;
22
26
  };
23
27
  var useSmartLinkCrossProductUrlWrapper = function useSmartLinkCrossProductUrlWrapper(_ref) {
24
- var _product$toLowerCase;
28
+ var _effectiveProduct$toL;
25
29
  var details = _ref.details;
26
30
  var _useSmartLinkContext = (0, _linkProvider.useSmartLinkContext)(),
27
31
  product = _useSmartLinkContext.product,
28
- bridgeProduct = _useSmartLinkContext.bridgeProduct;
29
- var wrapUrl = (0, _useCrossProductUrlWrapper.useCrossProductUrlWrapper)({
32
+ bridgeProduct = _useSmartLinkContext.bridgeProduct,
33
+ xpcProduct = _useSmartLinkContext.xpcProduct,
34
+ xpcSubProduct = _useSmartLinkContext.xpcSubProduct;
35
+ // xpcProduct takes precedence over product — it identifies the host product for XPC analytics
36
+ // without affecting link resolution (which uses the `product` prop separately).
37
+ var effectiveProduct = xpcProduct !== null && xpcProduct !== void 0 ? xpcProduct : product;
38
+ var wrapUrl = (0, _useCrossProductUrlWrapper.useCrossProductUrlWrapper)(_objectSpread({
30
39
  bridge: bridgeProduct !== null && bridgeProduct !== void 0 ? bridgeProduct : SMART_LINKS_XPC_BRIDGE,
31
- product: (_product$toLowerCase = product === null || product === void 0 ? void 0 : product.toLowerCase()) !== null && _product$toLowerCase !== void 0 ? _product$toLowerCase : 'unknown'
32
- });
40
+ product: (_effectiveProduct$toL = effectiveProduct === null || effectiveProduct === void 0 ? void 0 : effectiveProduct.toLowerCase()) !== null && _effectiveProduct$toL !== void 0 ? _effectiveProduct$toL : 'unknown'
41
+ }, xpcSubProduct ? {
42
+ subProduct: xpcSubProduct
43
+ } : {}));
33
44
  return (0, _react.useCallback)(function (url) {
34
- if (!getIsFirstPartyLink(details) || !product) {
45
+ if (!getIsFirstPartyLink(details) || !effectiveProduct) {
35
46
  return url;
36
47
  }
37
48
  var parsedUrl;
@@ -44,6 +55,6 @@ var useSmartLinkCrossProductUrlWrapper = function useSmartLinkCrossProductUrlWra
44
55
  return url;
45
56
  }
46
57
  return wrapUrl(url);
47
- }, [details, product, wrapUrl]);
58
+ }, [details, effectiveProduct, wrapUrl]);
48
59
  };
49
60
  var useSmartLinkCrossProductUrlWrapperGated = exports.useSmartLinkCrossProductUrlWrapperGated = (0, _platformFeatureFlagsReact.functionWithFG)('platform_smartlink_xpc_url_wrapping', useSmartLinkCrossProductUrlWrapper, useSmartLinkCrossProductUrlWrapperFallback);
@@ -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: "44.21.0" || ''
14
+ packageVersion: "44.22.0" || ''
15
15
  };
16
16
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
17
17
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -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: "44.21.0",
22
+ packageVersion: "44.22.0",
23
23
  componentName: 'linkUrl'
24
24
  };
25
25
  var LinkUrl = function LinkUrl(_ref) {
@@ -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.22.0" || ''
6
6
  };
7
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
8
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -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.22.0",
13
13
  componentName: 'linkUrl'
14
14
  };
15
15
  const LinkUrl = ({
@@ -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.22.0" || ''
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -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.22.0",
16
16
  componentName: 'linkUrl'
17
17
  };
18
18
  var LinkUrl = function LinkUrl(_ref) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "44.22.0",
3
+ "version": "44.23.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -107,7 +107,7 @@
107
107
  "uuid": "^3.1.0"
108
108
  },
109
109
  "peerDependencies": {
110
- "@atlaskit/link-provider": "^4.5.0",
110
+ "@atlaskit/link-provider": "^4.6.0",
111
111
  "react": "^18.2.0",
112
112
  "react-dom": "^18.2.0",
113
113
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"