@atlaskit/editor-common 125.2.1 → 125.3.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 +19 -0
- package/dist/cjs/element-browser/components/ElementBrowserLoader.js +8 -31
- package/dist/cjs/extensions/extension-handlers.js +17 -96
- package/dist/cjs/floating-toolbar/DropdownMenuExtensionItems.js +4 -25
- package/dist/cjs/icons/index.js +10 -33
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/quick-insert/assets/index.js +257 -888
- package/dist/cjs/toolbar-flag-check.js +2 -2
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Mention/mention-with-profilecard.js +11 -30
- package/dist/cjs/ui/Popup/index.js +101 -17
- package/dist/es2019/element-browser/components/ElementBrowserLoader.js +2 -16
- package/dist/es2019/extensions/extension-handlers.js +15 -70
- package/dist/es2019/floating-toolbar/DropdownMenuExtensionItems.js +2 -16
- package/dist/es2019/icons/index.js +3 -17
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/quick-insert/assets/index.js +66 -386
- package/dist/es2019/toolbar-flag-check.js +2 -2
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Mention/mention-with-profilecard.js +4 -15
- package/dist/es2019/ui/Popup/index.js +89 -7
- package/dist/esm/element-browser/components/ElementBrowserLoader.js +6 -28
- package/dist/esm/extensions/extension-handlers.js +17 -97
- package/dist/esm/floating-toolbar/DropdownMenuExtensionItems.js +4 -24
- package/dist/esm/icons/index.js +7 -29
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/quick-insert/assets/index.js +194 -764
- package/dist/esm/toolbar-flag-check.js +2 -2
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Mention/mention-with-profilecard.js +8 -25
- package/dist/esm/ui/Popup/index.js +101 -17
- package/dist/types/icons/index.d.ts +3 -5
- package/dist/types/quick-insert/assets/index.d.ts +32 -34
- package/dist/types/ui/Popup/index.d.ts +11 -0
- package/package.json +3 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
2
2
|
export var areToolbarFlagsEnabled = function areToolbarFlagsEnabled(isNewToolbarEnabled) {
|
|
3
|
-
return Boolean(
|
|
3
|
+
return Boolean(editorExperiment('platform_editor_controls', 'variant1') || isNewToolbarEnabled);
|
|
4
4
|
};
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "125.2.
|
|
24
|
+
var packageVersion = "125.2.1";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import Loadable from 'react-loadable';
|
|
3
|
-
// oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
4
|
-
import { lazy, LazySuspense } from 'react-loosely-lazy';
|
|
5
3
|
import ResourcedMention from '@atlaskit/mention/resourced-mention';
|
|
6
4
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
7
5
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
@@ -13,33 +11,18 @@ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
|
13
11
|
// Lazy-loaded so the agent profile card chunk (and its `@atlaskit/rovo-agent-components`
|
|
14
12
|
// dependency) stays off the critical path — it is only fetched when an agent mention
|
|
15
13
|
// (`userType === 'APP'`) actually renders, never for person mentions.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
'@atlaskit/profilecard/agent-profile-card-trigger').then(function (mod) {
|
|
25
|
-
return mod.AgentProfileCardTrigger;
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
AgentProfileCardTriggerLazy.displayName = 'lazy(AgentProfileCardTrigger)';
|
|
29
|
-
var AgentProfileCardTriggerLoadable = Loadable({
|
|
30
|
-
loader: loadAgentProfileCardTrigger,
|
|
14
|
+
// Uses react-loadable to match editor-common's code-splitting factory (see src/icons/index.ts).
|
|
15
|
+
var AgentProfileCardTrigger = Loadable({
|
|
16
|
+
loader: function loader() {
|
|
17
|
+
return import( /* webpackChunkName: "@atlaskit-internal_profilecard/agent-profile-card-trigger" */
|
|
18
|
+
'@atlaskit/profilecard/agent-profile-card-trigger').then(function (mod) {
|
|
19
|
+
return mod.AgentProfileCardTrigger;
|
|
20
|
+
});
|
|
21
|
+
},
|
|
31
22
|
loading: function loading() {
|
|
32
23
|
return null;
|
|
33
24
|
}
|
|
34
25
|
});
|
|
35
|
-
var AgentProfileCardTrigger = function AgentProfileCardTrigger(props) {
|
|
36
|
-
return isExperimentEnabled('platform_editor_loosely_lazy_migration') ? /*#__PURE__*/React.createElement(LazySuspense, {
|
|
37
|
-
fallback: null
|
|
38
|
-
}, /*#__PURE__*/React.createElement(AgentProfileCardTriggerLazy, props)) :
|
|
39
|
-
/*#__PURE__*/
|
|
40
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
41
|
-
React.createElement(AgentProfileCardTriggerLoadable, props);
|
|
42
|
-
};
|
|
43
26
|
|
|
44
27
|
// Ignored via go/ees005
|
|
45
28
|
// eslint-disable-next-line require-unicode-regexp
|
|
@@ -14,6 +14,7 @@ import { bind } from 'bind-event-listener';
|
|
|
14
14
|
import createFocusTrap from 'focus-trap';
|
|
15
15
|
import rafSchedule from 'raf-schd';
|
|
16
16
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
17
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
17
18
|
import { calculatePlacement, calculatePosition as _calculatePosition, findOverflowScrollParent } from './utils';
|
|
18
19
|
import { validatePosition } from './validatePosition';
|
|
19
20
|
// Ignored via go/ees005
|
|
@@ -29,10 +30,45 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
29
30
|
_this = _callSuper(this, Popup, [].concat(args));
|
|
30
31
|
_defineProperty(_this, "rafIds", new Set());
|
|
31
32
|
_defineProperty(_this, "state", {
|
|
33
|
+
targetVisible: true,
|
|
32
34
|
validPosition: true
|
|
33
35
|
});
|
|
34
36
|
_defineProperty(_this, "popupRef", /*#__PURE__*/React.createRef());
|
|
35
37
|
_defineProperty(_this, "placement", ['', '']);
|
|
38
|
+
_defineProperty(_this, "setTargetVisibility", function (targetVisible) {
|
|
39
|
+
if (targetVisible !== _this.state.targetVisible) {
|
|
40
|
+
if (!targetVisible) {
|
|
41
|
+
var _this$focusTrap;
|
|
42
|
+
// Let consumers preserve focus before the popup becomes hidden.
|
|
43
|
+
_this.reportTargetVisibility(targetVisible);
|
|
44
|
+
(_this$focusTrap = _this.focusTrap) === null || _this$focusTrap === void 0 || _this$focusTrap.pause();
|
|
45
|
+
_this.setState({
|
|
46
|
+
targetVisible: targetVisible
|
|
47
|
+
});
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Reveal the popup before consumers restore focus to its contents.
|
|
52
|
+
_this.setState({
|
|
53
|
+
targetVisible: targetVisible
|
|
54
|
+
}, function () {
|
|
55
|
+
if (_this.props.focusTrap) {
|
|
56
|
+
var _this$focusTrap2;
|
|
57
|
+
(_this$focusTrap2 = _this.focusTrap) === null || _this$focusTrap2 === void 0 || _this$focusTrap2.unpause();
|
|
58
|
+
}
|
|
59
|
+
_this.reportTargetVisibility(targetVisible);
|
|
60
|
+
});
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
_this.reportTargetVisibility(targetVisible);
|
|
64
|
+
});
|
|
65
|
+
_defineProperty(_this, "reportTargetVisibility", function (targetVisible) {
|
|
66
|
+
if (targetVisible !== _this.reportedTargetVisibility) {
|
|
67
|
+
var _this$props$onTargetV, _this$props;
|
|
68
|
+
_this.reportedTargetVisibility = targetVisible;
|
|
69
|
+
(_this$props$onTargetV = (_this$props = _this.props).onTargetVisibilityChanged) === null || _this$props$onTargetV === void 0 || _this$props$onTargetV.call(_this$props, targetVisible);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
36
72
|
_defineProperty(_this, "handleRef", function (popup) {
|
|
37
73
|
if (!popup) {
|
|
38
74
|
return;
|
|
@@ -155,6 +191,41 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
155
191
|
});
|
|
156
192
|
}
|
|
157
193
|
}
|
|
194
|
+
}, {
|
|
195
|
+
key: "initTargetVisibilityObserver",
|
|
196
|
+
value: function initTargetVisibilityObserver() {
|
|
197
|
+
var _this$targetVisibilit,
|
|
198
|
+
_observedTarget$owner,
|
|
199
|
+
_this3 = this;
|
|
200
|
+
var _this$props2 = this.props,
|
|
201
|
+
hideWhenTargetOutOfView = _this$props2.hideWhenTargetOutOfView,
|
|
202
|
+
target = _this$props2.target,
|
|
203
|
+
visibilityTarget = _this$props2.visibilityTarget;
|
|
204
|
+
var observedTarget = visibilityTarget !== null && visibilityTarget !== void 0 ? visibilityTarget : target;
|
|
205
|
+
(_this$targetVisibilit = this.targetVisibilityObserver) === null || _this$targetVisibilit === void 0 || _this$targetVisibilit.disconnect();
|
|
206
|
+
this.targetVisibilityObserver = undefined;
|
|
207
|
+
if (!hideWhenTargetOutOfView || !isExperimentEnabled('platform_editor_popup_target_visibility')) {
|
|
208
|
+
if (!this.state.targetVisible) {
|
|
209
|
+
this.setTargetVisibility(true);
|
|
210
|
+
}
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
this.reportedTargetVisibility = undefined;
|
|
214
|
+
var IntersectionObserverConstructor = observedTarget === null || observedTarget === void 0 || (_observedTarget$owner = observedTarget.ownerDocument.defaultView) === null || _observedTarget$owner === void 0 ? void 0 : _observedTarget$owner.IntersectionObserver;
|
|
215
|
+
if (!IntersectionObserverConstructor || !observedTarget) {
|
|
216
|
+
this.setTargetVisibility(true);
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
this.targetVisibilityObserver = new IntersectionObserverConstructor(function (entries) {
|
|
220
|
+
var _entry$isIntersecting;
|
|
221
|
+
var entry = entries[entries.length - 1];
|
|
222
|
+
_this3.setTargetVisibility((_entry$isIntersecting = entry === null || entry === void 0 ? void 0 : entry.isIntersecting) !== null && _entry$isIntersecting !== void 0 ? _entry$isIntersecting : true);
|
|
223
|
+
}, {
|
|
224
|
+
root: null
|
|
225
|
+
});
|
|
226
|
+
this.targetVisibilityObserver.observe(observedTarget);
|
|
227
|
+
this.setTargetVisibility(true);
|
|
228
|
+
}
|
|
158
229
|
}, {
|
|
159
230
|
key: "cannotSetPopup",
|
|
160
231
|
value: function cannotSetPopup(popup, target, overflowScrollParent) {
|
|
@@ -222,9 +293,9 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
222
293
|
* Deactivates the focus trap if it exists
|
|
223
294
|
*/
|
|
224
295
|
function destroyFocusTrap() {
|
|
225
|
-
var _this$
|
|
296
|
+
var _this$focusTrap3;
|
|
226
297
|
this.initFocusTrap.cancel();
|
|
227
|
-
(_this$
|
|
298
|
+
(_this$focusTrap3 = this.focusTrap) === null || _this$focusTrap3 === void 0 || _this$focusTrap3.deactivate();
|
|
228
299
|
}
|
|
229
300
|
|
|
230
301
|
/**
|
|
@@ -236,8 +307,8 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
236
307
|
if (prevProps.focusTrap !== this.props.focusTrap) {
|
|
237
308
|
// If currently set to disable, then pause the trap if it exists
|
|
238
309
|
if (!this.props.focusTrap) {
|
|
239
|
-
var _this$
|
|
240
|
-
return (_this$
|
|
310
|
+
var _this$focusTrap4;
|
|
311
|
+
return (_this$focusTrap4 = this.focusTrap) === null || _this$focusTrap4 === void 0 ? void 0 : _this$focusTrap4.pause();
|
|
241
312
|
}
|
|
242
313
|
|
|
243
314
|
// If set to enabled and trap already exists, unpause
|
|
@@ -258,10 +329,10 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
258
329
|
key: "initScrollElement",
|
|
259
330
|
value: function initScrollElement() {
|
|
260
331
|
var _this$unbindScroll;
|
|
261
|
-
var _this$
|
|
262
|
-
stick = _this$
|
|
263
|
-
target = _this$
|
|
264
|
-
scrollableElement = _this$
|
|
332
|
+
var _this$props3 = this.props,
|
|
333
|
+
stick = _this$props3.stick,
|
|
334
|
+
target = _this$props3.target,
|
|
335
|
+
scrollableElement = _this$props3.scrollableElement;
|
|
265
336
|
(_this$unbindScroll = this.unbindScroll) === null || _this$unbindScroll === void 0 || _this$unbindScroll.call(this);
|
|
266
337
|
if (this.scrollElement && this.resizeObserver) {
|
|
267
338
|
this.resizeObserver.unobserve(this.scrollElement);
|
|
@@ -287,6 +358,11 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
287
358
|
if (prevProps.scrollableElement !== this.props.scrollableElement) {
|
|
288
359
|
this.initScrollElement();
|
|
289
360
|
}
|
|
361
|
+
// Reconfigure while enabled, or once after disabling to clean up the existing observer.
|
|
362
|
+
// A different target must be observed again.
|
|
363
|
+
if ((prevProps.hideWhenTargetOutOfView || this.props.hideWhenTargetOutOfView) && (prevProps.hideWhenTargetOutOfView !== this.props.hideWhenTargetOutOfView || prevProps.target !== this.props.target || prevProps.visibilityTarget !== this.props.visibilityTarget)) {
|
|
364
|
+
this.initTargetVisibilityObserver();
|
|
365
|
+
}
|
|
290
366
|
if (this.props !== prevProps) {
|
|
291
367
|
this.scheduledUpdatePosition(prevProps);
|
|
292
368
|
}
|
|
@@ -298,14 +374,18 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
298
374
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
299
375
|
window.addEventListener('resize', this.onResize);
|
|
300
376
|
this.initScrollElement();
|
|
377
|
+
if (this.props.hideWhenTargetOutOfView) {
|
|
378
|
+
this.initTargetVisibilityObserver();
|
|
379
|
+
}
|
|
301
380
|
}
|
|
302
381
|
}, {
|
|
303
382
|
key: "componentWillUnmount",
|
|
304
383
|
value: function componentWillUnmount() {
|
|
305
|
-
var _this$unbindScroll2, _this$resizeObserver3;
|
|
384
|
+
var _this$targetVisibilit2, _this$unbindScroll2, _this$resizeObserver3;
|
|
306
385
|
// Ignored via go/ees005
|
|
307
386
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
308
387
|
window.removeEventListener('resize', this.onResize);
|
|
388
|
+
(_this$targetVisibilit2 = this.targetVisibilityObserver) === null || _this$targetVisibilit2 === void 0 || _this$targetVisibilit2.disconnect();
|
|
309
389
|
(_this$unbindScroll2 = this.unbindScroll) === null || _this$unbindScroll2 === void 0 || _this$unbindScroll2.call(this);
|
|
310
390
|
if (this.scrollElement) {
|
|
311
391
|
// Ignored via go/ees005
|
|
@@ -324,8 +404,10 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
324
404
|
key: "renderPopup",
|
|
325
405
|
value: function renderPopup() {
|
|
326
406
|
var _this$props$ariaLabel,
|
|
327
|
-
|
|
328
|
-
var
|
|
407
|
+
_this4 = this;
|
|
408
|
+
var _this$state = this.state,
|
|
409
|
+
position = _this$state.position,
|
|
410
|
+
targetVisible = _this$state.targetVisible;
|
|
329
411
|
var shouldRenderPopup = this.props.shouldRenderPopup;
|
|
330
412
|
if (shouldRenderPopup && !shouldRenderPopup(position || {})) {
|
|
331
413
|
return null;
|
|
@@ -342,18 +424,20 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
342
424
|
// use role = dialog as default role, as dialog role itself is not a parent role that requires specific children to function as some other ARIA roles(menu) do
|
|
343
425
|
// if set default role to menu, tons of integration tests will fail as many of our popup usages do not have children that satisfy menu role requirements
|
|
344
426
|
if (ariaLabel) {
|
|
345
|
-
return
|
|
427
|
+
return _this4.props.role || 'dialog';
|
|
346
428
|
}
|
|
347
429
|
return undefined;
|
|
348
430
|
};
|
|
349
431
|
return /*#__PURE__*/React.createElement("div", {
|
|
350
432
|
ref: this.handleRef,
|
|
351
|
-
style: _objectSpread(_objectSpread({
|
|
433
|
+
style: _objectSpread(_objectSpread(_objectSpread({
|
|
352
434
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
353
435
|
position: 'absolute',
|
|
354
436
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
355
437
|
zIndex: this.props.zIndex || akEditorFloatingPanelZIndex
|
|
356
|
-
}, position), this.props.style),
|
|
438
|
+
}, position), this.props.style), this.props.hideWhenTargetOutOfView && isExperimentEnabled('platform_editor_popup_target_visibility') && !targetVisible && {
|
|
439
|
+
visibility: 'hidden'
|
|
440
|
+
}),
|
|
357
441
|
role: getRole(),
|
|
358
442
|
"aria-label": ariaLabel,
|
|
359
443
|
"data-testid": "popup-wrapper"
|
|
@@ -365,9 +449,9 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
365
449
|
}, {
|
|
366
450
|
key: "render",
|
|
367
451
|
value: function render() {
|
|
368
|
-
var _this$
|
|
369
|
-
target = _this$
|
|
370
|
-
mountTo = _this$
|
|
452
|
+
var _this$props4 = this.props,
|
|
453
|
+
target = _this$props4.target,
|
|
454
|
+
mountTo = _this$props4.mountTo;
|
|
371
455
|
var validPosition = this.state.validPosition;
|
|
372
456
|
if (!target || !validPosition) {
|
|
373
457
|
return null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import Loadable from 'react-loadable';
|
|
2
3
|
import type { IconProps } from '../types';
|
|
3
4
|
export { PanelInfoIcon } from './shared/PanelInfoIcon';
|
|
4
5
|
export { PanelWarningIcon } from './shared/PanelWarningIcon';
|
|
@@ -8,7 +9,4 @@ export { PanelNoteIcon } from './shared/PanelNoteIcon';
|
|
|
8
9
|
export { BorderIcon } from './shared/BorderIcon';
|
|
9
10
|
export { SteppedRainbowIconDecoration, rainbow, disabledRainbow, } from './shared/SteppedRainbowIconDecoration';
|
|
10
11
|
export { DynamicStrokeIconDecoration } from './shared/DynamicStrokeIconDecoration';
|
|
11
|
-
export declare const IconTable:
|
|
12
|
-
(props: React.PropsWithChildren<IconProps>): React.ReactElement;
|
|
13
|
-
preload: () => void;
|
|
14
|
-
};
|
|
12
|
+
export declare const IconTable: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
@@ -1,41 +1,39 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import Loadable from 'react-loadable';
|
|
2
3
|
import type { HeadingLevels, IconProps } from '../../types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const
|
|
20
|
-
export declare const
|
|
21
|
-
export declare const
|
|
22
|
-
export declare const
|
|
23
|
-
export declare const
|
|
24
|
-
export declare const
|
|
25
|
-
export declare const
|
|
26
|
-
export declare const
|
|
27
|
-
export declare const IconThreeColumnLayout: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
28
|
-
export declare const IconFourColumnLayout: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
29
|
-
export declare const IconFiveColumnLayout: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
4
|
+
export declare const IconAction: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
5
|
+
export declare const IconCode: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
6
|
+
export declare const IconDate: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
7
|
+
export declare const IconDecision: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
8
|
+
export declare const IconDivider: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
9
|
+
export declare const IconEmoji: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
10
|
+
export declare const IconImages: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
11
|
+
export declare const IconLayout: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
12
|
+
export declare const IconLink: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
13
|
+
export declare const IconListNumber: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
14
|
+
export declare const IconList: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
15
|
+
export declare const IconMention: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
16
|
+
export declare const IconPanelError: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
17
|
+
export declare const IconPanelNote: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
18
|
+
export declare const IconPanelSuccess: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
19
|
+
export declare const IconPanelWarning: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
20
|
+
export declare const IconPanel: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
21
|
+
export declare const IconQuote: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
22
|
+
export declare const IconStatus: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
23
|
+
export declare const IconOneColumnLayout: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
24
|
+
export declare const IconTwoColumnLayout: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
25
|
+
export declare const IconThreeColumnLayout: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
26
|
+
export declare const IconFourColumnLayout: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
27
|
+
export declare const IconFiveColumnLayout: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
30
28
|
type HeadingProps = IconProps & {
|
|
31
29
|
level: HeadingLevels;
|
|
32
30
|
};
|
|
33
31
|
export declare const IconHeading: ({ level, label, }: Pick<HeadingProps, 'level' | 'label'>) => React.JSX.Element;
|
|
34
|
-
export declare const IconFeedback:
|
|
35
|
-
export declare const IconExpand:
|
|
36
|
-
export declare const IconDatasourceJiraIssue:
|
|
37
|
-
export declare const IconDatasourceAssetsObjects:
|
|
38
|
-
export declare const IconDatasourceConfluenceSearch:
|
|
39
|
-
export declare const IconLoom:
|
|
40
|
-
export declare const IconSyncBlock:
|
|
32
|
+
export declare const IconFeedback: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
33
|
+
export declare const IconExpand: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
34
|
+
export declare const IconDatasourceJiraIssue: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
35
|
+
export declare const IconDatasourceAssetsObjects: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
36
|
+
export declare const IconDatasourceConfluenceSearch: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
37
|
+
export declare const IconLoom: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
38
|
+
export declare const IconSyncBlock: React.ComponentType<React.PropsWithChildren<IconProps>> & Loadable.LoadableComponent;
|
|
41
39
|
export {};
|
|
@@ -15,11 +15,14 @@ export interface Props {
|
|
|
15
15
|
/** Enable focus trap to contain the user's focus within the popup */
|
|
16
16
|
focusTrap?: boolean | FocusTrapOptions;
|
|
17
17
|
forcePlacement?: boolean;
|
|
18
|
+
/** Hide the popup while its visibility target is fully outside the visible viewport. */
|
|
19
|
+
hideWhenTargetOutOfView?: boolean;
|
|
18
20
|
minPopupMargin?: number;
|
|
19
21
|
mountTo?: HTMLElement;
|
|
20
22
|
offset?: number[];
|
|
21
23
|
onPlacementChanged?: (placement: [string, string]) => void;
|
|
22
24
|
onPositionCalculated?: (position: Position) => Position;
|
|
25
|
+
onTargetVisibilityChanged?: (isVisible: boolean) => void;
|
|
23
26
|
onUnmount?: () => void;
|
|
24
27
|
preventOverflow?: boolean;
|
|
25
28
|
rect?: DOMRect;
|
|
@@ -29,16 +32,21 @@ export interface Props {
|
|
|
29
32
|
stick?: boolean;
|
|
30
33
|
style?: React.CSSProperties;
|
|
31
34
|
target?: HTMLElement;
|
|
35
|
+
/** Element whose viewport visibility controls the popup. Defaults to `target`. */
|
|
36
|
+
visibilityTarget?: HTMLElement;
|
|
32
37
|
zIndex?: number;
|
|
33
38
|
}
|
|
34
39
|
export interface State {
|
|
35
40
|
popup?: HTMLElement;
|
|
36
41
|
position?: Position;
|
|
42
|
+
targetVisible: boolean;
|
|
37
43
|
validPosition: boolean;
|
|
38
44
|
}
|
|
39
45
|
export default class Popup extends React.Component<Props, State> {
|
|
40
46
|
scrollElement: undefined | false | HTMLElement;
|
|
47
|
+
private reportedTargetVisibility?;
|
|
41
48
|
private unbindScroll?;
|
|
49
|
+
private targetVisibilityObserver?;
|
|
42
50
|
rafIds: Set<number>;
|
|
43
51
|
static defaultProps: {
|
|
44
52
|
allowOutOfBound: boolean;
|
|
@@ -53,6 +61,9 @@ export default class Popup extends React.Component<Props, State> {
|
|
|
53
61
|
*/
|
|
54
62
|
private calculatePosition;
|
|
55
63
|
private updatePosition;
|
|
64
|
+
private setTargetVisibility;
|
|
65
|
+
private reportTargetVisibility;
|
|
66
|
+
private initTargetVisibilityObserver;
|
|
56
67
|
private cannotSetPopup;
|
|
57
68
|
/**
|
|
58
69
|
* Popup initialization.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "125.
|
|
3
|
+
"version": "125.3.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/"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@atlaskit/editor-prosemirror": "^9.0.0",
|
|
48
48
|
"@atlaskit/editor-shared-styles": "^4.3.0",
|
|
49
49
|
"@atlaskit/editor-tables": "^3.2.0",
|
|
50
|
-
"@atlaskit/editor-toolbar": "^2.
|
|
50
|
+
"@atlaskit/editor-toolbar": "^2.8.0",
|
|
51
51
|
"@atlaskit/editor-toolbar-model": "^1.2.0",
|
|
52
52
|
"@atlaskit/editor-ui-control-model": "^2.10.0",
|
|
53
53
|
"@atlaskit/emoji": "^72.4.0",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
79
79
|
"@atlaskit/react-ufo": "^8.0.0",
|
|
80
80
|
"@atlaskit/section-message": "^10.2.0",
|
|
81
|
-
"@atlaskit/smart-card": "^46.
|
|
81
|
+
"@atlaskit/smart-card": "^46.1.0",
|
|
82
82
|
"@atlaskit/smart-user-picker": "^12.0.0",
|
|
83
83
|
"@atlaskit/spinner": "^20.4.0",
|
|
84
84
|
"@atlaskit/task-decision": "^21.10.0",
|
|
@@ -112,7 +112,6 @@
|
|
|
112
112
|
"re-resizable": "6.0.0",
|
|
113
113
|
"react-focus-lock": "^2.9.5",
|
|
114
114
|
"react-loadable": "^5.1.0",
|
|
115
|
-
"react-loosely-lazy": "^1.0.0",
|
|
116
115
|
"react-virtualized": "^9.22.6",
|
|
117
116
|
"rusha": "^0.8.13",
|
|
118
117
|
"uuid": "^11.1.1",
|