@atlaskit/link-datasource 6.11.2 → 6.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # @atlaskit/link-datasource
2
2
 
3
+ ## 6.12.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b94131fcee276`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b94131fcee276) -
8
+ Removes the `platform_smartlink_xpc_url_wrapping` feature gate and makes cross-product URL
9
+ wrapping for Smart Links permanent, on for all consumers.
10
+
11
+ What this behavior does: when a resolved Smart Link points to a first-party Atlassian destination
12
+ (e.g. a Jira issue, Confluence page), the URL used for navigation — via click, "Open link", or any
13
+ other destination-URL usage — now has a short-lived interaction-session query parameter (`xpis`)
14
+ appended automatically. This lets the destination product attribute the visit back to the product
15
+ and surface the link was opened from, powering cross-product usage analytics. It has no effect on:
16
+ - third-party (non-Atlassian) links,
17
+ - links that are not yet resolved,
18
+ - URLs that already contain the parameter.
19
+
20
+ No API shape changes: this only affects the resolved value returned by existing Smart Link
21
+ URL/navigation behavior (e.g. `Card`, `useSmartLinkDestinationUrl`, inline/block/embed card
22
+ click-through, and datasource table link cells). No new props, exports, or configuration are
23
+ introduced, and no action is required from consumers.
24
+
25
+ - Updated dependencies
26
+
27
+ ## 6.12.0
28
+
29
+ ### Minor Changes
30
+
31
+ - [`942e8a15cbdf1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/942e8a15cbdf1) -
32
+ Update i18n NPM package versions for linking-platform,smart-experiences (Group 15)
33
+
34
+ ### Patch Changes
35
+
36
+ - Updated dependencies
37
+
3
38
  ## 6.11.2
4
39
 
5
40
  ### Patch Changes
@@ -25,24 +25,42 @@ var linkStyles = {
25
25
  default: {}
26
26
  };
27
27
  var LINK_TYPE_TEST_ID = exports.LINK_TYPE_TEST_ID = 'link-datasource-render-type--link';
28
- var LinkRenderType = function LinkRenderType(_ref) {
29
- var style = _ref.style,
30
- url = _ref.url,
31
- text = _ref.text,
32
- _ref$testId = _ref.testId,
33
- testId = _ref$testId === void 0 ? LINK_TYPE_TEST_ID : _ref$testId;
28
+ var SmartCard = function SmartCard(_ref) {
29
+ var url = _ref.url,
30
+ crossProductUrl = _ref.crossProductUrl,
31
+ testId = _ref.testId,
32
+ _fallbackComponent = _ref.fallbackComponent;
33
+ var handleClick = function handleClick(event) {
34
+ event.preventDefault();
35
+ window.open(crossProductUrl, '_blank', 'noopener, noreferrer');
36
+ };
37
+ return /*#__PURE__*/_react.default.createElement(_smartCard.Card, {
38
+ appearance: "inline",
39
+ onClick: handleClick,
40
+ url: url,
41
+ testId: testId,
42
+ fallbackComponent: function fallbackComponent() {
43
+ return _fallbackComponent;
44
+ }
45
+ });
46
+ };
47
+ var LinkRenderTypeWithXpcWrappingUrl = function LinkRenderTypeWithXpcWrappingUrl(_ref2) {
48
+ var style = _ref2.style,
49
+ url = _ref2.url,
50
+ text = _ref2.text,
51
+ _ref2$testId = _ref2.testId,
52
+ testId = _ref2$testId === void 0 ? LINK_TYPE_TEST_ID : _ref2$testId;
34
53
  var _useIntl = (0, _reactIntl.useIntl)(),
35
54
  formatMessage = _useIntl.formatMessage;
36
55
  var linkStyle = (0, _react.useMemo)(function () {
37
56
  return (style === null || style === void 0 ? void 0 : style.appearance) && linkStyles[style.appearance] || {};
38
57
  }, [style]);
39
58
  var destinationUrl = (0, _useSmartLinkDestinationUrl.useSmartLinkDestinationUrl)(url);
40
- var crossProductUrlGated = (0, _fg.fg)('electric_issue_like_table_xpc_url_wrapping') ? destinationUrl : url;
41
59
  var anchor = (0, _react.useMemo)(function () {
42
60
  return /*#__PURE__*/_react.default.createElement(_hoverCard.HoverCard, {
43
61
  url: url
44
62
  }, /*#__PURE__*/_react.default.createElement(_linkUrl.default, {
45
- href: crossProductUrlGated
63
+ href: destinationUrl
46
64
  // NOTE: This will no longer apply styles to `@atlaskit/link`.
47
65
  // Wrap `@atlaskit/link` in a Text component to provide font styles to Link
48
66
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
@@ -51,11 +69,48 @@ var LinkRenderType = function LinkRenderType(_ref) {
51
69
  "data-testid": testId,
52
70
  target: "_blank"
53
71
  }, text || url, /*#__PURE__*/_react.default.createElement(_visuallyHidden.default, null, " ".concat(formatMessage(_messages.messages.opensInNewTab)))));
54
- }, [linkStyle, url, text, testId, formatMessage, crossProductUrlGated]);
72
+ }, [linkStyle, url, text, testId, formatMessage, destinationUrl]);
73
+
74
+ // url can be undefined before data is fetched whilst adding new link column to display
75
+ if (!url) {
76
+ return null;
77
+ }
78
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, text ? anchor : /*#__PURE__*/_react.default.createElement(SmartCard, {
79
+ url: url,
80
+ crossProductUrl: destinationUrl,
81
+ testId: testId,
82
+ fallbackComponent: anchor
83
+ }), /*#__PURE__*/_react.default.createElement("br", null));
84
+ };
85
+ var LinkRenderType = function LinkRenderType(_ref3) {
86
+ var style = _ref3.style,
87
+ url = _ref3.url,
88
+ text = _ref3.text,
89
+ _ref3$testId = _ref3.testId,
90
+ testId = _ref3$testId === void 0 ? LINK_TYPE_TEST_ID : _ref3$testId;
91
+ var _useIntl2 = (0, _reactIntl.useIntl)(),
92
+ formatMessage = _useIntl2.formatMessage;
93
+ var linkStyle = (0, _react.useMemo)(function () {
94
+ return (style === null || style === void 0 ? void 0 : style.appearance) && linkStyles[style.appearance] || {};
95
+ }, [style]);
96
+ var anchor = (0, _react.useMemo)(function () {
97
+ return /*#__PURE__*/_react.default.createElement(_hoverCard.HoverCard, {
98
+ url: url
99
+ }, /*#__PURE__*/_react.default.createElement(_linkUrl.default, {
100
+ href: url
101
+ // NOTE: This will no longer apply styles to `@atlaskit/link`.
102
+ // Wrap `@atlaskit/link` in a Text component to provide font styles to Link
103
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
104
+ ,
105
+ style: linkStyle,
106
+ "data-testid": testId,
107
+ target: "_blank"
108
+ }, text || url, /*#__PURE__*/_react.default.createElement(_visuallyHidden.default, null, " ".concat(formatMessage(_messages.messages.opensInNewTab)))));
109
+ }, [linkStyle, url, text, testId, formatMessage]);
55
110
  var SmartCard = function SmartCard() {
56
111
  var handleClick = function handleClick(e) {
57
112
  e.preventDefault();
58
- window.open(crossProductUrlGated, '_blank', 'noopener, noreferrer');
113
+ window.open(url, '_blank', 'noopener, noreferrer');
59
114
  };
60
115
  return /*#__PURE__*/_react.default.createElement(_smartCard.Card, {
61
116
  appearance: "inline",
@@ -74,5 +129,11 @@ var LinkRenderType = function LinkRenderType(_ref) {
74
129
  }
75
130
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, text ? anchor : /*#__PURE__*/_react.default.createElement(SmartCard, null), /*#__PURE__*/_react.default.createElement("br", null));
76
131
  };
77
- var _default_1 = /*#__PURE__*/_react.default.memo(LinkRenderType);
132
+ var LinkRenderTypeGated = function LinkRenderTypeGated(props) {
133
+ if ((0, _fg.fg)('electric_issue_like_table_xpc_url_wrapping')) {
134
+ return /*#__PURE__*/_react.default.createElement(LinkRenderTypeWithXpcWrappingUrl, props);
135
+ }
136
+ return /*#__PURE__*/_react.default.createElement(LinkRenderType, props);
137
+ };
138
+ var _default_1 = /*#__PURE__*/_react.default.memo(LinkRenderTypeGated);
78
139
  var _default = exports.default = _default_1;
@@ -16,7 +16,25 @@ const linkStyles = {
16
16
  default: {}
17
17
  };
18
18
  export const LINK_TYPE_TEST_ID = 'link-datasource-render-type--link';
19
- const LinkRenderType = ({
19
+ const SmartCard = ({
20
+ url,
21
+ crossProductUrl,
22
+ testId,
23
+ fallbackComponent
24
+ }) => {
25
+ const handleClick = event => {
26
+ event.preventDefault();
27
+ window.open(crossProductUrl, '_blank', 'noopener, noreferrer');
28
+ };
29
+ return /*#__PURE__*/React.createElement(Card, {
30
+ appearance: "inline",
31
+ onClick: handleClick,
32
+ url: url,
33
+ testId: testId,
34
+ fallbackComponent: () => fallbackComponent
35
+ });
36
+ };
37
+ const LinkRenderTypeWithXpcWrappingUrl = ({
20
38
  style,
21
39
  url,
22
40
  text,
@@ -29,11 +47,10 @@ const LinkRenderType = ({
29
47
  return (style === null || style === void 0 ? void 0 : style.appearance) && linkStyles[style.appearance] || {};
30
48
  }, [style]);
31
49
  const destinationUrl = useSmartLinkDestinationUrl(url);
32
- const crossProductUrlGated = fg('electric_issue_like_table_xpc_url_wrapping') ? destinationUrl : url;
33
50
  const anchor = useMemo(() => /*#__PURE__*/React.createElement(HoverCard, {
34
51
  url: url
35
52
  }, /*#__PURE__*/React.createElement(LinkUrl, {
36
- href: crossProductUrlGated
53
+ href: destinationUrl
37
54
  // NOTE: This will no longer apply styles to `@atlaskit/link`.
38
55
  // Wrap `@atlaskit/link` in a Text component to provide font styles to Link
39
56
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
@@ -41,11 +58,47 @@ const LinkRenderType = ({
41
58
  style: linkStyle,
42
59
  "data-testid": testId,
43
60
  target: "_blank"
44
- }, text || url, /*#__PURE__*/React.createElement(VisuallyHidden, null, ` ${formatMessage(messages.opensInNewTab)}`))), [linkStyle, url, text, testId, formatMessage, crossProductUrlGated]);
61
+ }, text || url, /*#__PURE__*/React.createElement(VisuallyHidden, null, ` ${formatMessage(messages.opensInNewTab)}`))), [linkStyle, url, text, testId, formatMessage, destinationUrl]);
62
+
63
+ // url can be undefined before data is fetched whilst adding new link column to display
64
+ if (!url) {
65
+ return null;
66
+ }
67
+ return /*#__PURE__*/React.createElement(React.Fragment, null, text ? anchor : /*#__PURE__*/React.createElement(SmartCard, {
68
+ url: url,
69
+ crossProductUrl: destinationUrl,
70
+ testId: testId,
71
+ fallbackComponent: anchor
72
+ }), /*#__PURE__*/React.createElement("br", null));
73
+ };
74
+ const LinkRenderType = ({
75
+ style,
76
+ url,
77
+ text,
78
+ testId = LINK_TYPE_TEST_ID
79
+ }) => {
80
+ const {
81
+ formatMessage
82
+ } = useIntl();
83
+ const linkStyle = useMemo(() => {
84
+ return (style === null || style === void 0 ? void 0 : style.appearance) && linkStyles[style.appearance] || {};
85
+ }, [style]);
86
+ const anchor = useMemo(() => /*#__PURE__*/React.createElement(HoverCard, {
87
+ url: url
88
+ }, /*#__PURE__*/React.createElement(LinkUrl, {
89
+ href: url
90
+ // NOTE: This will no longer apply styles to `@atlaskit/link`.
91
+ // Wrap `@atlaskit/link` in a Text component to provide font styles to Link
92
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
93
+ ,
94
+ style: linkStyle,
95
+ "data-testid": testId,
96
+ target: "_blank"
97
+ }, text || url, /*#__PURE__*/React.createElement(VisuallyHidden, null, ` ${formatMessage(messages.opensInNewTab)}`))), [linkStyle, url, text, testId, formatMessage]);
45
98
  const SmartCard = () => {
46
99
  const handleClick = e => {
47
100
  e.preventDefault();
48
- window.open(crossProductUrlGated, '_blank', 'noopener, noreferrer');
101
+ window.open(url, '_blank', 'noopener, noreferrer');
49
102
  };
50
103
  return /*#__PURE__*/React.createElement(Card, {
51
104
  appearance: "inline",
@@ -62,5 +115,11 @@ const LinkRenderType = ({
62
115
  }
63
116
  return /*#__PURE__*/React.createElement(React.Fragment, null, text ? anchor : /*#__PURE__*/React.createElement(SmartCard, null), /*#__PURE__*/React.createElement("br", null));
64
117
  };
65
- const _default_1 = /*#__PURE__*/React.memo(LinkRenderType);
118
+ const LinkRenderTypeGated = props => {
119
+ if (fg('electric_issue_like_table_xpc_url_wrapping')) {
120
+ return /*#__PURE__*/React.createElement(LinkRenderTypeWithXpcWrappingUrl, props);
121
+ }
122
+ return /*#__PURE__*/React.createElement(LinkRenderType, props);
123
+ };
124
+ const _default_1 = /*#__PURE__*/React.memo(LinkRenderTypeGated);
66
125
  export default _default_1;
@@ -16,24 +16,42 @@ var linkStyles = {
16
16
  default: {}
17
17
  };
18
18
  export var LINK_TYPE_TEST_ID = 'link-datasource-render-type--link';
19
- var LinkRenderType = function LinkRenderType(_ref) {
20
- var style = _ref.style,
21
- url = _ref.url,
22
- text = _ref.text,
23
- _ref$testId = _ref.testId,
24
- testId = _ref$testId === void 0 ? LINK_TYPE_TEST_ID : _ref$testId;
19
+ var SmartCard = function SmartCard(_ref) {
20
+ var url = _ref.url,
21
+ crossProductUrl = _ref.crossProductUrl,
22
+ testId = _ref.testId,
23
+ _fallbackComponent = _ref.fallbackComponent;
24
+ var handleClick = function handleClick(event) {
25
+ event.preventDefault();
26
+ window.open(crossProductUrl, '_blank', 'noopener, noreferrer');
27
+ };
28
+ return /*#__PURE__*/React.createElement(Card, {
29
+ appearance: "inline",
30
+ onClick: handleClick,
31
+ url: url,
32
+ testId: testId,
33
+ fallbackComponent: function fallbackComponent() {
34
+ return _fallbackComponent;
35
+ }
36
+ });
37
+ };
38
+ var LinkRenderTypeWithXpcWrappingUrl = function LinkRenderTypeWithXpcWrappingUrl(_ref2) {
39
+ var style = _ref2.style,
40
+ url = _ref2.url,
41
+ text = _ref2.text,
42
+ _ref2$testId = _ref2.testId,
43
+ testId = _ref2$testId === void 0 ? LINK_TYPE_TEST_ID : _ref2$testId;
25
44
  var _useIntl = useIntl(),
26
45
  formatMessage = _useIntl.formatMessage;
27
46
  var linkStyle = useMemo(function () {
28
47
  return (style === null || style === void 0 ? void 0 : style.appearance) && linkStyles[style.appearance] || {};
29
48
  }, [style]);
30
49
  var destinationUrl = useSmartLinkDestinationUrl(url);
31
- var crossProductUrlGated = fg('electric_issue_like_table_xpc_url_wrapping') ? destinationUrl : url;
32
50
  var anchor = useMemo(function () {
33
51
  return /*#__PURE__*/React.createElement(HoverCard, {
34
52
  url: url
35
53
  }, /*#__PURE__*/React.createElement(LinkUrl, {
36
- href: crossProductUrlGated
54
+ href: destinationUrl
37
55
  // NOTE: This will no longer apply styles to `@atlaskit/link`.
38
56
  // Wrap `@atlaskit/link` in a Text component to provide font styles to Link
39
57
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
@@ -42,11 +60,48 @@ var LinkRenderType = function LinkRenderType(_ref) {
42
60
  "data-testid": testId,
43
61
  target: "_blank"
44
62
  }, text || url, /*#__PURE__*/React.createElement(VisuallyHidden, null, " ".concat(formatMessage(messages.opensInNewTab)))));
45
- }, [linkStyle, url, text, testId, formatMessage, crossProductUrlGated]);
63
+ }, [linkStyle, url, text, testId, formatMessage, destinationUrl]);
64
+
65
+ // url can be undefined before data is fetched whilst adding new link column to display
66
+ if (!url) {
67
+ return null;
68
+ }
69
+ return /*#__PURE__*/React.createElement(React.Fragment, null, text ? anchor : /*#__PURE__*/React.createElement(SmartCard, {
70
+ url: url,
71
+ crossProductUrl: destinationUrl,
72
+ testId: testId,
73
+ fallbackComponent: anchor
74
+ }), /*#__PURE__*/React.createElement("br", null));
75
+ };
76
+ var LinkRenderType = function LinkRenderType(_ref3) {
77
+ var style = _ref3.style,
78
+ url = _ref3.url,
79
+ text = _ref3.text,
80
+ _ref3$testId = _ref3.testId,
81
+ testId = _ref3$testId === void 0 ? LINK_TYPE_TEST_ID : _ref3$testId;
82
+ var _useIntl2 = useIntl(),
83
+ formatMessage = _useIntl2.formatMessage;
84
+ var linkStyle = useMemo(function () {
85
+ return (style === null || style === void 0 ? void 0 : style.appearance) && linkStyles[style.appearance] || {};
86
+ }, [style]);
87
+ var anchor = useMemo(function () {
88
+ return /*#__PURE__*/React.createElement(HoverCard, {
89
+ url: url
90
+ }, /*#__PURE__*/React.createElement(LinkUrl, {
91
+ href: url
92
+ // NOTE: This will no longer apply styles to `@atlaskit/link`.
93
+ // Wrap `@atlaskit/link` in a Text component to provide font styles to Link
94
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
95
+ ,
96
+ style: linkStyle,
97
+ "data-testid": testId,
98
+ target: "_blank"
99
+ }, text || url, /*#__PURE__*/React.createElement(VisuallyHidden, null, " ".concat(formatMessage(messages.opensInNewTab)))));
100
+ }, [linkStyle, url, text, testId, formatMessage]);
46
101
  var SmartCard = function SmartCard() {
47
102
  var handleClick = function handleClick(e) {
48
103
  e.preventDefault();
49
- window.open(crossProductUrlGated, '_blank', 'noopener, noreferrer');
104
+ window.open(url, '_blank', 'noopener, noreferrer');
50
105
  };
51
106
  return /*#__PURE__*/React.createElement(Card, {
52
107
  appearance: "inline",
@@ -65,5 +120,11 @@ var LinkRenderType = function LinkRenderType(_ref) {
65
120
  }
66
121
  return /*#__PURE__*/React.createElement(React.Fragment, null, text ? anchor : /*#__PURE__*/React.createElement(SmartCard, null), /*#__PURE__*/React.createElement("br", null));
67
122
  };
68
- var _default_1 = /*#__PURE__*/React.memo(LinkRenderType);
123
+ var LinkRenderTypeGated = function LinkRenderTypeGated(props) {
124
+ if (fg('electric_issue_like_table_xpc_url_wrapping')) {
125
+ return /*#__PURE__*/React.createElement(LinkRenderTypeWithXpcWrappingUrl, props);
126
+ }
127
+ return /*#__PURE__*/React.createElement(LinkRenderType, props);
128
+ };
129
+ var _default_1 = /*#__PURE__*/React.memo(LinkRenderTypeGated);
69
130
  export default _default_1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "6.11.2",
3
+ "version": "6.12.1",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,8 +35,8 @@
35
35
  "ak-postbuild": "ls -d dist/* | xargs -n 1 copyfiles -u 1 -V src/**/*.{svg,png}"
36
36
  },
37
37
  "dependencies": {
38
- "@atlaskit/adf-schema": "^57.3.0",
39
- "@atlaskit/afm-i18n-platform-linking-platform-link-datasource": "2.237.0",
38
+ "@atlaskit/adf-schema": "^57.4.0",
39
+ "@atlaskit/afm-i18n-platform-linking-platform-link-datasource": "2.242.0",
40
40
  "@atlaskit/analytics-cross-product": "^2.1.0",
41
41
  "@atlaskit/analytics-next": "^12.5.0",
42
42
  "@atlaskit/atlassian-context": "^1.1.0",
@@ -58,7 +58,7 @@
58
58
  "@atlaskit/inline-edit": "^16.4.0",
59
59
  "@atlaskit/intl-messages-provider": "^4.3.0",
60
60
  "@atlaskit/jql-ast": "^4.2.0",
61
- "@atlaskit/jql-editor": "^7.7.0",
61
+ "@atlaskit/jql-editor": "^7.8.0",
62
62
  "@atlaskit/jql-editor-autocomplete-rest": "^4.6.0",
63
63
  "@atlaskit/layering": "^5.2.0",
64
64
  "@atlaskit/link": "^5.1.0",
@@ -82,8 +82,8 @@
82
82
  "@atlaskit/react-compiler-gating": "^0.2.0",
83
83
  "@atlaskit/react-select": "^4.9.0",
84
84
  "@atlaskit/select": "^22.11.0",
85
- "@atlaskit/smart-card": "^45.20.0",
86
- "@atlaskit/smart-user-picker": "^11.7.0",
85
+ "@atlaskit/smart-card": "^45.21.0",
86
+ "@atlaskit/smart-user-picker": "^11.8.0",
87
87
  "@atlaskit/spinner": "^20.4.0",
88
88
  "@atlaskit/tag": "^15.8.0",
89
89
  "@atlaskit/textfield": "^10.2.0",