@atlaskit/editor-common 114.9.0 → 114.10.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 +28 -0
- package/dist/cjs/messages/insert-block.js +15 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Popup/index.js +45 -9
- package/dist/es2019/messages/insert-block.js +15 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Popup/index.js +41 -6
- package/dist/esm/messages/insert-block.js +15 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Popup/index.js +45 -9
- package/dist/types/block-menu/rank.d.ts +11 -58
- package/dist/types/messages/insert-block.d.ts +103 -88
- package/dist/types/provider-factory/quick-insert-provider.d.ts +1 -1
- package/dist/types/ui/Popup/index.d.ts +6 -0
- package/dist/types-ts4.5/block-menu/rank.d.ts +11 -58
- package/dist/types-ts4.5/messages/insert-block.d.ts +103 -88
- package/dist/types-ts4.5/provider-factory/quick-insert-provider.d.ts +1 -1
- package/dist/types-ts4.5/ui/Popup/index.d.ts +6 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 114.10.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 114.10.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`4b61b018db494`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4b61b018db494) -
|
|
14
|
+
[ux] Adds AI image generation to the editor by introducing a new plugin for image generation in
|
|
15
|
+
the editor with the functionalities to create AI images with a prompt and style choice. The plugin
|
|
16
|
+
is gated behind a feature experiment.
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [`edc25b2fd6660`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/edc25b2fd6660) -
|
|
21
|
+
Fix editor popup not respecting scrollableElement changes when editor is re-parented.
|
|
22
|
+
|
|
23
|
+
When the `platform_editor_fix_scrolling_popup_position` experiment is enabled, the Popup component
|
|
24
|
+
now detects when the `scrollableElement` prop changes (e.g. the editor instance is moved into a
|
|
25
|
+
different container) and re-initialises the scroll event listener and ResizeObserver to track the
|
|
26
|
+
new scroll parent. Previously, the scroll element was resolved only once on mount, so subsequent
|
|
27
|
+
changes were silently ignored and popups would lose scroll tracking.
|
|
28
|
+
|
|
29
|
+
- Updated dependencies
|
|
30
|
+
|
|
3
31
|
## 114.9.0
|
|
4
32
|
|
|
5
33
|
### Minor Changes
|
|
@@ -56,6 +56,21 @@ var toolbarInsertBlockMessages = exports.toolbarInsertBlockMessages = (0, _react
|
|
|
56
56
|
defaultMessage: 'Image',
|
|
57
57
|
description: 'Shown as a menu item label in the editor insert menu, used to insert an image into the document.'
|
|
58
58
|
},
|
|
59
|
+
aiImageGeneration: {
|
|
60
|
+
id: 'fabric.editor.aiImageGeneration',
|
|
61
|
+
defaultMessage: 'Generate image',
|
|
62
|
+
description: 'Shown as a menu item label in the editor insert menu, used to open a popup for generating an image with AI.'
|
|
63
|
+
},
|
|
64
|
+
aiImageGenerationDescription: {
|
|
65
|
+
id: 'fabric.editor.aiImageGeneration.description',
|
|
66
|
+
defaultMessage: 'Generate an image with AI',
|
|
67
|
+
description: 'Displayed as a description text for the AI image generation option in the editor insert menu.'
|
|
68
|
+
},
|
|
69
|
+
aiImageGenerationPopupAriaLabel: {
|
|
70
|
+
id: 'fabric.editor.aiImageGeneration.popupAriaLabel',
|
|
71
|
+
defaultMessage: 'Generate image with AI',
|
|
72
|
+
description: 'Accessible label announced by screen readers when the AI image generation popup opens.'
|
|
73
|
+
},
|
|
59
74
|
mention: {
|
|
60
75
|
id: 'fabric.editor.mention',
|
|
61
76
|
defaultMessage: 'Mention',
|
|
@@ -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.
|
|
22
|
+
var packageVersion = "114.10.0";
|
|
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 = "114.
|
|
27
|
+
var packageVersion = "114.10.0";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -12,6 +12,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
12
12
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
var _bindEventListener = require("bind-event-listener");
|
|
15
16
|
var _focusTrap = _interopRequireDefault(require("focus-trap"));
|
|
16
17
|
var _rafSchd = _interopRequireDefault(require("raf-schd"));
|
|
17
18
|
var _reactDom = require("react-dom");
|
|
@@ -252,10 +253,44 @@ var Popup = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
|
252
253
|
return this.initFocusTrap();
|
|
253
254
|
}
|
|
254
255
|
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Idempotent scroll element setup — tears down any previous listener/observer
|
|
259
|
+
* then attaches to the current scroll parent.
|
|
260
|
+
*/
|
|
261
|
+
}, {
|
|
262
|
+
key: "initScrollElement",
|
|
263
|
+
value: function initScrollElement() {
|
|
264
|
+
var _this$unbindScroll;
|
|
265
|
+
var _this$props = this.props,
|
|
266
|
+
stick = _this$props.stick,
|
|
267
|
+
target = _this$props.target,
|
|
268
|
+
scrollableElement = _this$props.scrollableElement;
|
|
269
|
+
(_this$unbindScroll = this.unbindScroll) === null || _this$unbindScroll === void 0 || _this$unbindScroll.call(this);
|
|
270
|
+
if (this.scrollElement && this.resizeObserver) {
|
|
271
|
+
this.resizeObserver.unobserve(this.scrollElement);
|
|
272
|
+
}
|
|
273
|
+
this.scrollElement = scrollableElement;
|
|
274
|
+
if (stick && !this.scrollElement && target) {
|
|
275
|
+
this.scrollElement = (0, _utils.findOverflowScrollParent)(target);
|
|
276
|
+
}
|
|
277
|
+
if (this.scrollElement) {
|
|
278
|
+
if (this.resizeObserver) {
|
|
279
|
+
this.resizeObserver.observe(this.scrollElement);
|
|
280
|
+
}
|
|
281
|
+
this.unbindScroll = (0, _bindEventListener.bind)(this.scrollElement, {
|
|
282
|
+
type: 'scroll',
|
|
283
|
+
listener: this.onResize
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
}
|
|
255
287
|
}, {
|
|
256
288
|
key: "componentDidUpdate",
|
|
257
289
|
value: function componentDidUpdate(prevProps) {
|
|
258
290
|
this.handleChangedFocusTrapProp(prevProps);
|
|
291
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_fix_scrolling_popup_position', 'isEnabled', true) && prevProps.scrollableElement !== this.props.scrollableElement) {
|
|
292
|
+
this.initScrollElement();
|
|
293
|
+
}
|
|
259
294
|
if (this.props !== prevProps) {
|
|
260
295
|
this.scheduledUpdatePosition(prevProps);
|
|
261
296
|
}
|
|
@@ -266,16 +301,16 @@ var Popup = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
|
266
301
|
// Ignored via go/ees005
|
|
267
302
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
268
303
|
window.addEventListener('resize', this.onResize);
|
|
304
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_fix_scrolling_popup_position', 'isEnabled', true)) {
|
|
305
|
+
this.initScrollElement();
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
269
308
|
var stick = this.props.stick;
|
|
270
309
|
|
|
271
310
|
// Ignored via go/ees005
|
|
272
311
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
273
312
|
var target = this.props.target;
|
|
274
|
-
|
|
275
|
-
// Resolve the effective scroll parent: prefer the explicitly provided scrollableElement
|
|
276
|
-
// prop over the auto-detected ancestor. Allows product consumers to provide the correct
|
|
277
|
-
// scroll container (e.g. a modal body) when auto-detection can't find it.
|
|
278
|
-
var scrollParentElement = (0, _expValEquals.expValEquals)('platform_editor_fix_scrolling_popup_position', 'isEnabled', true) ? this.props.scrollableElement || (0, _utils.findOverflowScrollParent)(target) : (0, _utils.findOverflowScrollParent)(target);
|
|
313
|
+
var scrollParentElement = (0, _utils.findOverflowScrollParent)(target);
|
|
279
314
|
if (scrollParentElement && this.resizeObserver) {
|
|
280
315
|
this.resizeObserver.observe(scrollParentElement);
|
|
281
316
|
}
|
|
@@ -293,10 +328,11 @@ var Popup = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
|
293
328
|
}, {
|
|
294
329
|
key: "componentWillUnmount",
|
|
295
330
|
value: function componentWillUnmount() {
|
|
296
|
-
var _this$resizeObserver3;
|
|
331
|
+
var _this$unbindScroll2, _this$resizeObserver3;
|
|
297
332
|
// Ignored via go/ees005
|
|
298
333
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
299
334
|
window.removeEventListener('resize', this.onResize);
|
|
335
|
+
(_this$unbindScroll2 = this.unbindScroll) === null || _this$unbindScroll2 === void 0 || _this$unbindScroll2.call(this);
|
|
300
336
|
if (this.scrollElement) {
|
|
301
337
|
// Ignored via go/ees005
|
|
302
338
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
@@ -355,9 +391,9 @@ var Popup = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
|
355
391
|
}, {
|
|
356
392
|
key: "render",
|
|
357
393
|
value: function render() {
|
|
358
|
-
var _this$
|
|
359
|
-
target = _this$
|
|
360
|
-
mountTo = _this$
|
|
394
|
+
var _this$props2 = this.props,
|
|
395
|
+
target = _this$props2.target,
|
|
396
|
+
mountTo = _this$props2.mountTo;
|
|
361
397
|
var validPosition = this.state.validPosition;
|
|
362
398
|
if (!target || !validPosition) {
|
|
363
399
|
return null;
|
|
@@ -50,6 +50,21 @@ export const toolbarInsertBlockMessages = defineMessages({
|
|
|
50
50
|
defaultMessage: 'Image',
|
|
51
51
|
description: 'Shown as a menu item label in the editor insert menu, used to insert an image into the document.'
|
|
52
52
|
},
|
|
53
|
+
aiImageGeneration: {
|
|
54
|
+
id: 'fabric.editor.aiImageGeneration',
|
|
55
|
+
defaultMessage: 'Generate image',
|
|
56
|
+
description: 'Shown as a menu item label in the editor insert menu, used to open a popup for generating an image with AI.'
|
|
57
|
+
},
|
|
58
|
+
aiImageGenerationDescription: {
|
|
59
|
+
id: 'fabric.editor.aiImageGeneration.description',
|
|
60
|
+
defaultMessage: 'Generate an image with AI',
|
|
61
|
+
description: 'Displayed as a description text for the AI image generation option in the editor insert menu.'
|
|
62
|
+
},
|
|
63
|
+
aiImageGenerationPopupAriaLabel: {
|
|
64
|
+
id: 'fabric.editor.aiImageGeneration.popupAriaLabel',
|
|
65
|
+
defaultMessage: 'Generate image with AI',
|
|
66
|
+
description: 'Accessible label announced by screen readers when the AI image generation popup opens.'
|
|
67
|
+
},
|
|
53
68
|
mention: {
|
|
54
69
|
id: 'fabric.editor.mention',
|
|
55
70
|
defaultMessage: 'Mention',
|
|
@@ -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.
|
|
7
|
+
const packageVersion = "114.10.0";
|
|
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 = "114.
|
|
17
|
+
const packageVersion = "114.10.0";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { bind } from 'bind-event-listener';
|
|
3
4
|
import createFocusTrap from 'focus-trap';
|
|
4
5
|
import rafSchedule from 'raf-schd';
|
|
5
6
|
import { createPortal, flushSync } from 'react-dom';
|
|
@@ -220,8 +221,41 @@ export default class Popup extends React.Component {
|
|
|
220
221
|
return this.initFocusTrap();
|
|
221
222
|
}
|
|
222
223
|
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Idempotent scroll element setup — tears down any previous listener/observer
|
|
227
|
+
* then attaches to the current scroll parent.
|
|
228
|
+
*/
|
|
229
|
+
initScrollElement() {
|
|
230
|
+
var _this$unbindScroll;
|
|
231
|
+
const {
|
|
232
|
+
stick,
|
|
233
|
+
target,
|
|
234
|
+
scrollableElement
|
|
235
|
+
} = this.props;
|
|
236
|
+
(_this$unbindScroll = this.unbindScroll) === null || _this$unbindScroll === void 0 ? void 0 : _this$unbindScroll.call(this);
|
|
237
|
+
if (this.scrollElement && this.resizeObserver) {
|
|
238
|
+
this.resizeObserver.unobserve(this.scrollElement);
|
|
239
|
+
}
|
|
240
|
+
this.scrollElement = scrollableElement;
|
|
241
|
+
if (stick && !this.scrollElement && target) {
|
|
242
|
+
this.scrollElement = findOverflowScrollParent(target);
|
|
243
|
+
}
|
|
244
|
+
if (this.scrollElement) {
|
|
245
|
+
if (this.resizeObserver) {
|
|
246
|
+
this.resizeObserver.observe(this.scrollElement);
|
|
247
|
+
}
|
|
248
|
+
this.unbindScroll = bind(this.scrollElement, {
|
|
249
|
+
type: 'scroll',
|
|
250
|
+
listener: this.onResize
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}
|
|
223
254
|
componentDidUpdate(prevProps) {
|
|
224
255
|
this.handleChangedFocusTrapProp(prevProps);
|
|
256
|
+
if (expValEquals('platform_editor_fix_scrolling_popup_position', 'isEnabled', true) && prevProps.scrollableElement !== this.props.scrollableElement) {
|
|
257
|
+
this.initScrollElement();
|
|
258
|
+
}
|
|
225
259
|
if (this.props !== prevProps) {
|
|
226
260
|
this.scheduledUpdatePosition(prevProps);
|
|
227
261
|
}
|
|
@@ -230,6 +264,10 @@ export default class Popup extends React.Component {
|
|
|
230
264
|
// Ignored via go/ees005
|
|
231
265
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
232
266
|
window.addEventListener('resize', this.onResize);
|
|
267
|
+
if (expValEquals('platform_editor_fix_scrolling_popup_position', 'isEnabled', true)) {
|
|
268
|
+
this.initScrollElement();
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
233
271
|
const {
|
|
234
272
|
stick
|
|
235
273
|
} = this.props;
|
|
@@ -237,11 +275,7 @@ export default class Popup extends React.Component {
|
|
|
237
275
|
// Ignored via go/ees005
|
|
238
276
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
239
277
|
const target = this.props.target;
|
|
240
|
-
|
|
241
|
-
// Resolve the effective scroll parent: prefer the explicitly provided scrollableElement
|
|
242
|
-
// prop over the auto-detected ancestor. Allows product consumers to provide the correct
|
|
243
|
-
// scroll container (e.g. a modal body) when auto-detection can't find it.
|
|
244
|
-
const scrollParentElement = expValEquals('platform_editor_fix_scrolling_popup_position', 'isEnabled', true) ? this.props.scrollableElement || findOverflowScrollParent(target) : findOverflowScrollParent(target);
|
|
278
|
+
const scrollParentElement = findOverflowScrollParent(target);
|
|
245
279
|
if (scrollParentElement && this.resizeObserver) {
|
|
246
280
|
this.resizeObserver.observe(scrollParentElement);
|
|
247
281
|
}
|
|
@@ -257,10 +291,11 @@ export default class Popup extends React.Component {
|
|
|
257
291
|
}
|
|
258
292
|
}
|
|
259
293
|
componentWillUnmount() {
|
|
260
|
-
var _this$resizeObserver3;
|
|
294
|
+
var _this$unbindScroll2, _this$resizeObserver3;
|
|
261
295
|
// Ignored via go/ees005
|
|
262
296
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
263
297
|
window.removeEventListener('resize', this.onResize);
|
|
298
|
+
(_this$unbindScroll2 = this.unbindScroll) === null || _this$unbindScroll2 === void 0 ? void 0 : _this$unbindScroll2.call(this);
|
|
264
299
|
if (this.scrollElement) {
|
|
265
300
|
// Ignored via go/ees005
|
|
266
301
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
@@ -50,6 +50,21 @@ export var toolbarInsertBlockMessages = defineMessages({
|
|
|
50
50
|
defaultMessage: 'Image',
|
|
51
51
|
description: 'Shown as a menu item label in the editor insert menu, used to insert an image into the document.'
|
|
52
52
|
},
|
|
53
|
+
aiImageGeneration: {
|
|
54
|
+
id: 'fabric.editor.aiImageGeneration',
|
|
55
|
+
defaultMessage: 'Generate image',
|
|
56
|
+
description: 'Shown as a menu item label in the editor insert menu, used to open a popup for generating an image with AI.'
|
|
57
|
+
},
|
|
58
|
+
aiImageGenerationDescription: {
|
|
59
|
+
id: 'fabric.editor.aiImageGeneration.description',
|
|
60
|
+
defaultMessage: 'Generate an image with AI',
|
|
61
|
+
description: 'Displayed as a description text for the AI image generation option in the editor insert menu.'
|
|
62
|
+
},
|
|
63
|
+
aiImageGenerationPopupAriaLabel: {
|
|
64
|
+
id: 'fabric.editor.aiImageGeneration.popupAriaLabel',
|
|
65
|
+
defaultMessage: 'Generate image with AI',
|
|
66
|
+
description: 'Accessible label announced by screen readers when the AI image generation popup opens.'
|
|
67
|
+
},
|
|
53
68
|
mention: {
|
|
54
69
|
id: 'fabric.editor.mention',
|
|
55
70
|
defaultMessage: 'Mention',
|
|
@@ -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.
|
|
13
|
+
var packageVersion = "114.10.0";
|
|
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 = "114.
|
|
24
|
+
var packageVersion = "114.10.0";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -9,6 +9,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
9
9
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
11
|
import React from 'react';
|
|
12
|
+
import { bind } from 'bind-event-listener';
|
|
12
13
|
import createFocusTrap from 'focus-trap';
|
|
13
14
|
import rafSchedule from 'raf-schd';
|
|
14
15
|
import { createPortal, flushSync } from 'react-dom';
|
|
@@ -245,10 +246,44 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
245
246
|
return this.initFocusTrap();
|
|
246
247
|
}
|
|
247
248
|
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Idempotent scroll element setup — tears down any previous listener/observer
|
|
252
|
+
* then attaches to the current scroll parent.
|
|
253
|
+
*/
|
|
254
|
+
}, {
|
|
255
|
+
key: "initScrollElement",
|
|
256
|
+
value: function initScrollElement() {
|
|
257
|
+
var _this$unbindScroll;
|
|
258
|
+
var _this$props = this.props,
|
|
259
|
+
stick = _this$props.stick,
|
|
260
|
+
target = _this$props.target,
|
|
261
|
+
scrollableElement = _this$props.scrollableElement;
|
|
262
|
+
(_this$unbindScroll = this.unbindScroll) === null || _this$unbindScroll === void 0 || _this$unbindScroll.call(this);
|
|
263
|
+
if (this.scrollElement && this.resizeObserver) {
|
|
264
|
+
this.resizeObserver.unobserve(this.scrollElement);
|
|
265
|
+
}
|
|
266
|
+
this.scrollElement = scrollableElement;
|
|
267
|
+
if (stick && !this.scrollElement && target) {
|
|
268
|
+
this.scrollElement = findOverflowScrollParent(target);
|
|
269
|
+
}
|
|
270
|
+
if (this.scrollElement) {
|
|
271
|
+
if (this.resizeObserver) {
|
|
272
|
+
this.resizeObserver.observe(this.scrollElement);
|
|
273
|
+
}
|
|
274
|
+
this.unbindScroll = bind(this.scrollElement, {
|
|
275
|
+
type: 'scroll',
|
|
276
|
+
listener: this.onResize
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
}
|
|
248
280
|
}, {
|
|
249
281
|
key: "componentDidUpdate",
|
|
250
282
|
value: function componentDidUpdate(prevProps) {
|
|
251
283
|
this.handleChangedFocusTrapProp(prevProps);
|
|
284
|
+
if (expValEquals('platform_editor_fix_scrolling_popup_position', 'isEnabled', true) && prevProps.scrollableElement !== this.props.scrollableElement) {
|
|
285
|
+
this.initScrollElement();
|
|
286
|
+
}
|
|
252
287
|
if (this.props !== prevProps) {
|
|
253
288
|
this.scheduledUpdatePosition(prevProps);
|
|
254
289
|
}
|
|
@@ -259,16 +294,16 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
259
294
|
// Ignored via go/ees005
|
|
260
295
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
261
296
|
window.addEventListener('resize', this.onResize);
|
|
297
|
+
if (expValEquals('platform_editor_fix_scrolling_popup_position', 'isEnabled', true)) {
|
|
298
|
+
this.initScrollElement();
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
262
301
|
var stick = this.props.stick;
|
|
263
302
|
|
|
264
303
|
// Ignored via go/ees005
|
|
265
304
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
266
305
|
var target = this.props.target;
|
|
267
|
-
|
|
268
|
-
// Resolve the effective scroll parent: prefer the explicitly provided scrollableElement
|
|
269
|
-
// prop over the auto-detected ancestor. Allows product consumers to provide the correct
|
|
270
|
-
// scroll container (e.g. a modal body) when auto-detection can't find it.
|
|
271
|
-
var scrollParentElement = expValEquals('platform_editor_fix_scrolling_popup_position', 'isEnabled', true) ? this.props.scrollableElement || findOverflowScrollParent(target) : findOverflowScrollParent(target);
|
|
306
|
+
var scrollParentElement = findOverflowScrollParent(target);
|
|
272
307
|
if (scrollParentElement && this.resizeObserver) {
|
|
273
308
|
this.resizeObserver.observe(scrollParentElement);
|
|
274
309
|
}
|
|
@@ -286,10 +321,11 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
286
321
|
}, {
|
|
287
322
|
key: "componentWillUnmount",
|
|
288
323
|
value: function componentWillUnmount() {
|
|
289
|
-
var _this$resizeObserver3;
|
|
324
|
+
var _this$unbindScroll2, _this$resizeObserver3;
|
|
290
325
|
// Ignored via go/ees005
|
|
291
326
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
292
327
|
window.removeEventListener('resize', this.onResize);
|
|
328
|
+
(_this$unbindScroll2 = this.unbindScroll) === null || _this$unbindScroll2 === void 0 || _this$unbindScroll2.call(this);
|
|
293
329
|
if (this.scrollElement) {
|
|
294
330
|
// Ignored via go/ees005
|
|
295
331
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
@@ -348,9 +384,9 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
348
384
|
}, {
|
|
349
385
|
key: "render",
|
|
350
386
|
value: function render() {
|
|
351
|
-
var _this$
|
|
352
|
-
target = _this$
|
|
353
|
-
mountTo = _this$
|
|
387
|
+
var _this$props2 = this.props,
|
|
388
|
+
target = _this$props2.target,
|
|
389
|
+
mountTo = _this$props2.mountTo;
|
|
354
390
|
var validPosition = this.state.validPosition;
|
|
355
391
|
if (!target || !validPosition) {
|
|
356
392
|
return null;
|
|
@@ -1,60 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
[AI_MENU_SECTION.key]: number;
|
|
4
|
-
[TRANSFORM_MENU_SECTION.key]: number;
|
|
5
|
-
[BLOCK_ACTIONS_MENU_SECTION.key]: number;
|
|
6
|
-
[BLOCK_ACTIONS_COPY_MENU_SECTION.key]: number;
|
|
7
|
-
[POSITION_MENU_SECTION.key]: number;
|
|
8
|
-
[DELETE_MENU_SECTION.key]: number;
|
|
9
|
-
};
|
|
10
|
-
export declare const AI_MENU_SECTION_RANK: {
|
|
11
|
-
[AI_ASK_ROVO_MENU_ITEM.key]: number;
|
|
12
|
-
};
|
|
1
|
+
export declare const MAIN_BLOCK_MENU_SECTION_RANK: {};
|
|
2
|
+
export declare const AI_MENU_SECTION_RANK: {};
|
|
13
3
|
export declare const TRANSFORM_MENU_SECTION_RANK: Record<string, number>;
|
|
14
|
-
export declare const TRANSFORM_SUGGESTED_MENU_SECTION_RANK: {
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
export declare const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
[TRANSFORM_STRUCTURE_MENU_SECTION.key]: number;
|
|
21
|
-
[TRANSFORM_HEADINGS_MENU_SECTION.key]: number;
|
|
22
|
-
[TRANSFORM_CLEAR_MENU_SECTION.key]: number;
|
|
23
|
-
};
|
|
24
|
-
export declare const TRANSFORM_CREATE_MENU_SECTION_RANK: {
|
|
25
|
-
[TRANSFORM_DEFAULT_EXTENSION_SLOT_MENU_ITEM.key]: number;
|
|
26
|
-
};
|
|
27
|
-
export declare const TRANSFORM_HEADINGS_MENU_SECTION_RANK: {
|
|
28
|
-
[TRANSFORM_HEADINGS_H1_MENU_ITEM.key]: number;
|
|
29
|
-
[TRANSFORM_HEADINGS_H2_MENU_ITEM.key]: number;
|
|
30
|
-
[TRANSFORM_HEADINGS_H3_MENU_ITEM.key]: number;
|
|
31
|
-
[TRANSFORM_HEADINGS_H4_MENU_ITEM.key]: number;
|
|
32
|
-
[TRANSFORM_HEADINGS_H5_MENU_ITEM.key]: number;
|
|
33
|
-
[TRANSFORM_HEADINGS_H6_MENU_ITEM.key]: number;
|
|
34
|
-
};
|
|
35
|
-
export declare const TRANSFORM_STRUCTURE_MENU_SECTION_RANK: {
|
|
36
|
-
[TRANSFORM_STRUCTURE_BULLETED_LIST_MENU_ITEM.key]: number;
|
|
37
|
-
[TRANSFORM_STRUCTURE_TASK_LIST_MENU_ITEM.key]: number;
|
|
38
|
-
[TRANSFORM_STRUCTURE_NUMBERED_LIST_MENU_ITEM.key]: number;
|
|
39
|
-
[TRANSFORM_STRUCTURE_CODE_BLOCK_MENU_ITEM.key]: number;
|
|
40
|
-
[TRANSFORM_STRUCTURE_PANEL_MENU_ITEM.key]: number;
|
|
41
|
-
[TRANSFORM_STRUCTURE_EXPAND_MENU_ITEM.key]: number;
|
|
42
|
-
[TRANSFORM_STRUCTURE_LAYOUT_MENU_ITEM.key]: number;
|
|
43
|
-
[TRANSFORM_STRUCTURE_QUOTE_MENU_ITEM.key]: number;
|
|
44
|
-
[TRANSFORM_STRUCTURE_DECISION_MENU_ITEM.key]: number;
|
|
45
|
-
[TRANSFORM_STRUCTURE_PARAGRAPH_MENU_ITEM.key]: number;
|
|
46
|
-
};
|
|
47
|
-
export declare const TRANSFORM_CLEAR_MENU_SECTION_RANK: {
|
|
48
|
-
[TRANSFORM_CLEAR_MENU_ITEM.key]: number;
|
|
49
|
-
};
|
|
4
|
+
export declare const TRANSFORM_SUGGESTED_MENU_SECTION_RANK: {};
|
|
5
|
+
export declare const TRANSFORM_MENU_ITEM_RANK: {};
|
|
6
|
+
export declare const TRANSFORM_CREATE_MENU_SECTION_RANK: {};
|
|
7
|
+
export declare const TRANSFORM_HEADINGS_MENU_SECTION_RANK: {};
|
|
8
|
+
export declare const TRANSFORM_STRUCTURE_MENU_SECTION_RANK: {};
|
|
9
|
+
export declare const TRANSFORM_CLEAR_MENU_SECTION_RANK: {};
|
|
50
10
|
export declare const BLOCK_ACTIONS_MENU_SECTION_RANK: Record<string, number>;
|
|
51
|
-
export declare const BLOCK_ACTIONS_COPY_MENU_SECTION_RANK: {
|
|
52
|
-
|
|
53
|
-
};
|
|
54
|
-
export declare const POSITION_MENU_SECTION_RANK: {
|
|
55
|
-
[POSITION_MOVE_UP_MENU_ITEM.key]: number;
|
|
56
|
-
[POSITION_MOVE_DOWN_MENU_ITEM.key]: number;
|
|
57
|
-
};
|
|
58
|
-
export declare const DELETE_MENU_SECTION_RANK: {
|
|
59
|
-
[DELETE_MENU_ITEM.key]: number;
|
|
60
|
-
};
|
|
11
|
+
export declare const BLOCK_ACTIONS_COPY_MENU_SECTION_RANK: {};
|
|
12
|
+
export declare const POSITION_MENU_SECTION_RANK: {};
|
|
13
|
+
export declare const DELETE_MENU_SECTION_RANK: {};
|