@atlaskit/editor-common 115.8.1 → 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,44 @@
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
+
32
+ ## 115.8.2
33
+
34
+ ### Patch Changes
35
+
36
+ - [`809a7bb620a33`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/809a7bb620a33) -
37
+ [ux] Cleanup feature gate `cc_editor_hover_link_overlay_css_fix`. The hover link overlay overflow
38
+ handling is now always active, so labels reset on hover and hide when the button would overflow
39
+ its container.
40
+ - Updated dependencies
41
+
3
42
  ## 115.8.1
4
43
 
5
44
  ### 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.0";
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.0";
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,
@@ -169,13 +170,11 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
169
170
  // When a smart link wraps to multiple lines in a constrained container (e.g. table cell),
170
171
  // the hover button can overflow beyond the container bounds. We detect this by comparing
171
172
  // the button's right edge to the container's right edge, and hide the label if it overflows.
172
- if ((0, _experiments.editorExperiment)('cc_editor_hover_link_overlay_css_fix', true)) {
173
- if (containerRef.current && hoverLinkButtonRef.current) {
174
- var containerRight = containerRef.current.getBoundingClientRect().right;
175
- var buttonRight = hoverLinkButtonRef.current.getBoundingClientRect().right;
176
- if (buttonRight > containerRight) {
177
- canShowLabel = false;
178
- }
173
+ if (containerRef.current && hoverLinkButtonRef.current) {
174
+ var containerRight = containerRef.current.getBoundingClientRect().right;
175
+ var buttonRight = hoverLinkButtonRef.current.getBoundingClientRect().right;
176
+ if (buttonRight > containerRight) {
177
+ canShowLabel = false;
179
178
  }
180
179
  }
181
180
  setShowLabel(canShowLabel);
@@ -185,10 +184,8 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
185
184
 
186
185
  // Reset label visibility on hover start so we can measure if it overflows.
187
186
  // Without this, the label stays hidden from a previous hover and won't be re-measured.
188
- if ((0, _experiments.editorExperiment)('cc_editor_hover_link_overlay_css_fix', true)) {
189
- if (isHovered) {
190
- setShowLabel(true);
191
- }
187
+ if (isHovered) {
188
+ setShowLabel(true);
192
189
  }
193
190
  };
194
191
  var sendVisitLinkAnalytics = function sendVisitLinkAnalytics(inputMethod) {
@@ -201,7 +198,7 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
201
198
  sendVisitLinkAnalytics(_analytics.INPUT_METHOD.DOUBLE_CLICK);
202
199
 
203
200
  // Double click opens the link in a new tab
204
- window.open(url, '_blank');
201
+ window.open((0, _platformFeatureFlags.fg)('platform_smartlink_xpc_url_wrapping') ? destinationUrl !== null && destinationUrl !== void 0 ? destinationUrl : url : url, '_blank');
205
202
  }
206
203
  };
207
204
  var handleClick = function handleClick(event) {
@@ -253,7 +250,7 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
253
250
  }, label)), isHovered && (0, _react2.jsx)(_primitives.Anchor, {
254
251
  ref: hoverLinkButtonRef,
255
252
  xcss: linkStylesCommon,
256
- href: url,
253
+ href: (0, _platformFeatureFlags.fg)('platform_smartlink_xpc_url_wrapping') ? destinationUrl !== null && destinationUrl !== void 0 ? destinationUrl : url : url,
257
254
  target: "_blank"
258
255
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- dynamic paddingBlock value based on experiment flags
259
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.0";
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.0";
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,
@@ -148,13 +149,11 @@ const HoverLinkOverlay = ({
148
149
  // When a smart link wraps to multiple lines in a constrained container (e.g. table cell),
149
150
  // the hover button can overflow beyond the container bounds. We detect this by comparing
150
151
  // the button's right edge to the container's right edge, and hide the label if it overflows.
151
- if (editorExperiment('cc_editor_hover_link_overlay_css_fix', true)) {
152
- if (containerRef.current && hoverLinkButtonRef.current) {
153
- const containerRight = containerRef.current.getBoundingClientRect().right;
154
- const buttonRight = hoverLinkButtonRef.current.getBoundingClientRect().right;
155
- if (buttonRight > containerRight) {
156
- canShowLabel = false;
157
- }
152
+ if (containerRef.current && hoverLinkButtonRef.current) {
153
+ const containerRight = containerRef.current.getBoundingClientRect().right;
154
+ const buttonRight = hoverLinkButtonRef.current.getBoundingClientRect().right;
155
+ if (buttonRight > containerRight) {
156
+ canShowLabel = false;
158
157
  }
159
158
  }
160
159
  setShowLabel(canShowLabel);
@@ -164,10 +163,8 @@ const HoverLinkOverlay = ({
164
163
 
165
164
  // Reset label visibility on hover start so we can measure if it overflows.
166
165
  // Without this, the label stays hidden from a previous hover and won't be re-measured.
167
- if (editorExperiment('cc_editor_hover_link_overlay_css_fix', true)) {
168
- if (isHovered) {
169
- setShowLabel(true);
170
- }
166
+ if (isHovered) {
167
+ setShowLabel(true);
171
168
  }
172
169
  };
173
170
  const sendVisitLinkAnalytics = inputMethod => {
@@ -180,7 +177,7 @@ const HoverLinkOverlay = ({
180
177
  sendVisitLinkAnalytics(INPUT_METHOD.DOUBLE_CLICK);
181
178
 
182
179
  // Double click opens the link in a new tab
183
- window.open(url, '_blank');
180
+ window.open(fg('platform_smartlink_xpc_url_wrapping') ? destinationUrl !== null && destinationUrl !== void 0 ? destinationUrl : url : url, '_blank');
184
181
  }
185
182
  };
186
183
  const handleClick = event => {
@@ -228,7 +225,7 @@ const HoverLinkOverlay = ({
228
225
  }, label)), isHovered && jsx(Anchor, {
229
226
  ref: hoverLinkButtonRef,
230
227
  xcss: linkStylesCommon,
231
- href: url,
228
+ href: fg('platform_smartlink_xpc_url_wrapping') ? destinationUrl !== null && destinationUrl !== void 0 ? destinationUrl : url : url,
232
229
  target: "_blank"
233
230
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- dynamic paddingBlock value based on experiment flags
234
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.0";
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.0";
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,
@@ -156,13 +157,11 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
156
157
  // When a smart link wraps to multiple lines in a constrained container (e.g. table cell),
157
158
  // the hover button can overflow beyond the container bounds. We detect this by comparing
158
159
  // the button's right edge to the container's right edge, and hide the label if it overflows.
159
- if (editorExperiment('cc_editor_hover_link_overlay_css_fix', true)) {
160
- if (containerRef.current && hoverLinkButtonRef.current) {
161
- var containerRight = containerRef.current.getBoundingClientRect().right;
162
- var buttonRight = hoverLinkButtonRef.current.getBoundingClientRect().right;
163
- if (buttonRight > containerRight) {
164
- canShowLabel = false;
165
- }
160
+ if (containerRef.current && hoverLinkButtonRef.current) {
161
+ var containerRight = containerRef.current.getBoundingClientRect().right;
162
+ var buttonRight = hoverLinkButtonRef.current.getBoundingClientRect().right;
163
+ if (buttonRight > containerRight) {
164
+ canShowLabel = false;
166
165
  }
167
166
  }
168
167
  setShowLabel(canShowLabel);
@@ -172,10 +171,8 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
172
171
 
173
172
  // Reset label visibility on hover start so we can measure if it overflows.
174
173
  // Without this, the label stays hidden from a previous hover and won't be re-measured.
175
- if (editorExperiment('cc_editor_hover_link_overlay_css_fix', true)) {
176
- if (isHovered) {
177
- setShowLabel(true);
178
- }
174
+ if (isHovered) {
175
+ setShowLabel(true);
179
176
  }
180
177
  };
181
178
  var sendVisitLinkAnalytics = function sendVisitLinkAnalytics(inputMethod) {
@@ -188,7 +185,7 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
188
185
  sendVisitLinkAnalytics(INPUT_METHOD.DOUBLE_CLICK);
189
186
 
190
187
  // Double click opens the link in a new tab
191
- window.open(url, '_blank');
188
+ window.open(fg('platform_smartlink_xpc_url_wrapping') ? destinationUrl !== null && destinationUrl !== void 0 ? destinationUrl : url : url, '_blank');
192
189
  }
193
190
  };
194
191
  var handleClick = function handleClick(event) {
@@ -240,7 +237,7 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
240
237
  }, label)), isHovered && jsx(Anchor, {
241
238
  ref: hoverLinkButtonRef,
242
239
  xcss: linkStylesCommon,
243
- href: url,
240
+ href: fg('platform_smartlink_xpc_url_wrapping') ? destinationUrl !== null && destinationUrl !== void 0 ? destinationUrl : url : url,
244
241
  target: "_blank"
245
242
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- dynamic paddingBlock value based on experiment flags
246
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.1",
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/"
@@ -57,7 +57,7 @@
57
57
  "@atlaskit/editor-tables": "^2.10.0",
58
58
  "@atlaskit/editor-toolbar": "^1.10.0",
59
59
  "@atlaskit/editor-toolbar-model": "^0.5.0",
60
- "@atlaskit/emoji": "^70.16.0",
60
+ "@atlaskit/emoji": "^70.17.0",
61
61
  "@atlaskit/icon": "^35.4.0",
62
62
  "@atlaskit/link": "^3.4.0",
63
63
  "@atlaskit/link-datasource": "^5.6.0",
@@ -77,17 +77,17 @@
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",
88
88
  "@atlaskit/teams-app-config": "^1.12.0",
89
89
  "@atlaskit/textfield": "^8.3.0",
90
- "@atlaskit/tmp-editor-statsig": "^93.0.0",
90
+ "@atlaskit/tmp-editor-statsig": "^94.0.0",
91
91
  "@atlaskit/tokens": "^13.3.0",
92
92
  "@atlaskit/tooltip": "^22.6.0",
93
93
  "@atlaskit/width-detector": "^5.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
  },