@atlaskit/editor-plugin-emoji 17.2.2 → 17.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @atlaskit/editor-plugin-emoji
2
2
 
3
+ ## 17.2.3
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
  ## 17.2.2
4
25
 
5
26
  ### Patch Changes
@@ -22,6 +22,7 @@ var _vanillaTooltip = require("@atlaskit/editor-common/vanilla-tooltip");
22
22
  var _editorPluginConnectivity = require("@atlaskit/editor-plugin-connectivity");
23
23
  var _model = require("@atlaskit/editor-prosemirror/model");
24
24
  var _emojiIdToEmoji = require("@atlaskit/emoji/emoji-id-to-emoji");
25
+ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
25
26
  var _fg = require("@atlaskit/platform-feature-flags/fg");
26
27
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
27
28
  var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
@@ -154,11 +155,16 @@ var EmojiNodeView = exports.EmojiNodeView = /*#__PURE__*/function () {
154
155
  return (0, _createClass2.default)(EmojiNodeView, [{
155
156
  key: "destroyTooltip",
156
157
  value: function destroyTooltip() {
157
- var _this$destroyLazyTool, _this$tooltipInstance, _this$tooltipTarget, _this$tooltipTarget2;
158
+ var _this$destroyLazyTool, _this$tooltipInstance;
158
159
  (_this$destroyLazyTool = this.destroyLazyTooltipListeners) === null || _this$destroyLazyTool === void 0 || _this$destroyLazyTool.call(this);
159
160
  (_this$tooltipInstance = this.tooltipInstance) === null || _this$tooltipInstance === void 0 || _this$tooltipInstance.destroy();
160
- (_this$tooltipTarget = this.tooltipTarget) === null || _this$tooltipTarget === void 0 || _this$tooltipTarget.removeAttribute('popovertarget');
161
- (_this$tooltipTarget2 = this.tooltipTarget) === null || _this$tooltipTarget2 === void 0 || _this$tooltipTarget2.removeAttribute('aria-describedby');
161
+ // with platform_editor_use_vanilla_components the tooltipInstance?.destroy()
162
+ // will remove the popovertarget and aria-describedby attributes from the tooltipTarget
163
+ if (!(0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_use_vanilla_components')) {
164
+ var _this$tooltipTarget, _this$tooltipTarget2;
165
+ (_this$tooltipTarget = this.tooltipTarget) === null || _this$tooltipTarget === void 0 || _this$tooltipTarget.removeAttribute('popovertarget');
166
+ (_this$tooltipTarget2 = this.tooltipTarget) === null || _this$tooltipTarget2 === void 0 || _this$tooltipTarget2.removeAttribute('aria-describedby');
167
+ }
162
168
  this.destroyLazyTooltipListeners = undefined;
163
169
  this.tooltipInstance = undefined;
164
170
  this.tooltipTarget = undefined;
@@ -10,6 +10,7 @@ import { VanillaTooltip } from '@atlaskit/editor-common/vanilla-tooltip';
10
10
  import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
11
11
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
12
12
  import { emojiIdToEmoji } from '@atlaskit/emoji/emoji-id-to-emoji';
13
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
13
14
  import { fg } from '@atlaskit/platform-feature-flags/fg';
14
15
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
15
16
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
@@ -36,11 +37,16 @@ export function isSingleEmoji(fallbackText) {
36
37
  const EMOJI_TOOLTIP_CLASS = 'emoji-tooltip-editor';
37
38
  export class EmojiNodeView {
38
39
  destroyTooltip() {
39
- var _this$destroyLazyTool, _this$tooltipInstance, _this$tooltipTarget, _this$tooltipTarget2;
40
+ var _this$destroyLazyTool, _this$tooltipInstance;
40
41
  (_this$destroyLazyTool = this.destroyLazyTooltipListeners) === null || _this$destroyLazyTool === void 0 ? void 0 : _this$destroyLazyTool.call(this);
41
42
  (_this$tooltipInstance = this.tooltipInstance) === null || _this$tooltipInstance === void 0 ? void 0 : _this$tooltipInstance.destroy();
42
- (_this$tooltipTarget = this.tooltipTarget) === null || _this$tooltipTarget === void 0 ? void 0 : _this$tooltipTarget.removeAttribute('popovertarget');
43
- (_this$tooltipTarget2 = this.tooltipTarget) === null || _this$tooltipTarget2 === void 0 ? void 0 : _this$tooltipTarget2.removeAttribute('aria-describedby');
43
+ // with platform_editor_use_vanilla_components the tooltipInstance?.destroy()
44
+ // will remove the popovertarget and aria-describedby attributes from the tooltipTarget
45
+ if (!isExperimentEnabled('platform_editor_use_vanilla_components')) {
46
+ var _this$tooltipTarget, _this$tooltipTarget2;
47
+ (_this$tooltipTarget = this.tooltipTarget) === null || _this$tooltipTarget === void 0 ? void 0 : _this$tooltipTarget.removeAttribute('popovertarget');
48
+ (_this$tooltipTarget2 = this.tooltipTarget) === null || _this$tooltipTarget2 === void 0 ? void 0 : _this$tooltipTarget2.removeAttribute('aria-describedby');
49
+ }
44
50
  this.destroyLazyTooltipListeners = undefined;
45
51
  this.tooltipInstance = undefined;
46
52
  this.tooltipTarget = undefined;
@@ -14,6 +14,7 @@ import { VanillaTooltip } from '@atlaskit/editor-common/vanilla-tooltip';
14
14
  import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
15
15
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
16
16
  import { emojiIdToEmoji } from '@atlaskit/emoji/emoji-id-to-emoji';
17
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
17
18
  import { fg } from '@atlaskit/platform-feature-flags/fg';
18
19
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
19
20
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
@@ -146,11 +147,16 @@ export var EmojiNodeView = /*#__PURE__*/function () {
146
147
  return _createClass(EmojiNodeView, [{
147
148
  key: "destroyTooltip",
148
149
  value: function destroyTooltip() {
149
- var _this$destroyLazyTool, _this$tooltipInstance, _this$tooltipTarget, _this$tooltipTarget2;
150
+ var _this$destroyLazyTool, _this$tooltipInstance;
150
151
  (_this$destroyLazyTool = this.destroyLazyTooltipListeners) === null || _this$destroyLazyTool === void 0 || _this$destroyLazyTool.call(this);
151
152
  (_this$tooltipInstance = this.tooltipInstance) === null || _this$tooltipInstance === void 0 || _this$tooltipInstance.destroy();
152
- (_this$tooltipTarget = this.tooltipTarget) === null || _this$tooltipTarget === void 0 || _this$tooltipTarget.removeAttribute('popovertarget');
153
- (_this$tooltipTarget2 = this.tooltipTarget) === null || _this$tooltipTarget2 === void 0 || _this$tooltipTarget2.removeAttribute('aria-describedby');
153
+ // with platform_editor_use_vanilla_components the tooltipInstance?.destroy()
154
+ // will remove the popovertarget and aria-describedby attributes from the tooltipTarget
155
+ if (!isExperimentEnabled('platform_editor_use_vanilla_components')) {
156
+ var _this$tooltipTarget, _this$tooltipTarget2;
157
+ (_this$tooltipTarget = this.tooltipTarget) === null || _this$tooltipTarget === void 0 || _this$tooltipTarget.removeAttribute('popovertarget');
158
+ (_this$tooltipTarget2 = this.tooltipTarget) === null || _this$tooltipTarget2 === void 0 || _this$tooltipTarget2.removeAttribute('aria-describedby');
159
+ }
154
160
  this.destroyLazyTooltipListeners = undefined;
155
161
  this.tooltipInstance = undefined;
156
162
  this.tooltipTarget = undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-emoji",
3
- "version": "17.2.2",
3
+ "version": "17.2.3",
4
4
  "description": "Emoji plugin for @atlaskit/editor-core",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"