@atlaskit/editor-common 115.8.2 → 115.9.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,34 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 115.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`92da883bae00d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/92da883bae00d) -
8
+ Use XPC-wrapped destination URL for link navigation behind `platform_smartlink_xpc_url_wrapping`.
9
+
10
+ When the feature gate is enabled, the following link-opening locations now use the cross-product
11
+ analytics parameter-enriched URL provided by SmartCard instead of the raw node URL:
12
+ - **Toolbar "Open Link" button** (both smart card and datasource paths) — uses the new
13
+ `useSmartLinkDestinationUrl` hook from
14
+ `@atlaskit/smart-card/hook/use-smart-link-destination-url` via a new `OpenLinkToolbarButton`
15
+ custom toolbar component.
16
+ - **Inline card overlay anchor** (`InlineCardOverlay`) — `href` updated to use
17
+ `useSmartLinkDestinationUrl`.
18
+ - **Hover link overlay** (`HoverLinkOverlay`) — accepts a new optional `destinationUrl` prop; when
19
+ provided and the gate is on, uses it for both the anchor `href` and double-click `window.open`.
20
+ The `destinationUrl` is computed by `inlineCardWithAwareness` using `useSmartLinkDestinationUrl`
21
+ and passed down — keeping `editor-common` free of any SmartCard provider dependency.
22
+ - **Inline card Cmd/Ctrl+click** — reads `data.destinationUrl` from SmartCard's `onClick` callback
23
+ (typed as `OnClickCallback` from `@atlaskit/smart-card/card/types`).
24
+
25
+ All changes gracefully fall back to the raw URL when the gate is off or the link has not yet
26
+ resolved.
27
+
28
+ ### Patch Changes
29
+
30
+ - Updated dependencies
31
+
3
32
  ## 115.8.2
4
33
 
5
34
  ### Patch Changes
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
19
19
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
20
20
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
21
21
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
22
- var packageVersion = "115.8.1";
22
+ var packageVersion = "115.8.2";
23
23
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
24
24
  // Remove URL as it has UGC
25
25
  // Ignored via go/ees007
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
24
24
  * @jsx jsx
25
25
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "115.8.1";
27
+ var packageVersion = "115.8.2";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -105,6 +105,7 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
105
105
  _ref$isVisible = _ref.isVisible,
106
106
  isVisible = _ref$isVisible === void 0 ? false : _ref$isVisible,
107
107
  url = _ref.url,
108
+ destinationUrl = _ref.destinationUrl,
108
109
  _ref$compactPadding = _ref.compactPadding,
109
110
  compactPadding = _ref$compactPadding === void 0 ? false : _ref$compactPadding,
110
111
  editorAnalyticsApi = _ref.editorAnalyticsApi,
@@ -197,7 +198,7 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
197
198
  sendVisitLinkAnalytics(_analytics.INPUT_METHOD.DOUBLE_CLICK);
198
199
 
199
200
  // Double click opens the link in a new tab
200
- window.open(url, '_blank');
201
+ window.open((0, _platformFeatureFlags.fg)('platform_smartlink_xpc_url_wrapping') ? destinationUrl !== null && destinationUrl !== void 0 ? destinationUrl : url : url, '_blank');
201
202
  }
202
203
  };
203
204
  var handleClick = function handleClick(event) {
@@ -249,7 +250,7 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
249
250
  }, label)), isHovered && (0, _react2.jsx)(_primitives.Anchor, {
250
251
  ref: hoverLinkButtonRef,
251
252
  xcss: linkStylesCommon,
252
- href: url,
253
+ href: (0, _platformFeatureFlags.fg)('platform_smartlink_xpc_url_wrapping') ? destinationUrl !== null && destinationUrl !== void 0 ? destinationUrl : url : url,
253
254
  target: "_blank"
254
255
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- dynamic paddingBlock value based on experiment flags
255
256
  ,
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
4
4
  import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
5
5
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
6
6
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
7
- const packageVersion = "115.8.1";
7
+ const packageVersion = "115.8.2";
8
8
  const sanitiseSentryEvents = (data, _hint) => {
9
9
  // Remove URL as it has UGC
10
10
  // Ignored via go/ees007
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "115.8.1";
17
+ const packageVersion = "115.8.2";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -92,6 +92,7 @@ const HoverLinkOverlay = ({
92
92
  children,
93
93
  isVisible = false,
94
94
  url,
95
+ destinationUrl,
95
96
  compactPadding = false,
96
97
  editorAnalyticsApi,
97
98
  view,
@@ -176,7 +177,7 @@ const HoverLinkOverlay = ({
176
177
  sendVisitLinkAnalytics(INPUT_METHOD.DOUBLE_CLICK);
177
178
 
178
179
  // Double click opens the link in a new tab
179
- window.open(url, '_blank');
180
+ window.open(fg('platform_smartlink_xpc_url_wrapping') ? destinationUrl !== null && destinationUrl !== void 0 ? destinationUrl : url : url, '_blank');
180
181
  }
181
182
  };
182
183
  const handleClick = event => {
@@ -224,7 +225,7 @@ const HoverLinkOverlay = ({
224
225
  }, label)), isHovered && jsx(Anchor, {
225
226
  ref: hoverLinkButtonRef,
226
227
  xcss: linkStylesCommon,
227
- href: url,
228
+ href: fg('platform_smartlink_xpc_url_wrapping') ? destinationUrl !== null && destinationUrl !== void 0 ? destinationUrl : url : url,
228
229
  target: "_blank"
229
230
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- dynamic paddingBlock value based on experiment flags
230
231
  ,
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
10
10
  import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
11
11
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
12
12
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
13
- var packageVersion = "115.8.1";
13
+ var packageVersion = "115.8.2";
14
14
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
15
15
  // Remove URL as it has UGC
16
16
  // Ignored via go/ees007
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import { fg } from '@atlaskit/platform-feature-flags';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "115.8.1";
24
+ var packageVersion = "115.8.2";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -92,6 +92,7 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
92
92
  _ref$isVisible = _ref.isVisible,
93
93
  isVisible = _ref$isVisible === void 0 ? false : _ref$isVisible,
94
94
  url = _ref.url,
95
+ destinationUrl = _ref.destinationUrl,
95
96
  _ref$compactPadding = _ref.compactPadding,
96
97
  compactPadding = _ref$compactPadding === void 0 ? false : _ref$compactPadding,
97
98
  editorAnalyticsApi = _ref.editorAnalyticsApi,
@@ -184,7 +185,7 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
184
185
  sendVisitLinkAnalytics(INPUT_METHOD.DOUBLE_CLICK);
185
186
 
186
187
  // Double click opens the link in a new tab
187
- window.open(url, '_blank');
188
+ window.open(fg('platform_smartlink_xpc_url_wrapping') ? destinationUrl !== null && destinationUrl !== void 0 ? destinationUrl : url : url, '_blank');
188
189
  }
189
190
  };
190
191
  var handleClick = function handleClick(event) {
@@ -236,7 +237,7 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
236
237
  }, label)), isHovered && jsx(Anchor, {
237
238
  ref: hoverLinkButtonRef,
238
239
  xcss: linkStylesCommon,
239
- href: url,
240
+ href: fg('platform_smartlink_xpc_url_wrapping') ? destinationUrl !== null && destinationUrl !== void 0 ? destinationUrl : url : url,
240
241
  target: "_blank"
241
242
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- dynamic paddingBlock value based on experiment flags
242
243
  ,
@@ -5,5 +5,5 @@
5
5
  import React from 'react';
6
6
  import { jsx } from '@emotion/react';
7
7
  import type { HoverLinkOverlayProps } from './types';
8
- declare const HoverLinkOverlay: ({ children, isVisible, url, compactPadding, editorAnalyticsApi, view, onClick, showPanelButton, showPanelButtonIcon, }: React.PropsWithChildren<HoverLinkOverlayProps>) => jsx.JSX.Element;
8
+ declare const HoverLinkOverlay: ({ children, isVisible, url, destinationUrl, compactPadding, editorAnalyticsApi, view, onClick, showPanelButton, showPanelButtonIcon, }: React.PropsWithChildren<HoverLinkOverlayProps>) => jsx.JSX.Element;
9
9
  export default HoverLinkOverlay;
@@ -2,6 +2,7 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
2
  import type { EditorAnalyticsAPI } from '../../analytics';
3
3
  export type HoverLinkOverlayProps = React.HTMLAttributes<HTMLSpanElement> & {
4
4
  compactPadding?: boolean;
5
+ destinationUrl?: string;
5
6
  editorAnalyticsApi?: EditorAnalyticsAPI;
6
7
  isVisible?: boolean;
7
8
  onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
@@ -5,5 +5,5 @@
5
5
  import React from 'react';
6
6
  import { jsx } from '@emotion/react';
7
7
  import type { HoverLinkOverlayProps } from './types';
8
- declare const HoverLinkOverlay: ({ children, isVisible, url, compactPadding, editorAnalyticsApi, view, onClick, showPanelButton, showPanelButtonIcon, }: React.PropsWithChildren<HoverLinkOverlayProps>) => jsx.JSX.Element;
8
+ declare const HoverLinkOverlay: ({ children, isVisible, url, destinationUrl, compactPadding, editorAnalyticsApi, view, onClick, showPanelButton, showPanelButtonIcon, }: React.PropsWithChildren<HoverLinkOverlayProps>) => jsx.JSX.Element;
9
9
  export default HoverLinkOverlay;
@@ -2,6 +2,7 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
2
  import type { EditorAnalyticsAPI } from '../../analytics';
3
3
  export type HoverLinkOverlayProps = React.HTMLAttributes<HTMLSpanElement> & {
4
4
  compactPadding?: boolean;
5
+ destinationUrl?: string;
5
6
  editorAnalyticsApi?: EditorAnalyticsAPI;
6
7
  isVisible?: boolean;
7
8
  onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "115.8.2",
3
+ "version": "115.9.0",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -77,11 +77,11 @@
77
77
  "@atlaskit/platform-feature-flags": "^1.1.0",
78
78
  "@atlaskit/platform-feature-flags-react": "^0.5.0",
79
79
  "@atlaskit/primitives": "^19.0.0",
80
- "@atlaskit/profilecard": "^25.8.0",
80
+ "@atlaskit/profilecard": "^25.9.0",
81
81
  "@atlaskit/prosemirror-history": "^0.2.0",
82
82
  "@atlaskit/react-ufo": "^6.7.0",
83
83
  "@atlaskit/section-message": "^8.13.0",
84
- "@atlaskit/smart-card": "^44.25.0",
84
+ "@atlaskit/smart-card": "^44.26.0",
85
85
  "@atlaskit/smart-user-picker": "^10.2.0",
86
86
  "@atlaskit/spinner": "^19.1.0",
87
87
  "@atlaskit/task-decision": "^20.1.0",
@@ -273,6 +273,10 @@
273
273
  "people-teams_migrate-user-profile-card": {
274
274
  "type": "boolean"
275
275
  },
276
+ "platform_smartlink_xpc_url_wrapping": {
277
+ "type": "boolean",
278
+ "referenceOnly": true
279
+ },
276
280
  "platform_editor_ai_selection_local_ids": {
277
281
  "type": "boolean"
278
282
  },