@atlaskit/editor-common 134.6.2 → 134.7.2
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 +36 -0
- package/dist/cjs/analytics/types/ai-suggestions-events.js +2 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/quick-insert/CompactQuickInsertMenuItem.compiled.css +2 -9
- package/dist/cjs/quick-insert/CompactQuickInsertMenuItem.js +6 -6
- package/dist/cjs/quick-insert/ElementBrowserQuickInsertMenuItem.js +76 -103
- package/dist/cjs/quick-insert/QuickInsertHoverPreview.compiled.css +1 -38
- package/dist/cjs/quick-insert/QuickInsertHoverPreview.js +9 -93
- package/dist/cjs/quick-insert/QuickInsertMenuItem.js +2 -1
- package/dist/cjs/quick-insert/QuickInsertPreviewContent.compiled.css +38 -0
- package/dist/cjs/quick-insert/QuickInsertPreviewContent.js +142 -0
- package/dist/cjs/quick-insert/QuickInsertShortcut.compiled.css +10 -0
- package/dist/cjs/quick-insert/QuickInsertShortcut.js +28 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Layer/index.js +14 -208
- package/dist/cjs/vanilla-tooltip/index.js +5 -14
- package/dist/es2019/analytics/types/ai-suggestions-events.js +2 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/quick-insert/CompactQuickInsertMenuItem.compiled.css +2 -9
- package/dist/es2019/quick-insert/CompactQuickInsertMenuItem.js +6 -6
- package/dist/es2019/quick-insert/ElementBrowserQuickInsertMenuItem.js +74 -101
- package/dist/es2019/quick-insert/QuickInsertHoverPreview.compiled.css +1 -38
- package/dist/es2019/quick-insert/QuickInsertHoverPreview.js +10 -86
- package/dist/es2019/quick-insert/QuickInsertMenuItem.js +2 -1
- package/dist/es2019/quick-insert/QuickInsertPreviewContent.compiled.css +38 -0
- package/dist/es2019/quick-insert/QuickInsertPreviewContent.js +126 -0
- package/dist/es2019/quick-insert/QuickInsertShortcut.compiled.css +10 -0
- package/dist/es2019/quick-insert/QuickInsertShortcut.js +19 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Layer/index.js +15 -192
- package/dist/es2019/vanilla-tooltip/index.js +7 -15
- package/dist/esm/analytics/types/ai-suggestions-events.js +2 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/quick-insert/CompactQuickInsertMenuItem.compiled.css +2 -9
- package/dist/esm/quick-insert/CompactQuickInsertMenuItem.js +6 -6
- package/dist/esm/quick-insert/ElementBrowserQuickInsertMenuItem.js +77 -104
- package/dist/esm/quick-insert/QuickInsertHoverPreview.compiled.css +1 -38
- package/dist/esm/quick-insert/QuickInsertHoverPreview.js +10 -93
- package/dist/esm/quick-insert/QuickInsertMenuItem.js +2 -1
- package/dist/esm/quick-insert/QuickInsertPreviewContent.compiled.css +38 -0
- package/dist/esm/quick-insert/QuickInsertPreviewContent.js +135 -0
- package/dist/esm/quick-insert/QuickInsertShortcut.compiled.css +10 -0
- package/dist/esm/quick-insert/QuickInsertShortcut.js +21 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Layer/index.js +15 -211
- package/dist/esm/vanilla-tooltip/index.js +7 -15
- package/dist/types/analytics/types/ai-suggestions-events.d.ts +3 -1
- package/dist/types/quick-insert/ElementBrowserQuickInsertMenuItem.d.ts +7 -1
- package/dist/types/quick-insert/QuickInsertHoverPreview.d.ts +0 -1
- package/dist/types/quick-insert/QuickInsertPreviewContent.d.ts +24 -0
- package/dist/types/quick-insert/QuickInsertShortcut.d.ts +13 -0
- package/dist/types/ui/Layer/index.d.ts +1 -15
- package/dist/types/vanilla-tooltip/index.d.ts +1 -1
- package/package.json +3 -8
|
@@ -1,39 +1,9 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
11
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
12
|
-
import React, { Component, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
13
|
-
// eslint-disable-next-line @atlaskit/design-system/no-third-party-layering -- existing usage from before this rule was added
|
|
14
|
-
import Popper from 'popper.js';
|
|
15
|
-
// eslint-disable-next-line @atlaskit/design-system/no-third-party-layering -- existing usage from before this rule was added
|
|
16
|
-
|
|
17
|
-
// eslint-disable-line import/extensions
|
|
18
|
-
import rafSchedule from 'raf-schd';
|
|
2
|
+
import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
19
3
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
20
4
|
import { Popper as WrappedPopper } from '@atlaskit/popper/main';
|
|
5
|
+
import { Manager } from '@atlaskit/popper/manager';
|
|
21
6
|
import { positionPropToPopperPosition } from './internal/helpers';
|
|
22
|
-
var defaultState = {
|
|
23
|
-
hasExtractedStyles: false,
|
|
24
|
-
// We set these default offsets to prevent a flash of popper content in the wrong position
|
|
25
|
-
// which can cause incorrect height calculations. Popper will calculate these values
|
|
26
|
-
offsets: {
|
|
27
|
-
popper: {
|
|
28
|
-
left: -9999,
|
|
29
|
-
top: -9999,
|
|
30
|
-
position: null
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
cssPosition: 'absolute',
|
|
34
|
-
originalHeight: null,
|
|
35
|
-
maxHeight: null
|
|
36
|
-
};
|
|
37
7
|
function defaultOnPositioned() {}
|
|
38
8
|
var defaultProps = {
|
|
39
9
|
boundariesElement: 'viewport',
|
|
@@ -46,170 +16,6 @@ var defaultProps = {
|
|
|
46
16
|
isAlwaysFixed: false,
|
|
47
17
|
onPositioned: defaultOnPositioned
|
|
48
18
|
};
|
|
49
|
-
|
|
50
|
-
// Ignored via go/ees005
|
|
51
|
-
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
52
|
-
var LegacyLayer = /*#__PURE__*/function (_Component) {
|
|
53
|
-
function LegacyLayer(props) {
|
|
54
|
-
var _this;
|
|
55
|
-
_classCallCheck(this, LegacyLayer);
|
|
56
|
-
_this = _callSuper(this, LegacyLayer, [props]);
|
|
57
|
-
_defineProperty(_this, "targetRef", /*#__PURE__*/React.createRef());
|
|
58
|
-
_defineProperty(_this, "contentRef", /*#__PURE__*/React.createRef());
|
|
59
|
-
_defineProperty(_this, "extractStyles", function (state) {
|
|
60
|
-
if (state) {
|
|
61
|
-
var popperHeight = state.offsets.popper.height;
|
|
62
|
-
var left = Math.round(state.offsets.popper.left);
|
|
63
|
-
var top = Math.round(state.offsets.popper.top);
|
|
64
|
-
var cssPosition = 'absolute';
|
|
65
|
-
var originalHeight = _this.state.originalHeight || popperHeight;
|
|
66
|
-
var maxHeight = _this.calculateMaxHeight(originalHeight, popperHeight, top, cssPosition);
|
|
67
|
-
_this.setState({
|
|
68
|
-
// position: fixed or absolute
|
|
69
|
-
cssPosition: cssPosition,
|
|
70
|
-
hasExtractedStyles: true,
|
|
71
|
-
transform: "translate3d(".concat(left, "px, ").concat(top, "px, 0px)"),
|
|
72
|
-
originalHeight: originalHeight,
|
|
73
|
-
maxHeight: maxHeight
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
_this.state = defaultState;
|
|
78
|
-
_this.extractStyles = rafSchedule(_this.extractStyles.bind(_this));
|
|
79
|
-
return _this;
|
|
80
|
-
}
|
|
81
|
-
_inherits(LegacyLayer, _Component);
|
|
82
|
-
return _createClass(LegacyLayer, [{
|
|
83
|
-
key: "componentDidMount",
|
|
84
|
-
value: function componentDidMount() {
|
|
85
|
-
this.applyPopper(this.props);
|
|
86
|
-
}
|
|
87
|
-
}, {
|
|
88
|
-
key: "componentDidUpdate",
|
|
89
|
-
value: function componentDidUpdate(prevProps, prevState) {
|
|
90
|
-
var onPositioned = this.props.onPositioned;
|
|
91
|
-
var hasExtractedStyles = this.state.hasExtractedStyles;
|
|
92
|
-
if (this.props !== prevProps) {
|
|
93
|
-
this.applyPopper(this.props);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// This flag is set the first time the position is calculated from Popper and applied to the content
|
|
97
|
-
if (!prevState.hasExtractedStyles && hasExtractedStyles && onPositioned) {
|
|
98
|
-
onPositioned();
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}, {
|
|
102
|
-
key: "componentWillUnmount",
|
|
103
|
-
value: function componentWillUnmount() {
|
|
104
|
-
// this.extractStyles.cancel();
|
|
105
|
-
if (this.popper) {
|
|
106
|
-
this.popper.destroy();
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/* Calculate the max height of the popper if it's height is greater than the viewport to prevent
|
|
111
|
-
* the bottom of the popper not being viewable.
|
|
112
|
-
* Only works if the popper uses viewport as the boundary and has a fixed position ancestor.
|
|
113
|
-
*/
|
|
114
|
-
}, {
|
|
115
|
-
key: "calculateMaxHeight",
|
|
116
|
-
value: function calculateMaxHeight(originalHeight, currentHeight, positionTop, cssPosition) {
|
|
117
|
-
var DocumentElementClientHeight = 0;
|
|
118
|
-
if (document.documentElement) {
|
|
119
|
-
DocumentElementClientHeight = document.documentElement.clientHeight;
|
|
120
|
-
}
|
|
121
|
-
if (cssPosition !== 'fixed') {
|
|
122
|
-
return null;
|
|
123
|
-
}
|
|
124
|
-
var viewportHeight = Math.max(DocumentElementClientHeight, window.innerHeight || 0);
|
|
125
|
-
return viewportHeight < originalHeight && currentHeight + positionTop >= viewportHeight - 50 ?
|
|
126
|
-
// allow some spacing either side of viewport height
|
|
127
|
-
viewportHeight - 12 : null;
|
|
128
|
-
}
|
|
129
|
-
}, {
|
|
130
|
-
key: "applyPopper",
|
|
131
|
-
value: function applyPopper(props) {
|
|
132
|
-
if (!this.targetRef.current || !this.contentRef.current) {
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
if (this.popper) {
|
|
136
|
-
this.popper.destroy();
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// "new Popper(...)" operation is very expensive when called on virtual DOM.
|
|
140
|
-
// This condition reduces the number of calls so we can run our tests faster
|
|
141
|
-
// (time was reduced from 100s to 13s).
|
|
142
|
-
if (!props.content) {
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// we wrap our target in a div so that we can safely get a reference to it, but we pass the
|
|
147
|
-
// actual target to popper
|
|
148
|
-
var isAlwaysFixed = false;
|
|
149
|
-
var actualTarget = this.targetRef.current.children[0];
|
|
150
|
-
var popperOpts = {
|
|
151
|
-
placement: positionPropToPopperPosition(props.position),
|
|
152
|
-
onCreate: this.extractStyles,
|
|
153
|
-
onUpdate: this.extractStyles,
|
|
154
|
-
modifiers: {
|
|
155
|
-
applyStyle: {
|
|
156
|
-
enabled: false
|
|
157
|
-
},
|
|
158
|
-
hide: {
|
|
159
|
-
enabled: false
|
|
160
|
-
},
|
|
161
|
-
offset: {
|
|
162
|
-
enabled: true,
|
|
163
|
-
offset: this.props.offset
|
|
164
|
-
},
|
|
165
|
-
flip: {
|
|
166
|
-
enabled: false,
|
|
167
|
-
flipVariations: true,
|
|
168
|
-
boundariesElement: 'viewport',
|
|
169
|
-
padding: 0 // leave 0 pixels between popper and the boundariesElement
|
|
170
|
-
},
|
|
171
|
-
preventOverflow: {
|
|
172
|
-
enabled: false,
|
|
173
|
-
escapeWithReference: true
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
positionFixed: isAlwaysFixed
|
|
177
|
-
};
|
|
178
|
-
if (actualTarget) {
|
|
179
|
-
this.popper = new Popper(actualTarget, this.contentRef.current, popperOpts);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}, {
|
|
183
|
-
key: "render",
|
|
184
|
-
value: function render() {
|
|
185
|
-
var _this$state = this.state,
|
|
186
|
-
transform = _this$state.transform,
|
|
187
|
-
hasExtractedStyles = _this$state.hasExtractedStyles,
|
|
188
|
-
maxHeight = _this$state.maxHeight;
|
|
189
|
-
var opacity = hasExtractedStyles ? {} : {
|
|
190
|
-
opacity: 0
|
|
191
|
-
};
|
|
192
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
193
|
-
ref: this.targetRef
|
|
194
|
-
}, this.props.children), /*#__PURE__*/React.createElement("div", {
|
|
195
|
-
ref: this.contentRef,
|
|
196
|
-
style: _objectSpread({
|
|
197
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
198
|
-
top: 0,
|
|
199
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
200
|
-
left: 0,
|
|
201
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
202
|
-
position: 'absolute',
|
|
203
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
204
|
-
transform: transform,
|
|
205
|
-
maxHeight: maxHeight ? maxHeight : 'auto'
|
|
206
|
-
}, opacity)
|
|
207
|
-
}, this.props.content));
|
|
208
|
-
}
|
|
209
|
-
}]);
|
|
210
|
-
}(Component);
|
|
211
|
-
// working with extract-react-types
|
|
212
|
-
_defineProperty(LegacyLayer, "defaultProps", defaultProps);
|
|
213
19
|
function parseOffset(_ref) {
|
|
214
20
|
var offset = _ref.offset;
|
|
215
21
|
var _offset$split = offset.split(','),
|
|
@@ -294,11 +100,17 @@ function PopperInterop(_ref3) {
|
|
|
294
100
|
}, [children]);
|
|
295
101
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
296
102
|
ref: targetRef
|
|
297
|
-
}, children), content
|
|
103
|
+
}, children), content ?
|
|
104
|
+
/*#__PURE__*/
|
|
105
|
+
// Mount `content` in the same commit as the Layer, before `referenceElement` resolves.
|
|
106
|
+
// Callers act on the content DOM in that commit: DropList focuses it, and menus
|
|
107
|
+
// dispatch `ArrowDown` to focus their first item. The `Manager` stops Popper from
|
|
108
|
+
// using an ancestor `Manager`'s reference until `referenceElement` is set.
|
|
109
|
+
React.createElement(Manager, null, /*#__PURE__*/React.createElement(WrappedPopper, {
|
|
298
110
|
modifiers: modifiers,
|
|
299
111
|
offset: parsedOffset,
|
|
300
112
|
placement: positionPropToPopperPosition(position),
|
|
301
|
-
referenceElement: referenceElement,
|
|
113
|
+
referenceElement: referenceElement !== null && referenceElement !== void 0 ? referenceElement : undefined,
|
|
302
114
|
strategy: strategy
|
|
303
115
|
}, function (_ref4) {
|
|
304
116
|
var ref = _ref4.ref,
|
|
@@ -307,10 +119,10 @@ function PopperInterop(_ref3) {
|
|
|
307
119
|
ref: ref,
|
|
308
120
|
style: style
|
|
309
121
|
}, content);
|
|
310
|
-
}) : /*#__PURE__*/React.createElement("div", null));
|
|
122
|
+
})) : /*#__PURE__*/React.createElement("div", null));
|
|
311
123
|
}
|
|
312
124
|
|
|
313
|
-
/**
|
|
125
|
+
/** Positions `content` next to `children` with the ADS Popper wrapper. */
|
|
314
126
|
export default function Layer(_ref5) {
|
|
315
127
|
var _ref5$children = _ref5.children,
|
|
316
128
|
children = _ref5$children === void 0 ? defaultProps.children : _ref5$children,
|
|
@@ -322,19 +134,11 @@ export default function Layer(_ref5) {
|
|
|
322
134
|
onPositioned = _ref5$onPositioned === void 0 ? defaultProps.onPositioned : _ref5$onPositioned,
|
|
323
135
|
_ref5$position = _ref5.position,
|
|
324
136
|
position = _ref5$position === void 0 ? defaultProps.position : _ref5$position;
|
|
325
|
-
|
|
326
|
-
return /*#__PURE__*/React.createElement(PopperInterop, {
|
|
327
|
-
content: content,
|
|
328
|
-
offset: offset,
|
|
329
|
-
onPositioned: onPositioned,
|
|
330
|
-
position: position,
|
|
331
|
-
strategy: "absolute"
|
|
332
|
-
}, children);
|
|
333
|
-
}
|
|
334
|
-
return /*#__PURE__*/React.createElement(LegacyLayer, {
|
|
137
|
+
return /*#__PURE__*/React.createElement(PopperInterop, {
|
|
335
138
|
content: content,
|
|
336
139
|
offset: offset,
|
|
337
140
|
onPositioned: onPositioned,
|
|
338
|
-
position: position
|
|
141
|
+
position: position,
|
|
142
|
+
strategy: "absolute"
|
|
339
143
|
}, children);
|
|
340
144
|
}
|
|
@@ -4,11 +4,10 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
6
|
// eslint-disable-next-line @atlaskit/design-system/no-third-party-layering -- existing usage from before this rule was added
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
import { bind } from 'bind-event-listener';
|
|
9
9
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
10
|
-
import {
|
|
11
|
-
import { createPopper as createWrappedPopper } from '@atlaskit/popper/unsafe-imperative';
|
|
10
|
+
import { createPopper } from '@atlaskit/popper/unsafe-imperative';
|
|
12
11
|
import { logException } from '../monitoring/error';
|
|
13
12
|
var startingOffset = {
|
|
14
13
|
name: 'offset',
|
|
@@ -48,12 +47,6 @@ var generateTooltipId = function () {
|
|
|
48
47
|
return typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function' ? "".concat(TOOLTIP_ID_PREFIX, "-").concat(crypto.randomUUID()) : "".concat(TOOLTIP_ID_PREFIX, "-").concat(count += 1);
|
|
49
48
|
};
|
|
50
49
|
}();
|
|
51
|
-
function getCreatePopper() {
|
|
52
|
-
if (fg('platform-dst-popper-consolidation')) {
|
|
53
|
-
return createWrappedPopper;
|
|
54
|
-
}
|
|
55
|
-
return createLegacyPopper;
|
|
56
|
-
}
|
|
57
50
|
|
|
58
51
|
/**
|
|
59
52
|
* A tooltip component similar to "@atlaskit/tooltip" but built for vanilla scenarios
|
|
@@ -281,7 +274,7 @@ export var VanillaTooltip = /*#__PURE__*/function () {
|
|
|
281
274
|
}, {
|
|
282
275
|
key: "createPopperInstance",
|
|
283
276
|
value: function createPopperInstance() {
|
|
284
|
-
this.popperInstance =
|
|
277
|
+
this.popperInstance = createPopper(this.trigger, this.tooltip, {
|
|
285
278
|
placement: this.placement,
|
|
286
279
|
modifiers: [startingOffset]
|
|
287
280
|
});
|
|
@@ -370,13 +363,12 @@ export var VanillaTooltip = /*#__PURE__*/function () {
|
|
|
370
363
|
var _this3$popperInstance;
|
|
371
364
|
// Released rather than reconfigured. The instance was previously kept for the
|
|
372
365
|
// trigger's whole lifetime, so every element the pointer passed over retained
|
|
373
|
-
// one — and
|
|
374
|
-
//
|
|
366
|
+
// one — and an instance owns a detached React root, so that was a retained
|
|
367
|
+
// root per hovered trigger.
|
|
375
368
|
//
|
|
376
369
|
// Destroying is also the only way to release that root's capture-phase
|
|
377
|
-
// `scroll`/`resize` listeners
|
|
378
|
-
//
|
|
379
|
-
// does nothing.
|
|
370
|
+
// `scroll`/`resize` listeners, where the `eventListeners: false`
|
|
371
|
+
// reconfiguration in the control arm is accepted but does nothing.
|
|
380
372
|
(_this3$popperInstance = _this3.popperInstance) === null || _this3$popperInstance === void 0 || _this3$popperInstance.destroy();
|
|
381
373
|
_this3.popperInstance = undefined;
|
|
382
374
|
_this3.tooltip.style.opacity = '0';
|
|
@@ -17,7 +17,9 @@ export declare enum AiSuggestionsEntryPointValue {
|
|
|
17
17
|
*/
|
|
18
18
|
SUGGESTIONS_PANEL_MOUNT = "suggestionsPanelMount",
|
|
19
19
|
/** The "Review" button on the follow-up card after the last suggestion is actioned. */
|
|
20
|
-
FOLLOW_UP_CARD = "followUpCard"
|
|
20
|
+
FOLLOW_UP_CARD = "followUpCard",
|
|
21
|
+
/** The call to action on the contextual nudge that points at the Review suggestions button. */
|
|
22
|
+
CONTEXTUAL_NUDGE = "contextualNudge"
|
|
21
23
|
}
|
|
22
24
|
export type AiSuggestionsEntryPoint = `${AiSuggestionsEntryPointValue}`;
|
|
23
25
|
export type AiSuggestionInteractionPoint = 'sidebar' | 'card' | 'statusBar';
|
|
@@ -4,4 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import type { QuickInsertMenuItemProps } from './QuickInsertMenuItem';
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* An Element Browser tile: the item's hover preview card (image, title, full description, and
|
|
9
|
+
* attribution), with its shortcut beside the title. Items without a preview image show their icon,
|
|
10
|
+
* always in a bordered box, above the title instead. The hover card's small title icon
|
|
11
|
+
* (`previewIcon`) is not shown, so a tile never repeats its icon.
|
|
12
|
+
*/
|
|
13
|
+
export declare const ElementBrowserQuickInsertMenuItem: ({ ariaLabel, description, iconBefore, isDisabled, lozenge, onSelect, preview, previewImageUrls, shortcut, titleContent, title, }: QuickInsertMenuItemProps) => React.JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import React, { type ReactNode } from 'react';
|
|
6
|
+
import type { QuickInsertPreview } from './preview';
|
|
7
|
+
/**
|
|
8
|
+
* The image, title, description, and attribution shared by the Quick Insert hover preview and
|
|
9
|
+
* Element Browser tiles. It fills its container; callers own its width and accessible name.
|
|
10
|
+
*/
|
|
11
|
+
export declare const QuickInsertPreviewContent: ({ description, icon, id, isDisabled, lozenge, preview, shortcut, shouldClampText, title, }: {
|
|
12
|
+
description?: string;
|
|
13
|
+
icon?: ReactNode;
|
|
14
|
+
/** Lets the slash-menu row or Element Browser tile point aria-describedby at this content. */
|
|
15
|
+
id?: string;
|
|
16
|
+
isDisabled?: boolean;
|
|
17
|
+
lozenge?: ReactNode;
|
|
18
|
+
preview: QuickInsertPreview;
|
|
19
|
+
/** Shown at the end of the title row, inside this content so it is announced with the description. */
|
|
20
|
+
shortcut?: string;
|
|
21
|
+
shouldClampText?: boolean;
|
|
22
|
+
/** Visual title only: the slash-menu row or Element Browser tile already has it as its accessible name. */
|
|
23
|
+
title: ReactNode;
|
|
24
|
+
}) => React.JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
/**
|
|
7
|
+
* The keyboard or markdown shortcut chip shown beside a Quick Insert item's title, in both the
|
|
8
|
+
* slash-menu row and the Element Browser tile.
|
|
9
|
+
*/
|
|
10
|
+
export declare const QuickInsertShortcut: ({ isDisabled, shortcut, }: {
|
|
11
|
+
isDisabled?: boolean;
|
|
12
|
+
shortcut: string;
|
|
13
|
+
}) => React.JSX.Element;
|
|
@@ -7,19 +7,5 @@ export type Props = {
|
|
|
7
7
|
onPositioned: () => void;
|
|
8
8
|
position: string;
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
cssPosition: string;
|
|
12
|
-
hasExtractedStyles: boolean;
|
|
13
|
-
maxHeight: number | null;
|
|
14
|
-
offsets: {
|
|
15
|
-
popper: {
|
|
16
|
-
left: number;
|
|
17
|
-
top: number;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
originalHeight: number | null;
|
|
21
|
-
position?: string;
|
|
22
|
-
transform?: string;
|
|
23
|
-
};
|
|
24
|
-
/** Selects the reversible Popper v1 or ADS wrapper implementation. */
|
|
10
|
+
/** Positions `content` next to `children` with the ADS Popper wrapper. */
|
|
25
11
|
export default function Layer({ children, content, offset, onPositioned, position, }: Partial<Props>): ReactNode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "134.
|
|
3
|
+
"version": "134.7.2",
|
|
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/"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@atlaskit/editor-toolbar": "^2.8.0",
|
|
51
51
|
"@atlaskit/editor-toolbar-model": "^1.2.0",
|
|
52
52
|
"@atlaskit/editor-ui-control-model": "^3.0.0",
|
|
53
|
-
"@atlaskit/emoji": "^73.
|
|
53
|
+
"@atlaskit/emoji": "^73.4.0",
|
|
54
54
|
"@atlaskit/feature-gate-js-client": "^8.0.0",
|
|
55
55
|
"@atlaskit/icon": "^38.0.0",
|
|
56
56
|
"@atlaskit/link": "^5.1.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"@atlaskit/task-decision": "^21.14.0",
|
|
86
86
|
"@atlaskit/teams-app-config": "^3.1.0",
|
|
87
87
|
"@atlaskit/textfield": "^10.3.0",
|
|
88
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
88
|
+
"@atlaskit/tmp-editor-statsig": "^254.0.0",
|
|
89
89
|
"@atlaskit/tokens": "^20.9.0",
|
|
90
90
|
"@atlaskit/tooltip": "^24.4.0",
|
|
91
91
|
"@atlaskit/width-detector": "^7.2.0",
|
|
@@ -107,7 +107,6 @@
|
|
|
107
107
|
"lodash": "^4.17.21",
|
|
108
108
|
"markdown-it": "^14.1.1",
|
|
109
109
|
"memoize-one": "^6.0.0",
|
|
110
|
-
"popper.js": "^1.14.1",
|
|
111
110
|
"prop-types": "^15.5.10",
|
|
112
111
|
"raf-schd": "^4.0.3",
|
|
113
112
|
"re-resizable": "6.0.0",
|
|
@@ -173,10 +172,6 @@
|
|
|
173
172
|
"platform_editor_hide_configure_lozenge_non_configurable": {
|
|
174
173
|
"type": "boolean"
|
|
175
174
|
},
|
|
176
|
-
"platform-dst-popper-consolidation": {
|
|
177
|
-
"type": "boolean",
|
|
178
|
-
"referenceOnly": true
|
|
179
|
-
},
|
|
180
175
|
"platform-dst-top-layer": {
|
|
181
176
|
"type": "boolean"
|
|
182
177
|
},
|