@atlaskit/editor-common 114.42.0 → 114.44.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,33 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 114.44.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`3990f4a500c27`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3990f4a500c27) -
8
+ Fix RovoLinkPicker rendering off-screen by using correct dimensions for popup placement
9
+ calculations
10
+
11
+ ## 114.43.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [`09fd1de566937`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/09fd1de566937) -
16
+ Add UFO experience tracking to `@atlaskit/editor-plugin-autocomplete` for the asynchronous
17
+ operations that have meaningful latency and success/failure outcomes — slow-lane fetch, vocabulary
18
+ load, and vectors load. Experiences surface downstream as
19
+ `platform.fe.operation.editor-plugin-autocomplete.<name>`.
20
+
21
+ Per-keystroke suggestion lifecycle counters (view, insert, dismiss) are tracked exclusively via
22
+ analytics-next instead of UFO, to avoid emitting zero-duration events on every word boundary. A
23
+ new `suggestionDismissed` contextual-typeahead analytics event is added
24
+ (`@atlaskit/editor-common`) alongside the existing `suggestionViewed` / `suggestionInserted`
25
+ events, with a `reason: 'escape' | 'blur'` attribute.
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies
30
+
3
31
  ## 114.42.0
4
32
 
5
33
  ### Minor Changes
@@ -7,12 +7,14 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.HyperlinkAddToolbar = HyperlinkAddToolbar;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
11
  var _react = _interopRequireWildcard(require("react"));
11
12
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
12
13
  var _analytics = require("../../../analytics");
13
14
  var _providerFactory = require("../../../provider-factory");
14
15
  var _EditorLinkPicker = require("../EditorLinkPicker");
15
16
  var _HyperlinkAddToolbar = _interopRequireDefault(require("./HyperlinkAddToolbar"));
17
+ var _excluded = ["popupWidth", "popupHeight"];
16
18
  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 _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
17
19
  var HYPERLINK_PROVIDERS = ['activityProvider', 'searchProvider'];
18
20
  /**
@@ -30,7 +32,10 @@ var onSubmitInterface = function onSubmitInterface(onSubmit) {
30
32
  };
31
33
  function HyperlinkAddToolbar(_ref2) {
32
34
  var _ref2$linkPickerOptio = _ref2.linkPickerOptions,
33
- linkPickerOptions = _ref2$linkPickerOptio === void 0 ? {} : _ref2$linkPickerOptio,
35
+ _ref2$linkPickerOptio2 = _ref2$linkPickerOptio === void 0 ? {} : _ref2$linkPickerOptio,
36
+ _popupWidth = _ref2$linkPickerOptio2.popupWidth,
37
+ _popupHeight = _ref2$linkPickerOptio2.popupHeight,
38
+ linkPickerOptions = (0, _objectWithoutProperties2.default)(_ref2$linkPickerOptio2, _excluded),
34
39
  onSubmit = _ref2.onSubmit,
35
40
  displayText = _ref2.displayText,
36
41
  displayUrl = _ref2.displayUrl,
@@ -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 _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); 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 = "114.41.0";
22
+ var packageVersion = "114.43.0";
23
23
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
24
24
  // Remove URL as it has UGC
25
25
  // Ignored via go/ees007
@@ -16,6 +16,7 @@ var _reResizable = require("re-resizable");
16
16
  var _reactIntl = require("react-intl");
17
17
  var _primitives = require("@atlaskit/primitives");
18
18
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
19
+ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
19
20
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
20
21
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
21
22
  var _breakout = require("../messages/breakout");
@@ -90,7 +91,8 @@ var ResizerNext = function ResizerNext(props, ref) {
90
91
  childrenDOMRef = props.childrenDOMRef,
91
92
  labelComponent = props.labelComponent,
92
93
  otherProps = (0, _objectWithoutProperties2.default)(props, _excluded);
93
- var supportedHandles = (0, _expValEquals.expValEquals)('databases-native-embeds-v2', 'isEnabled', true) ? SUPPORTED_HANDLES_FOR_VERTICAL_RESIZE : SUPPORTED_HANDLES;
94
+ var isDatabasesV2Enabled = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('cc-maui-experiment', 'isEnabled', true) && (0, _expValEquals.expValEquals)('databases-native-embeds-v2', 'isEnabled', true);
95
+ var supportedHandles = isDatabasesV2Enabled ? SUPPORTED_HANDLES_FOR_VERTICAL_RESIZE : SUPPORTED_HANDLES;
94
96
  var onResizeStart = (0, _react.useCallback)(function (event) {
95
97
  // prevent creating a drag event on Firefox
96
98
  event.preventDefault();
@@ -111,12 +113,12 @@ var ResizerNext = function ResizerNext(props, ref) {
111
113
  width: resizableCurrent.state.original.width,
112
114
  height: resizableCurrent.state.original.height
113
115
  };
114
- if ((0, _expValEquals.expValEquals)('databases-native-embeds-v2', 'isEnabled', true)) {
116
+ if (isDatabasesV2Enabled) {
115
117
  handleResize(originalState, delta, direction);
116
118
  } else {
117
119
  handleResize(originalState, delta);
118
120
  }
119
- }, [handleResize]);
121
+ }, [handleResize, isDatabasesV2Enabled]);
120
122
  var onResizeStop = (0, _react.useCallback)(function (_event, direction, _elementRef, delta) {
121
123
  var resizableCurrent = resizable.current;
122
124
  if (!resizableCurrent || !resizableCurrent.state.original) {
@@ -129,17 +131,17 @@ var ResizerNext = function ResizerNext(props, ref) {
129
131
  height: resizableCurrent.state.original.height
130
132
  };
131
133
  setIsResizing(false);
132
- if ((0, _expValEquals.expValEquals)('databases-native-embeds-v2', 'isEnabled', true)) {
134
+ if (isDatabasesV2Enabled) {
133
135
  handleResizeStop(originalState, delta, direction);
134
136
  } else {
135
137
  handleResizeStop(originalState, delta);
136
138
  }
137
- }, [handleResizeStop]);
139
+ }, [handleResizeStop, isDatabasesV2Enabled]);
138
140
  var handles = (0, _react.useMemo)(function () {
139
141
  return supportedHandles.reduce(function (result, position) {
140
- return _objectSpread(_objectSpread({}, result), {}, (0, _defineProperty2.default)({}, position, (0, _classnames3.default)(handleClassName !== null && handleClassName !== void 0 ? handleClassName : _resizer.resizerHandleClassName, position, handleSize, position === 'bottom' && (0, _expValEquals.expValEquals)('databases-native-embeds-v2', 'isEnabled', true) ? undefined : handleAlignmentMethod)));
142
+ return _objectSpread(_objectSpread({}, result), {}, (0, _defineProperty2.default)({}, position, (0, _classnames3.default)(handleClassName !== null && handleClassName !== void 0 ? handleClassName : _resizer.resizerHandleClassName, position, handleSize, position === 'bottom' && isDatabasesV2Enabled ? undefined : handleAlignmentMethod)));
141
143
  }, {});
142
- }, [handleClassName, handleSize, handleAlignmentMethod, supportedHandles]);
144
+ }, [handleClassName, handleSize, handleAlignmentMethod, supportedHandles, isDatabasesV2Enabled]);
143
145
  var handleWidth = handlePositioning === 'adjacent' ? "var(--ds-space-100, 8px)" : "var(--ds-space-300, 24px)";
144
146
  var baseHorizontalHandleStyles = {
145
147
  width: handleWidth,
@@ -243,7 +245,7 @@ var ResizerNext = function ResizerNext(props, ref) {
243
245
  }
244
246
  return snapGap;
245
247
  }, [snap, snapGap]);
246
- var resolvedHeight = (0, _expValEquals.expValEquals)('databases-native-embeds-v2', 'isEnabled', true) ? height !== null && height !== void 0 ? height : 'auto' : 'auto';
248
+ var resolvedHeight = isDatabasesV2Enabled ? height !== null && height !== void 0 ? height : 'auto' : 'auto';
247
249
  var resizerAutoSize = (0, _react.useMemo)(function () {
248
250
  return {
249
251
  width: width !== null && width !== void 0 ? width : 'auto',
@@ -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 = "114.41.0";
27
+ var packageVersion = "114.43.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -3,8 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.RECENT_SEARCH_WIDTH_WITHOUT_ITEMS_IN_PX = exports.RECENT_SEARCH_WIDTH_IN_PX = exports.RECENT_SEARCH_HEIGHT_IN_PX = exports.LINKPICKER_HEIGHT_IN_PX = void 0;
6
+ exports.ROVO_LINK_PICKER_WIDTH_IN_PX = exports.ROVO_LINK_PICKER_HEIGHT_IN_PX = exports.RECENT_SEARCH_WIDTH_WITHOUT_ITEMS_IN_PX = exports.RECENT_SEARCH_WIDTH_IN_PX = exports.RECENT_SEARCH_HEIGHT_IN_PX = exports.LINKPICKER_HEIGHT_IN_PX = void 0;
7
7
  var RECENT_SEARCH_WIDTH_IN_PX = exports.RECENT_SEARCH_WIDTH_IN_PX = 420;
8
8
  var RECENT_SEARCH_WIDTH_WITHOUT_ITEMS_IN_PX = exports.RECENT_SEARCH_WIDTH_WITHOUT_ITEMS_IN_PX = 360;
9
9
  var RECENT_SEARCH_HEIGHT_IN_PX = exports.RECENT_SEARCH_HEIGHT_IN_PX = 360;
10
- var LINKPICKER_HEIGHT_IN_PX = exports.LINKPICKER_HEIGHT_IN_PX = 570;
10
+ var LINKPICKER_HEIGHT_IN_PX = exports.LINKPICKER_HEIGHT_IN_PX = 570;
11
+
12
+ // Dimensions of RovoLinkPicker — used by the editor popup to prevent off-screen rendering.
13
+ // Note: These values are mirrored from @atlassian/rovo-link-picker. If you change these, update that package's constants file too:
14
+ // platform/packages/linking-platform/rovo-link-picker/src/constants/ROVO_LINK_PICKER_CONSTANTS.ts
15
+ var ROVO_LINK_PICKER_WIDTH_IN_PX = exports.ROVO_LINK_PICKER_WIDTH_IN_PX = 464;
16
+ var ROVO_LINK_PICKER_HEIGHT_IN_PX = exports.ROVO_LINK_PICKER_HEIGHT_IN_PX = 512;
@@ -19,7 +19,11 @@ const onSubmitInterface = onSubmit => ({
19
19
  onSubmit(url, title !== null && title !== void 0 ? title : rawUrl, displayText || undefined, meta.inputMethod === 'manual' ? INPUT_METHOD.MANUAL : INPUT_METHOD.TYPEAHEAD, analytic);
20
20
  };
21
21
  export function HyperlinkAddToolbar({
22
- linkPickerOptions = {},
22
+ linkPickerOptions: {
23
+ popupWidth: _popupWidth,
24
+ popupHeight: _popupHeight,
25
+ ...linkPickerOptions
26
+ } = {},
23
27
  onSubmit,
24
28
  displayText,
25
29
  displayUrl,
@@ -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 = "114.41.0";
7
+ const packageVersion = "114.43.0";
8
8
  const sanitiseSentryEvents = (data, _hint) => {
9
9
  // Remove URL as it has UGC
10
10
  // Ignored via go/ees007
@@ -7,6 +7,7 @@ import { useIntl } from 'react-intl';
7
7
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
8
8
  import { Box, xcss } from '@atlaskit/primitives';
9
9
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
10
11
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
11
12
  import Tooltip from '@atlaskit/tooltip';
12
13
  import { messages } from '../messages/breakout';
@@ -69,7 +70,8 @@ const ResizerNext = (props, ref) => {
69
70
  labelComponent,
70
71
  ...otherProps
71
72
  } = props;
72
- const supportedHandles = expValEquals('databases-native-embeds-v2', 'isEnabled', true) ? SUPPORTED_HANDLES_FOR_VERTICAL_RESIZE : SUPPORTED_HANDLES;
73
+ const isDatabasesV2Enabled = expValEqualsNoExposure('cc-maui-experiment', 'isEnabled', true) && expValEquals('databases-native-embeds-v2', 'isEnabled', true);
74
+ const supportedHandles = isDatabasesV2Enabled ? SUPPORTED_HANDLES_FOR_VERTICAL_RESIZE : SUPPORTED_HANDLES;
73
75
  const onResizeStart = useCallback(event => {
74
76
  // prevent creating a drag event on Firefox
75
77
  event.preventDefault();
@@ -90,12 +92,12 @@ const ResizerNext = (props, ref) => {
90
92
  width: resizableCurrent.state.original.width,
91
93
  height: resizableCurrent.state.original.height
92
94
  };
93
- if (expValEquals('databases-native-embeds-v2', 'isEnabled', true)) {
95
+ if (isDatabasesV2Enabled) {
94
96
  handleResize(originalState, delta, direction);
95
97
  } else {
96
98
  handleResize(originalState, delta);
97
99
  }
98
- }, [handleResize]);
100
+ }, [handleResize, isDatabasesV2Enabled]);
99
101
  const onResizeStop = useCallback((_event, direction, _elementRef, delta) => {
100
102
  const resizableCurrent = resizable.current;
101
103
  if (!resizableCurrent || !resizableCurrent.state.original) {
@@ -108,16 +110,16 @@ const ResizerNext = (props, ref) => {
108
110
  height: resizableCurrent.state.original.height
109
111
  };
110
112
  setIsResizing(false);
111
- if (expValEquals('databases-native-embeds-v2', 'isEnabled', true)) {
113
+ if (isDatabasesV2Enabled) {
112
114
  handleResizeStop(originalState, delta, direction);
113
115
  } else {
114
116
  handleResizeStop(originalState, delta);
115
117
  }
116
- }, [handleResizeStop]);
118
+ }, [handleResizeStop, isDatabasesV2Enabled]);
117
119
  const handles = useMemo(() => supportedHandles.reduce((result, position) => ({
118
120
  ...result,
119
- [position]: classnames(handleClassName !== null && handleClassName !== void 0 ? handleClassName : resizerHandleClassName, position, handleSize, position === 'bottom' && expValEquals('databases-native-embeds-v2', 'isEnabled', true) ? undefined : handleAlignmentMethod)
120
- }), {}), [handleClassName, handleSize, handleAlignmentMethod, supportedHandles]);
121
+ [position]: classnames(handleClassName !== null && handleClassName !== void 0 ? handleClassName : resizerHandleClassName, position, handleSize, position === 'bottom' && isDatabasesV2Enabled ? undefined : handleAlignmentMethod)
122
+ }), {}), [handleClassName, handleSize, handleAlignmentMethod, supportedHandles, isDatabasesV2Enabled]);
121
123
  const handleWidth = handlePositioning === 'adjacent' ? "var(--ds-space-100, 8px)" : "var(--ds-space-300, 24px)";
122
124
  const baseHorizontalHandleStyles = {
123
125
  width: handleWidth,
@@ -238,7 +240,7 @@ const ResizerNext = (props, ref) => {
238
240
  }
239
241
  return snapGap;
240
242
  }, [snap, snapGap]);
241
- const resolvedHeight = expValEquals('databases-native-embeds-v2', 'isEnabled', true) ? height !== null && height !== void 0 ? height : 'auto' : 'auto';
243
+ const resolvedHeight = isDatabasesV2Enabled ? height !== null && height !== void 0 ? height : 'auto' : 'auto';
242
244
  const resizerAutoSize = useMemo(() => ({
243
245
  width: width !== null && width !== void 0 ? width : 'auto',
244
246
  height: resolvedHeight
@@ -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 = "114.41.0";
17
+ const packageVersion = "114.43.0";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -1,4 +1,10 @@
1
1
  export const RECENT_SEARCH_WIDTH_IN_PX = 420;
2
2
  export const RECENT_SEARCH_WIDTH_WITHOUT_ITEMS_IN_PX = 360;
3
3
  export const RECENT_SEARCH_HEIGHT_IN_PX = 360;
4
- export const LINKPICKER_HEIGHT_IN_PX = 570;
4
+ export const LINKPICKER_HEIGHT_IN_PX = 570;
5
+
6
+ // Dimensions of RovoLinkPicker — used by the editor popup to prevent off-screen rendering.
7
+ // Note: These values are mirrored from @atlassian/rovo-link-picker. If you change these, update that package's constants file too:
8
+ // platform/packages/linking-platform/rovo-link-picker/src/constants/ROVO_LINK_PICKER_CONSTANTS.ts
9
+ export const ROVO_LINK_PICKER_WIDTH_IN_PX = 464;
10
+ export const ROVO_LINK_PICKER_HEIGHT_IN_PX = 512;
@@ -1,4 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["popupWidth", "popupHeight"];
2
4
  import React, { useCallback, useMemo } from 'react';
3
5
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
6
  import { INPUT_METHOD } from '../../../analytics';
@@ -21,7 +23,10 @@ var onSubmitInterface = function onSubmitInterface(onSubmit) {
21
23
  };
22
24
  export function HyperlinkAddToolbar(_ref2) {
23
25
  var _ref2$linkPickerOptio = _ref2.linkPickerOptions,
24
- linkPickerOptions = _ref2$linkPickerOptio === void 0 ? {} : _ref2$linkPickerOptio,
26
+ _ref2$linkPickerOptio2 = _ref2$linkPickerOptio === void 0 ? {} : _ref2$linkPickerOptio,
27
+ _popupWidth = _ref2$linkPickerOptio2.popupWidth,
28
+ _popupHeight = _ref2$linkPickerOptio2.popupHeight,
29
+ linkPickerOptions = _objectWithoutProperties(_ref2$linkPickerOptio2, _excluded),
25
30
  onSubmit = _ref2.onSubmit,
26
31
  displayText = _ref2.displayText,
27
32
  displayUrl = _ref2.displayUrl,
@@ -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 = "114.41.0";
13
+ var packageVersion = "114.43.0";
14
14
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
15
15
  // Remove URL as it has UGC
16
16
  // Ignored via go/ees007
@@ -13,6 +13,7 @@ import { useIntl } from 'react-intl';
13
13
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
14
14
  import { Box, xcss } from '@atlaskit/primitives';
15
15
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
16
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
16
17
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
17
18
  import Tooltip from '@atlaskit/tooltip';
18
19
  import { messages } from '../messages/breakout';
@@ -83,7 +84,8 @@ var ResizerNext = function ResizerNext(props, ref) {
83
84
  childrenDOMRef = props.childrenDOMRef,
84
85
  labelComponent = props.labelComponent,
85
86
  otherProps = _objectWithoutProperties(props, _excluded);
86
- var supportedHandles = expValEquals('databases-native-embeds-v2', 'isEnabled', true) ? SUPPORTED_HANDLES_FOR_VERTICAL_RESIZE : SUPPORTED_HANDLES;
87
+ var isDatabasesV2Enabled = expValEqualsNoExposure('cc-maui-experiment', 'isEnabled', true) && expValEquals('databases-native-embeds-v2', 'isEnabled', true);
88
+ var supportedHandles = isDatabasesV2Enabled ? SUPPORTED_HANDLES_FOR_VERTICAL_RESIZE : SUPPORTED_HANDLES;
87
89
  var onResizeStart = useCallback(function (event) {
88
90
  // prevent creating a drag event on Firefox
89
91
  event.preventDefault();
@@ -104,12 +106,12 @@ var ResizerNext = function ResizerNext(props, ref) {
104
106
  width: resizableCurrent.state.original.width,
105
107
  height: resizableCurrent.state.original.height
106
108
  };
107
- if (expValEquals('databases-native-embeds-v2', 'isEnabled', true)) {
109
+ if (isDatabasesV2Enabled) {
108
110
  handleResize(originalState, delta, direction);
109
111
  } else {
110
112
  handleResize(originalState, delta);
111
113
  }
112
- }, [handleResize]);
114
+ }, [handleResize, isDatabasesV2Enabled]);
113
115
  var onResizeStop = useCallback(function (_event, direction, _elementRef, delta) {
114
116
  var resizableCurrent = resizable.current;
115
117
  if (!resizableCurrent || !resizableCurrent.state.original) {
@@ -122,17 +124,17 @@ var ResizerNext = function ResizerNext(props, ref) {
122
124
  height: resizableCurrent.state.original.height
123
125
  };
124
126
  setIsResizing(false);
125
- if (expValEquals('databases-native-embeds-v2', 'isEnabled', true)) {
127
+ if (isDatabasesV2Enabled) {
126
128
  handleResizeStop(originalState, delta, direction);
127
129
  } else {
128
130
  handleResizeStop(originalState, delta);
129
131
  }
130
- }, [handleResizeStop]);
132
+ }, [handleResizeStop, isDatabasesV2Enabled]);
131
133
  var handles = useMemo(function () {
132
134
  return supportedHandles.reduce(function (result, position) {
133
- return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, position, classnames(handleClassName !== null && handleClassName !== void 0 ? handleClassName : resizerHandleClassName, position, handleSize, position === 'bottom' && expValEquals('databases-native-embeds-v2', 'isEnabled', true) ? undefined : handleAlignmentMethod)));
135
+ return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, position, classnames(handleClassName !== null && handleClassName !== void 0 ? handleClassName : resizerHandleClassName, position, handleSize, position === 'bottom' && isDatabasesV2Enabled ? undefined : handleAlignmentMethod)));
134
136
  }, {});
135
- }, [handleClassName, handleSize, handleAlignmentMethod, supportedHandles]);
137
+ }, [handleClassName, handleSize, handleAlignmentMethod, supportedHandles, isDatabasesV2Enabled]);
136
138
  var handleWidth = handlePositioning === 'adjacent' ? "var(--ds-space-100, 8px)" : "var(--ds-space-300, 24px)";
137
139
  var baseHorizontalHandleStyles = {
138
140
  width: handleWidth,
@@ -236,7 +238,7 @@ var ResizerNext = function ResizerNext(props, ref) {
236
238
  }
237
239
  return snapGap;
238
240
  }, [snap, snapGap]);
239
- var resolvedHeight = expValEquals('databases-native-embeds-v2', 'isEnabled', true) ? height !== null && height !== void 0 ? height : 'auto' : 'auto';
241
+ var resolvedHeight = isDatabasesV2Enabled ? height !== null && height !== void 0 ? height : 'auto' : 'auto';
240
242
  var resizerAutoSize = useMemo(function () {
241
243
  return {
242
244
  width: width !== null && width !== void 0 ? width : 'auto',
@@ -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 = "114.41.0";
24
+ var packageVersion = "114.43.0";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -1,4 +1,10 @@
1
1
  export var RECENT_SEARCH_WIDTH_IN_PX = 420;
2
2
  export var RECENT_SEARCH_WIDTH_WITHOUT_ITEMS_IN_PX = 360;
3
3
  export var RECENT_SEARCH_HEIGHT_IN_PX = 360;
4
- export var LINKPICKER_HEIGHT_IN_PX = 570;
4
+ export var LINKPICKER_HEIGHT_IN_PX = 570;
5
+
6
+ // Dimensions of RovoLinkPicker — used by the editor popup to prevent off-screen rendering.
7
+ // Note: These values are mirrored from @atlassian/rovo-link-picker. If you change these, update that package's constants file too:
8
+ // platform/packages/linking-platform/rovo-link-picker/src/constants/ROVO_LINK_PICKER_CONSTANTS.ts
9
+ export var ROVO_LINK_PICKER_WIDTH_IN_PX = 464;
10
+ export var ROVO_LINK_PICKER_HEIGHT_IN_PX = 512;
@@ -7,5 +7,9 @@ type ContextualTypeaheadAcceptedAttributes = {
7
7
  typedLength: number;
8
8
  };
9
9
  type ContextualTypeaheadAcceptedAEP = TrackAEP<ACTION.SUGGESTION_INSERTED, ACTION_SUBJECT.CONTEXTUAL_TYPEAHEAD, undefined, ContextualTypeaheadAcceptedAttributes, undefined>;
10
- export type ContextualTypeaheadEventPayload = ContextualTypeaheadViewedAEP | ContextualTypeaheadAcceptedAEP;
10
+ type ContextualTypeaheadDismissedAttributes = {
11
+ reason: 'escape' | 'blur';
12
+ };
13
+ type ContextualTypeaheadDismissedAEP = TrackAEP<ACTION.SUGGESTION_DISMISSED, ACTION_SUBJECT.CONTEXTUAL_TYPEAHEAD, undefined, ContextualTypeaheadDismissedAttributes, undefined>;
14
+ export type ContextualTypeaheadEventPayload = ContextualTypeaheadViewedAEP | ContextualTypeaheadAcceptedAEP | ContextualTypeaheadDismissedAEP;
11
15
  export {};
@@ -22,4 +22,4 @@ export interface HyperlinkAddToolbarProps extends Pick<EditorLinkPickerProps, 'o
22
22
  timesViewed?: number;
23
23
  view: EditorView;
24
24
  }
25
- export declare function HyperlinkAddToolbar({ linkPickerOptions, onSubmit, displayText, displayUrl, providerFactory, view, onCancel, invokeMethod, lpLinkPicker, onClose, onEscapeCallback, onClickAwayCallback, editorAppearance, inputMethod, searchSessionId, timesViewed, isOffline, }: HyperlinkAddToolbarProps): React.JSX.Element;
25
+ export declare function HyperlinkAddToolbar({ linkPickerOptions: { popupWidth: _popupWidth, popupHeight: _popupHeight, ...linkPickerOptions }, onSubmit, displayText, displayUrl, providerFactory, view, onCancel, invokeMethod, lpLinkPicker, onClose, onEscapeCallback, onClickAwayCallback, editorAppearance, inputMethod, searchSessionId, timesViewed, isOffline, }: HyperlinkAddToolbarProps): React.JSX.Element;
@@ -5,9 +5,14 @@ import type { EditorAppearance } from './editor-appearance';
5
5
  export type LinkInputType = INPUT_METHOD.MANUAL | INPUT_METHOD.TYPEAHEAD;
6
6
  /**
7
7
  * Configuration for the link picker
8
- * Extends `LinkPickerProps` to provide future extensibility out-of-the-box
8
+ * Extends `LinkPickerProps` to provide future extensibility out-of-the-box.
9
+ * Use `popupWidth` and `popupHeight` to control the editor popup container size
10
+ * when providing a custom `component` with non-standard dimensions.
9
11
  */
10
- export type LinkPickerOptions = Partial<LinkPickerProps>;
12
+ export type LinkPickerOptions = Partial<LinkPickerProps> & {
13
+ popupHeight?: number;
14
+ popupWidth?: number;
15
+ };
11
16
  /**
12
17
  * Configuration for editor linking behaviours
13
18
  */
@@ -2,3 +2,5 @@ export declare const RECENT_SEARCH_WIDTH_IN_PX = 420;
2
2
  export declare const RECENT_SEARCH_WIDTH_WITHOUT_ITEMS_IN_PX = 360;
3
3
  export declare const RECENT_SEARCH_HEIGHT_IN_PX = 360;
4
4
  export declare const LINKPICKER_HEIGHT_IN_PX = 570;
5
+ export declare const ROVO_LINK_PICKER_WIDTH_IN_PX = 464;
6
+ export declare const ROVO_LINK_PICKER_HEIGHT_IN_PX = 512;
@@ -7,5 +7,9 @@ type ContextualTypeaheadAcceptedAttributes = {
7
7
  typedLength: number;
8
8
  };
9
9
  type ContextualTypeaheadAcceptedAEP = TrackAEP<ACTION.SUGGESTION_INSERTED, ACTION_SUBJECT.CONTEXTUAL_TYPEAHEAD, undefined, ContextualTypeaheadAcceptedAttributes, undefined>;
10
- export type ContextualTypeaheadEventPayload = ContextualTypeaheadViewedAEP | ContextualTypeaheadAcceptedAEP;
10
+ type ContextualTypeaheadDismissedAttributes = {
11
+ reason: 'escape' | 'blur';
12
+ };
13
+ type ContextualTypeaheadDismissedAEP = TrackAEP<ACTION.SUGGESTION_DISMISSED, ACTION_SUBJECT.CONTEXTUAL_TYPEAHEAD, undefined, ContextualTypeaheadDismissedAttributes, undefined>;
14
+ export type ContextualTypeaheadEventPayload = ContextualTypeaheadViewedAEP | ContextualTypeaheadAcceptedAEP | ContextualTypeaheadDismissedAEP;
11
15
  export {};
@@ -22,4 +22,4 @@ export interface HyperlinkAddToolbarProps extends Pick<EditorLinkPickerProps, 'o
22
22
  timesViewed?: number;
23
23
  view: EditorView;
24
24
  }
25
- export declare function HyperlinkAddToolbar({ linkPickerOptions, onSubmit, displayText, displayUrl, providerFactory, view, onCancel, invokeMethod, lpLinkPicker, onClose, onEscapeCallback, onClickAwayCallback, editorAppearance, inputMethod, searchSessionId, timesViewed, isOffline, }: HyperlinkAddToolbarProps): React.JSX.Element;
25
+ export declare function HyperlinkAddToolbar({ linkPickerOptions: { popupWidth: _popupWidth, popupHeight: _popupHeight, ...linkPickerOptions }, onSubmit, displayText, displayUrl, providerFactory, view, onCancel, invokeMethod, lpLinkPicker, onClose, onEscapeCallback, onClickAwayCallback, editorAppearance, inputMethod, searchSessionId, timesViewed, isOffline, }: HyperlinkAddToolbarProps): React.JSX.Element;
@@ -5,9 +5,14 @@ import type { EditorAppearance } from './editor-appearance';
5
5
  export type LinkInputType = INPUT_METHOD.MANUAL | INPUT_METHOD.TYPEAHEAD;
6
6
  /**
7
7
  * Configuration for the link picker
8
- * Extends `LinkPickerProps` to provide future extensibility out-of-the-box
8
+ * Extends `LinkPickerProps` to provide future extensibility out-of-the-box.
9
+ * Use `popupWidth` and `popupHeight` to control the editor popup container size
10
+ * when providing a custom `component` with non-standard dimensions.
9
11
  */
10
- export type LinkPickerOptions = Partial<LinkPickerProps>;
12
+ export type LinkPickerOptions = Partial<LinkPickerProps> & {
13
+ popupHeight?: number;
14
+ popupWidth?: number;
15
+ };
11
16
  /**
12
17
  * Configuration for editor linking behaviours
13
18
  */
@@ -2,3 +2,5 @@ export declare const RECENT_SEARCH_WIDTH_IN_PX = 420;
2
2
  export declare const RECENT_SEARCH_WIDTH_WITHOUT_ITEMS_IN_PX = 360;
3
3
  export declare const RECENT_SEARCH_HEIGHT_IN_PX = 360;
4
4
  export declare const LINKPICKER_HEIGHT_IN_PX = 570;
5
+ export declare const ROVO_LINK_PICKER_WIDTH_IN_PX = 464;
6
+ export declare const ROVO_LINK_PICKER_HEIGHT_IN_PX = 512;
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@atlaskit/editor-common/link-search-constants",
3
+ "main": "../dist/cjs/ui/LinkSearch/const.js",
4
+ "module": "../dist/esm/ui/LinkSearch/const.js",
5
+ "module:es2019": "../dist/es2019/ui/LinkSearch/const.js",
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
9
+ "types": "../dist/types/ui/LinkSearch/const.d.ts",
10
+ "typesVersions": {
11
+ ">=4.5 <5.9": {
12
+ "*": [
13
+ "../dist/types-ts4.5/ui/LinkSearch/const.d.ts"
14
+ ]
15
+ }
16
+ }
17
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "114.42.0",
3
+ "version": "114.44.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/"
@@ -37,8 +37,8 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@atlaskit/activity-provider": "^2.6.0",
40
- "@atlaskit/adf-schema": "^52.13.0",
41
- "@atlaskit/adf-utils": "^19.30.0",
40
+ "@atlaskit/adf-schema": "^52.14.0",
41
+ "@atlaskit/adf-utils": "^19.31.0",
42
42
  "@atlaskit/afm-i18n-platform-editor-editor-common": "2.18.0",
43
43
  "@atlaskit/analytics-listeners": "^10.1.0",
44
44
  "@atlaskit/analytics-namespaced-context": "^7.3.0",
@@ -67,8 +67,8 @@
67
67
  "@atlaskit/media-client-react": "^5.1.0",
68
68
  "@atlaskit/media-common": "^13.3.0",
69
69
  "@atlaskit/media-file-preview": "^0.17.0",
70
- "@atlaskit/media-picker": "^71.3.0",
71
- "@atlaskit/media-ui": "^29.2.0",
70
+ "@atlaskit/media-picker": "^71.4.0",
71
+ "@atlaskit/media-ui": "^29.3.0",
72
72
  "@atlaskit/media-viewer": "^53.2.0",
73
73
  "@atlaskit/mention": "^26.0.0",
74
74
  "@atlaskit/menu": "^8.5.0",
@@ -87,7 +87,7 @@
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": "^82.4.0",
90
+ "@atlaskit/tmp-editor-statsig": "^82.5.0",
91
91
  "@atlaskit/tokens": "^13.0.0",
92
92
  "@atlaskit/tooltip": "^22.2.0",
93
93
  "@atlaskit/width-detector": "^5.1.0",