@atlaskit/editor-common 120.11.0 → 120.11.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 +21 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/vanilla-tooltip/index.js +96 -25
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/vanilla-tooltip/index.js +96 -27
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/vanilla-tooltip/index.js +96 -25
- package/dist/types/vanilla-tooltip/index.d.ts +9 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 120.11.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`3ae04490ac0f4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3ae04490ac0f4) -
|
|
8
|
+
Render the disabled mention chip tooltip without React. Behind the
|
|
9
|
+
`platform_editor_use_vanilla_components` experiment, with no visual change.
|
|
10
|
+
- Disabled mention chips no longer mount a React tooltip, its portal, and the DOM-to-React event
|
|
11
|
+
bridge that fed it.
|
|
12
|
+
- Tooltips release their positioning instance when they close, rather than keeping one alive per
|
|
13
|
+
hovered chip.
|
|
14
|
+
- Tooltips remove their own element and attributes when destroyed, so mention and emoji chips no
|
|
15
|
+
longer leave orphaned popovers behind.
|
|
16
|
+
- Re-hovering a tooltip while it is closing keeps it open, matching `@atlaskit/tooltip`.
|
|
17
|
+
Previously the pending hide still landed and the tooltip disappeared under the pointer.
|
|
18
|
+
- Tooltips close when they hide, instead of waiting on a transition that nothing declares.
|
|
19
|
+
Required by the change above: releasing the positioning instance while the popover was still
|
|
20
|
+
open left it behind as an invisible hit target over the content.
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 120.11.0
|
|
4
25
|
|
|
5
26
|
### Minor Changes
|
|
@@ -28,7 +28,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
28
28
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
29
29
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
30
30
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
31
|
-
var packageVersion = "120.
|
|
31
|
+
var packageVersion = "120.11.0";
|
|
32
32
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
33
33
|
// Remove URL as it has UGC
|
|
34
34
|
// 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 = "120.
|
|
27
|
+
var packageVersion = "120.11.0";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -164,14 +164,37 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
|
|
|
164
164
|
}));
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
// Hide the tooltip if the hide transition has completed
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
167
|
+
// Hide the tooltip if the hide transition has completed.
|
|
168
|
+
//
|
|
169
|
+
// Only reachable in the control arm: no consumer declares a transition on the tooltip, so
|
|
170
|
+
// this never fires today, and the experiment closes the popover in `hide()` regardless.
|
|
171
|
+
if (!(0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_use_vanilla_components')) {
|
|
172
|
+
this.tooltip.ontransitionend = function () {
|
|
173
|
+
if (_this.shouldHidePopover) {
|
|
174
|
+
_this.tooltip.hidePopover();
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
}
|
|
173
178
|
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Closes the popover, tolerating it already being closed.
|
|
182
|
+
*
|
|
183
|
+
* `hidePopover()` throws `InvalidStateError` when the popover is not showing, and that is a
|
|
184
|
+
* routine state rather than an exceptional one: showing any other `hint` or `auto` popover
|
|
185
|
+
* light-dismisses this one without notifying us, so the caller cannot know whether it is
|
|
186
|
+
* still open.
|
|
187
|
+
*/
|
|
174
188
|
return (0, _createClass2.default)(VanillaTooltip, [{
|
|
189
|
+
key: "closePopover",
|
|
190
|
+
value: function closePopover() {
|
|
191
|
+
try {
|
|
192
|
+
this.tooltip.hidePopover();
|
|
193
|
+
} catch (_error) {
|
|
194
|
+
// Already closed — nothing to do.
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}, {
|
|
175
198
|
key: "createPopperInstance",
|
|
176
199
|
value: function createPopperInstance() {
|
|
177
200
|
this.popperInstance = getCreatePopper()(this.trigger, this.tooltip, {
|
|
@@ -192,6 +215,18 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
|
|
|
192
215
|
this.listeners.forEach(function (listener) {
|
|
193
216
|
listener();
|
|
194
217
|
});
|
|
218
|
+
|
|
219
|
+
// Undoes what the constructor added to the trigger, matching the React `@atlaskit/tooltip`
|
|
220
|
+
// callers are moving off, whose unmount took its DOM with it.
|
|
221
|
+
if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_use_vanilla_components')) {
|
|
222
|
+
this.tooltip.remove();
|
|
223
|
+
if (this.trigger.getAttribute('aria-describedby') === this.tooltip.id) {
|
|
224
|
+
this.trigger.removeAttribute('aria-describedby');
|
|
225
|
+
}
|
|
226
|
+
if (this.trigger.getAttribute('popovertarget') === this.tooltip.id) {
|
|
227
|
+
this.trigger.removeAttribute('popovertarget');
|
|
228
|
+
}
|
|
229
|
+
}
|
|
195
230
|
}
|
|
196
231
|
|
|
197
232
|
/**
|
|
@@ -243,20 +278,48 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
|
|
|
243
278
|
this.shouldHidePopover = true;
|
|
244
279
|
// Disable the event listeners
|
|
245
280
|
this.currentTimeoutId = setTimeout(function () {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
281
|
+
if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_use_vanilla_components')) {
|
|
282
|
+
var _this3$popperInstance;
|
|
283
|
+
// Released rather than reconfigured. The instance was previously kept for the
|
|
284
|
+
// trigger's whole lifetime, so every element the pointer passed over retained
|
|
285
|
+
// one — and under `platform-dst-popper-consolidation` an instance owns a
|
|
286
|
+
// detached React root, so that was a retained root per hovered trigger.
|
|
287
|
+
//
|
|
288
|
+
// Destroying is also the only way to release that root's capture-phase
|
|
289
|
+
// `scroll`/`resize` listeners on the consolidated path, where the
|
|
290
|
+
// `eventListeners: false` reconfiguration in the control arm is accepted but
|
|
291
|
+
// does nothing.
|
|
292
|
+
(_this3$popperInstance = _this3.popperInstance) === null || _this3$popperInstance === void 0 || _this3$popperInstance.destroy();
|
|
293
|
+
_this3.popperInstance = undefined;
|
|
294
|
+
_this3.tooltip.style.opacity = '0';
|
|
295
|
+
_this3.isDisplayed = false;
|
|
296
|
+
|
|
297
|
+
// Closed here rather than from `ontransitionend`. No consumer declares a
|
|
298
|
+
// transition on the tooltip and none sets one inline, so that event never
|
|
299
|
+
// fires and the popover stayed open in the top layer for good: an invisible
|
|
300
|
+
// hit target over the content, and — because `showPopover()` throws
|
|
301
|
+
// `InvalidStateError` on an already-showing popover — an uncaught error out of
|
|
302
|
+
// the next `mouseenter`, after which the tooltip never appeared again.
|
|
303
|
+
_this3.closePopover();
|
|
304
|
+
// Paired with the `visibility` that `show()` sets, so a popover left open by
|
|
305
|
+
// a failed close cannot intercept pointer events over the content.
|
|
306
|
+
_this3.tooltip.style.visibility = 'hidden';
|
|
307
|
+
} else {
|
|
308
|
+
var _this3$popperInstance2;
|
|
309
|
+
(_this3$popperInstance2 = _this3.popperInstance) === null || _this3$popperInstance2 === void 0 || _this3$popperInstance2.setOptions(function (options) {
|
|
310
|
+
return _objectSpread(_objectSpread({}, options), {}, {
|
|
311
|
+
modifiers: [startingOffset, {
|
|
312
|
+
name: 'eventListeners',
|
|
313
|
+
enabled: false
|
|
314
|
+
}]
|
|
315
|
+
});
|
|
253
316
|
});
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
317
|
+
_this3.tooltip.style.opacity = '0';
|
|
318
|
+
_this3.isDisplayed = false;
|
|
319
|
+
// If transition animations are disabled immediately hide the popover
|
|
320
|
+
if (_this3.tooltip.style.transition === 'none') {
|
|
321
|
+
_this3.tooltip.hidePopover();
|
|
322
|
+
}
|
|
260
323
|
}
|
|
261
324
|
}, immediate ? 0 : this.timeout);
|
|
262
325
|
}
|
|
@@ -264,18 +327,26 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
|
|
|
264
327
|
key: "show",
|
|
265
328
|
value: function show() {
|
|
266
329
|
var _this4 = this;
|
|
267
|
-
//
|
|
268
|
-
//
|
|
269
|
-
//
|
|
270
|
-
//
|
|
330
|
+
// Ahead of the `isDisplayed` guard, unlike the equivalent below: `hide()` takes effect
|
|
331
|
+
// synchronously but leaves the tooltip on screen until its timeout, so a pointer
|
|
332
|
+
// returning in that window finds `isDisplayed` still true and returns early. Cancelling
|
|
333
|
+
// first keeps the tooltip up and stops it being left undismissable with a hide pending.
|
|
271
334
|
if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_use_vanilla_components')) {
|
|
272
335
|
this.bindEscapeListener();
|
|
336
|
+
clearTimeout(this.currentTimeoutId);
|
|
337
|
+
this.shouldHidePopover = false;
|
|
273
338
|
}
|
|
274
339
|
if (this.isDisplayed) {
|
|
275
340
|
return;
|
|
276
341
|
}
|
|
277
|
-
|
|
278
|
-
|
|
342
|
+
|
|
343
|
+
// Control only: the experiment cancels above, ahead of the guard. Kept gated rather than
|
|
344
|
+
// left unconditional — despite being a no-op once the block above has run — so that
|
|
345
|
+
// experiment cleanup can delete it outright instead of having to reason about it.
|
|
346
|
+
if (!(0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_use_vanilla_components')) {
|
|
347
|
+
clearTimeout(this.currentTimeoutId);
|
|
348
|
+
this.shouldHidePopover = false;
|
|
349
|
+
}
|
|
279
350
|
|
|
280
351
|
// Make the tooltip visible - but hide until
|
|
281
352
|
this.tooltip.style.visibility = 'hidden';
|
|
@@ -14,7 +14,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
14
14
|
const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
15
15
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
16
16
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
17
|
-
const packageVersion = "120.
|
|
17
|
+
const packageVersion = "120.11.0";
|
|
18
18
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
19
19
|
// Remove URL as it has UGC
|
|
20
20
|
// Ignored via go/ees007
|
|
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
15
15
|
import Layer from '../Layer';
|
|
16
16
|
const packageName = "@atlaskit/editor-common";
|
|
17
|
-
const packageVersion = "120.
|
|
17
|
+
const packageVersion = "120.11.0";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -142,12 +142,33 @@ export class VanillaTooltip {
|
|
|
142
142
|
}));
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
// Hide the tooltip if the hide transition has completed
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
145
|
+
// Hide the tooltip if the hide transition has completed.
|
|
146
|
+
//
|
|
147
|
+
// Only reachable in the control arm: no consumer declares a transition on the tooltip, so
|
|
148
|
+
// this never fires today, and the experiment closes the popover in `hide()` regardless.
|
|
149
|
+
if (!isExperimentEnabled('platform_editor_use_vanilla_components')) {
|
|
150
|
+
this.tooltip.ontransitionend = () => {
|
|
151
|
+
if (this.shouldHidePopover) {
|
|
152
|
+
this.tooltip.hidePopover();
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Closes the popover, tolerating it already being closed.
|
|
160
|
+
*
|
|
161
|
+
* `hidePopover()` throws `InvalidStateError` when the popover is not showing, and that is a
|
|
162
|
+
* routine state rather than an exceptional one: showing any other `hint` or `auto` popover
|
|
163
|
+
* light-dismisses this one without notifying us, so the caller cannot know whether it is
|
|
164
|
+
* still open.
|
|
165
|
+
*/
|
|
166
|
+
closePopover() {
|
|
167
|
+
try {
|
|
168
|
+
this.tooltip.hidePopover();
|
|
169
|
+
} catch (_error) {
|
|
170
|
+
// Already closed — nothing to do.
|
|
171
|
+
}
|
|
151
172
|
}
|
|
152
173
|
createPopperInstance() {
|
|
153
174
|
this.popperInstance = getCreatePopper()(this.trigger, this.tooltip, {
|
|
@@ -166,6 +187,18 @@ export class VanillaTooltip {
|
|
|
166
187
|
this.listeners.forEach(listener => {
|
|
167
188
|
listener();
|
|
168
189
|
});
|
|
190
|
+
|
|
191
|
+
// Undoes what the constructor added to the trigger, matching the React `@atlaskit/tooltip`
|
|
192
|
+
// callers are moving off, whose unmount took its DOM with it.
|
|
193
|
+
if (isExperimentEnabled('platform_editor_use_vanilla_components')) {
|
|
194
|
+
this.tooltip.remove();
|
|
195
|
+
if (this.trigger.getAttribute('aria-describedby') === this.tooltip.id) {
|
|
196
|
+
this.trigger.removeAttribute('aria-describedby');
|
|
197
|
+
}
|
|
198
|
+
if (this.trigger.getAttribute('popovertarget') === this.tooltip.id) {
|
|
199
|
+
this.trigger.removeAttribute('popovertarget');
|
|
200
|
+
}
|
|
201
|
+
}
|
|
169
202
|
}
|
|
170
203
|
|
|
171
204
|
/**
|
|
@@ -208,35 +241,71 @@ export class VanillaTooltip {
|
|
|
208
241
|
this.shouldHidePopover = true;
|
|
209
242
|
// Disable the event listeners
|
|
210
243
|
this.currentTimeoutId = setTimeout(() => {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
this.
|
|
244
|
+
if (isExperimentEnabled('platform_editor_use_vanilla_components')) {
|
|
245
|
+
var _this$popperInstance2;
|
|
246
|
+
// Released rather than reconfigured. The instance was previously kept for the
|
|
247
|
+
// trigger's whole lifetime, so every element the pointer passed over retained
|
|
248
|
+
// one — and under `platform-dst-popper-consolidation` an instance owns a
|
|
249
|
+
// detached React root, so that was a retained root per hovered trigger.
|
|
250
|
+
//
|
|
251
|
+
// Destroying is also the only way to release that root's capture-phase
|
|
252
|
+
// `scroll`/`resize` listeners on the consolidated path, where the
|
|
253
|
+
// `eventListeners: false` reconfiguration in the control arm is accepted but
|
|
254
|
+
// does nothing.
|
|
255
|
+
(_this$popperInstance2 = this.popperInstance) === null || _this$popperInstance2 === void 0 ? void 0 : _this$popperInstance2.destroy();
|
|
256
|
+
this.popperInstance = undefined;
|
|
257
|
+
this.tooltip.style.opacity = '0';
|
|
258
|
+
this.isDisplayed = false;
|
|
259
|
+
|
|
260
|
+
// Closed here rather than from `ontransitionend`. No consumer declares a
|
|
261
|
+
// transition on the tooltip and none sets one inline, so that event never
|
|
262
|
+
// fires and the popover stayed open in the top layer for good: an invisible
|
|
263
|
+
// hit target over the content, and — because `showPopover()` throws
|
|
264
|
+
// `InvalidStateError` on an already-showing popover — an uncaught error out of
|
|
265
|
+
// the next `mouseenter`, after which the tooltip never appeared again.
|
|
266
|
+
this.closePopover();
|
|
267
|
+
// Paired with the `visibility` that `show()` sets, so a popover left open by
|
|
268
|
+
// a failed close cannot intercept pointer events over the content.
|
|
269
|
+
this.tooltip.style.visibility = 'hidden';
|
|
270
|
+
} else {
|
|
271
|
+
var _this$popperInstance3;
|
|
272
|
+
(_this$popperInstance3 = this.popperInstance) === null || _this$popperInstance3 === void 0 ? void 0 : _this$popperInstance3.setOptions(options => ({
|
|
273
|
+
...options,
|
|
274
|
+
modifiers: [startingOffset, {
|
|
275
|
+
name: 'eventListeners',
|
|
276
|
+
enabled: false
|
|
277
|
+
}]
|
|
278
|
+
}));
|
|
279
|
+
this.tooltip.style.opacity = '0';
|
|
280
|
+
this.isDisplayed = false;
|
|
281
|
+
// If transition animations are disabled immediately hide the popover
|
|
282
|
+
if (this.tooltip.style.transition === 'none') {
|
|
283
|
+
this.tooltip.hidePopover();
|
|
284
|
+
}
|
|
224
285
|
}
|
|
225
286
|
}, immediate ? 0 : this.timeout);
|
|
226
287
|
}
|
|
227
288
|
show() {
|
|
228
|
-
//
|
|
229
|
-
//
|
|
230
|
-
//
|
|
231
|
-
//
|
|
289
|
+
// Ahead of the `isDisplayed` guard, unlike the equivalent below: `hide()` takes effect
|
|
290
|
+
// synchronously but leaves the tooltip on screen until its timeout, so a pointer
|
|
291
|
+
// returning in that window finds `isDisplayed` still true and returns early. Cancelling
|
|
292
|
+
// first keeps the tooltip up and stops it being left undismissable with a hide pending.
|
|
232
293
|
if (isExperimentEnabled('platform_editor_use_vanilla_components')) {
|
|
233
294
|
this.bindEscapeListener();
|
|
295
|
+
clearTimeout(this.currentTimeoutId);
|
|
296
|
+
this.shouldHidePopover = false;
|
|
234
297
|
}
|
|
235
298
|
if (this.isDisplayed) {
|
|
236
299
|
return;
|
|
237
300
|
}
|
|
238
|
-
|
|
239
|
-
|
|
301
|
+
|
|
302
|
+
// Control only: the experiment cancels above, ahead of the guard. Kept gated rather than
|
|
303
|
+
// left unconditional — despite being a no-op once the block above has run — so that
|
|
304
|
+
// experiment cleanup can delete it outright instead of having to reason about it.
|
|
305
|
+
if (!isExperimentEnabled('platform_editor_use_vanilla_components')) {
|
|
306
|
+
clearTimeout(this.currentTimeoutId);
|
|
307
|
+
this.shouldHidePopover = false;
|
|
308
|
+
}
|
|
240
309
|
|
|
241
310
|
// Make the tooltip visible - but hide until
|
|
242
311
|
this.tooltip.style.visibility = 'hidden';
|
|
@@ -251,10 +320,10 @@ export class VanillaTooltip {
|
|
|
251
320
|
|
|
252
321
|
// Enable the event listeners
|
|
253
322
|
this.currentTimeoutId = setTimeout(() => {
|
|
254
|
-
var _this$
|
|
323
|
+
var _this$popperInstance4, _this$onShow;
|
|
255
324
|
this.tooltip.style.opacity = '1';
|
|
256
325
|
this.tooltip.style.visibility = 'visible';
|
|
257
|
-
(_this$
|
|
326
|
+
(_this$popperInstance4 = this.popperInstance) === null || _this$popperInstance4 === void 0 ? void 0 : _this$popperInstance4.setOptions(options => ({
|
|
258
327
|
...options,
|
|
259
328
|
modifiers: [endingOffset, {
|
|
260
329
|
name: 'eventListeners',
|
|
@@ -20,7 +20,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
20
20
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
21
21
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
22
22
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
23
|
-
var packageVersion = "120.
|
|
23
|
+
var packageVersion = "120.11.0";
|
|
24
24
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
25
25
|
// Remove URL as it has UGC
|
|
26
26
|
// Ignored via go/ees007
|
|
@@ -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 = "120.
|
|
24
|
+
var packageVersion = "120.11.0";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -157,14 +157,37 @@ export var VanillaTooltip = /*#__PURE__*/function () {
|
|
|
157
157
|
}));
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
// Hide the tooltip if the hide transition has completed
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
160
|
+
// Hide the tooltip if the hide transition has completed.
|
|
161
|
+
//
|
|
162
|
+
// Only reachable in the control arm: no consumer declares a transition on the tooltip, so
|
|
163
|
+
// this never fires today, and the experiment closes the popover in `hide()` regardless.
|
|
164
|
+
if (!isExperimentEnabled('platform_editor_use_vanilla_components')) {
|
|
165
|
+
this.tooltip.ontransitionend = function () {
|
|
166
|
+
if (_this.shouldHidePopover) {
|
|
167
|
+
_this.tooltip.hidePopover();
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
}
|
|
166
171
|
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Closes the popover, tolerating it already being closed.
|
|
175
|
+
*
|
|
176
|
+
* `hidePopover()` throws `InvalidStateError` when the popover is not showing, and that is a
|
|
177
|
+
* routine state rather than an exceptional one: showing any other `hint` or `auto` popover
|
|
178
|
+
* light-dismisses this one without notifying us, so the caller cannot know whether it is
|
|
179
|
+
* still open.
|
|
180
|
+
*/
|
|
167
181
|
return _createClass(VanillaTooltip, [{
|
|
182
|
+
key: "closePopover",
|
|
183
|
+
value: function closePopover() {
|
|
184
|
+
try {
|
|
185
|
+
this.tooltip.hidePopover();
|
|
186
|
+
} catch (_error) {
|
|
187
|
+
// Already closed — nothing to do.
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}, {
|
|
168
191
|
key: "createPopperInstance",
|
|
169
192
|
value: function createPopperInstance() {
|
|
170
193
|
this.popperInstance = getCreatePopper()(this.trigger, this.tooltip, {
|
|
@@ -185,6 +208,18 @@ export var VanillaTooltip = /*#__PURE__*/function () {
|
|
|
185
208
|
this.listeners.forEach(function (listener) {
|
|
186
209
|
listener();
|
|
187
210
|
});
|
|
211
|
+
|
|
212
|
+
// Undoes what the constructor added to the trigger, matching the React `@atlaskit/tooltip`
|
|
213
|
+
// callers are moving off, whose unmount took its DOM with it.
|
|
214
|
+
if (isExperimentEnabled('platform_editor_use_vanilla_components')) {
|
|
215
|
+
this.tooltip.remove();
|
|
216
|
+
if (this.trigger.getAttribute('aria-describedby') === this.tooltip.id) {
|
|
217
|
+
this.trigger.removeAttribute('aria-describedby');
|
|
218
|
+
}
|
|
219
|
+
if (this.trigger.getAttribute('popovertarget') === this.tooltip.id) {
|
|
220
|
+
this.trigger.removeAttribute('popovertarget');
|
|
221
|
+
}
|
|
222
|
+
}
|
|
188
223
|
}
|
|
189
224
|
|
|
190
225
|
/**
|
|
@@ -236,20 +271,48 @@ export var VanillaTooltip = /*#__PURE__*/function () {
|
|
|
236
271
|
this.shouldHidePopover = true;
|
|
237
272
|
// Disable the event listeners
|
|
238
273
|
this.currentTimeoutId = setTimeout(function () {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
274
|
+
if (isExperimentEnabled('platform_editor_use_vanilla_components')) {
|
|
275
|
+
var _this3$popperInstance;
|
|
276
|
+
// Released rather than reconfigured. The instance was previously kept for the
|
|
277
|
+
// trigger's whole lifetime, so every element the pointer passed over retained
|
|
278
|
+
// one — and under `platform-dst-popper-consolidation` an instance owns a
|
|
279
|
+
// detached React root, so that was a retained root per hovered trigger.
|
|
280
|
+
//
|
|
281
|
+
// Destroying is also the only way to release that root's capture-phase
|
|
282
|
+
// `scroll`/`resize` listeners on the consolidated path, where the
|
|
283
|
+
// `eventListeners: false` reconfiguration in the control arm is accepted but
|
|
284
|
+
// does nothing.
|
|
285
|
+
(_this3$popperInstance = _this3.popperInstance) === null || _this3$popperInstance === void 0 || _this3$popperInstance.destroy();
|
|
286
|
+
_this3.popperInstance = undefined;
|
|
287
|
+
_this3.tooltip.style.opacity = '0';
|
|
288
|
+
_this3.isDisplayed = false;
|
|
289
|
+
|
|
290
|
+
// Closed here rather than from `ontransitionend`. No consumer declares a
|
|
291
|
+
// transition on the tooltip and none sets one inline, so that event never
|
|
292
|
+
// fires and the popover stayed open in the top layer for good: an invisible
|
|
293
|
+
// hit target over the content, and — because `showPopover()` throws
|
|
294
|
+
// `InvalidStateError` on an already-showing popover — an uncaught error out of
|
|
295
|
+
// the next `mouseenter`, after which the tooltip never appeared again.
|
|
296
|
+
_this3.closePopover();
|
|
297
|
+
// Paired with the `visibility` that `show()` sets, so a popover left open by
|
|
298
|
+
// a failed close cannot intercept pointer events over the content.
|
|
299
|
+
_this3.tooltip.style.visibility = 'hidden';
|
|
300
|
+
} else {
|
|
301
|
+
var _this3$popperInstance2;
|
|
302
|
+
(_this3$popperInstance2 = _this3.popperInstance) === null || _this3$popperInstance2 === void 0 || _this3$popperInstance2.setOptions(function (options) {
|
|
303
|
+
return _objectSpread(_objectSpread({}, options), {}, {
|
|
304
|
+
modifiers: [startingOffset, {
|
|
305
|
+
name: 'eventListeners',
|
|
306
|
+
enabled: false
|
|
307
|
+
}]
|
|
308
|
+
});
|
|
246
309
|
});
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
310
|
+
_this3.tooltip.style.opacity = '0';
|
|
311
|
+
_this3.isDisplayed = false;
|
|
312
|
+
// If transition animations are disabled immediately hide the popover
|
|
313
|
+
if (_this3.tooltip.style.transition === 'none') {
|
|
314
|
+
_this3.tooltip.hidePopover();
|
|
315
|
+
}
|
|
253
316
|
}
|
|
254
317
|
}, immediate ? 0 : this.timeout);
|
|
255
318
|
}
|
|
@@ -257,18 +320,26 @@ export var VanillaTooltip = /*#__PURE__*/function () {
|
|
|
257
320
|
key: "show",
|
|
258
321
|
value: function show() {
|
|
259
322
|
var _this4 = this;
|
|
260
|
-
//
|
|
261
|
-
//
|
|
262
|
-
//
|
|
263
|
-
//
|
|
323
|
+
// Ahead of the `isDisplayed` guard, unlike the equivalent below: `hide()` takes effect
|
|
324
|
+
// synchronously but leaves the tooltip on screen until its timeout, so a pointer
|
|
325
|
+
// returning in that window finds `isDisplayed` still true and returns early. Cancelling
|
|
326
|
+
// first keeps the tooltip up and stops it being left undismissable with a hide pending.
|
|
264
327
|
if (isExperimentEnabled('platform_editor_use_vanilla_components')) {
|
|
265
328
|
this.bindEscapeListener();
|
|
329
|
+
clearTimeout(this.currentTimeoutId);
|
|
330
|
+
this.shouldHidePopover = false;
|
|
266
331
|
}
|
|
267
332
|
if (this.isDisplayed) {
|
|
268
333
|
return;
|
|
269
334
|
}
|
|
270
|
-
|
|
271
|
-
|
|
335
|
+
|
|
336
|
+
// Control only: the experiment cancels above, ahead of the guard. Kept gated rather than
|
|
337
|
+
// left unconditional — despite being a no-op once the block above has run — so that
|
|
338
|
+
// experiment cleanup can delete it outright instead of having to reason about it.
|
|
339
|
+
if (!isExperimentEnabled('platform_editor_use_vanilla_components')) {
|
|
340
|
+
clearTimeout(this.currentTimeoutId);
|
|
341
|
+
this.shouldHidePopover = false;
|
|
342
|
+
}
|
|
272
343
|
|
|
273
344
|
// Make the tooltip visible - but hide until
|
|
274
345
|
this.tooltip.style.visibility = 'hidden';
|
|
@@ -76,6 +76,15 @@ export declare class VanillaTooltip {
|
|
|
76
76
|
* the `onShow` semantics of "@atlaskit/tooltip".
|
|
77
77
|
*/
|
|
78
78
|
onShow?: (() => void) | undefined);
|
|
79
|
+
/**
|
|
80
|
+
* Closes the popover, tolerating it already being closed.
|
|
81
|
+
*
|
|
82
|
+
* `hidePopover()` throws `InvalidStateError` when the popover is not showing, and that is a
|
|
83
|
+
* routine state rather than an exceptional one: showing any other `hint` or `auto` popover
|
|
84
|
+
* light-dismisses this one without notifying us, so the caller cannot know whether it is
|
|
85
|
+
* still open.
|
|
86
|
+
*/
|
|
87
|
+
private closePopover;
|
|
79
88
|
private createPopperInstance;
|
|
80
89
|
destroy(): void;
|
|
81
90
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "120.11.
|
|
3
|
+
"version": "120.11.1",
|
|
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/"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@atlaskit/feature-gate-js-client": "^6.0.0",
|
|
55
55
|
"@atlaskit/icon": "^37.6.0",
|
|
56
56
|
"@atlaskit/link": "^5.1.0",
|
|
57
|
-
"@atlaskit/link-datasource": "^6.
|
|
57
|
+
"@atlaskit/link-datasource": "^6.10.0",
|
|
58
58
|
"@atlaskit/link-picker": "^6.6.0",
|
|
59
59
|
"@atlaskit/media-card": "^81.9.0",
|
|
60
60
|
"@atlaskit/media-client": "^37.6.0",
|