@atlaskit/editor-plugin-emoji 3.6.0 → 3.6.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
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-emoji
|
|
2
2
|
|
|
3
|
+
## 3.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#144658](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/144658)
|
|
8
|
+
[`e59e7f0ae0803`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e59e7f0ae0803) -
|
|
9
|
+
Change to use getDomRefFromSelection utility from editor-common
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 3.6.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
|
@@ -8,29 +8,16 @@ exports.InlineEmojiPopup = void 0;
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _reactIntlNext = require("react-intl-next");
|
|
10
10
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
11
|
+
var _getDomRefFromSelection = require("@atlaskit/editor-common/get-dom-ref-from-selection");
|
|
11
12
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
12
13
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
13
14
|
var _uiReact = require("@atlaskit/editor-common/ui-react");
|
|
14
|
-
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
15
15
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
16
16
|
var _emoji = require("@atlaskit/emoji");
|
|
17
17
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
19
19
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
20
|
var PopupWithListeners = (0, _uiReact.withReactEditorViewOuterListeners)(_ui.Popup);
|
|
21
|
-
var getDomRefFromSelection = function getDomRefFromSelection(view) {
|
|
22
|
-
var domRef = (0, _utils.findDomRefAtPos)(view.state.selection.from, view.domAtPos.bind(view));
|
|
23
|
-
if (domRef instanceof HTMLElement) {
|
|
24
|
-
if (domRef.nodeName !== 'P') {
|
|
25
|
-
var paragraphRef = domRef.closest('p');
|
|
26
|
-
if (paragraphRef) {
|
|
27
|
-
return paragraphRef;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return domRef;
|
|
31
|
-
}
|
|
32
|
-
throw new Error('Invalid DOM reference');
|
|
33
|
-
};
|
|
34
21
|
var emojiPopupMessages = {
|
|
35
22
|
emojiPickerAriaLabel: {
|
|
36
23
|
id: 'fabric.emoji.picker.aria.label',
|
|
@@ -39,7 +26,7 @@ var emojiPopupMessages = {
|
|
|
39
26
|
}
|
|
40
27
|
};
|
|
41
28
|
var InlineEmojiPopup = exports.InlineEmojiPopup = function InlineEmojiPopup(_ref) {
|
|
42
|
-
var _useSharedPluginState, _useSharedPluginState2;
|
|
29
|
+
var _useSharedPluginState, _useSharedPluginState2, _api$analytics;
|
|
43
30
|
var api = _ref.api,
|
|
44
31
|
popupsMountPoint = _ref.popupsMountPoint,
|
|
45
32
|
popupsBoundariesElement = _ref.popupsBoundariesElement,
|
|
@@ -79,7 +66,7 @@ var InlineEmojiPopup = exports.InlineEmojiPopup = function InlineEmojiPopup(_ref
|
|
|
79
66
|
if (!isOpen || !emojiProvider) {
|
|
80
67
|
return null;
|
|
81
68
|
}
|
|
82
|
-
var domRef = getDomRefFromSelection(editorView);
|
|
69
|
+
var domRef = (0, _getDomRefFromSelection.getDomRefFromSelection)(editorView, _analytics.ACTION_SUBJECT_ID.PICKER_EMOJI, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
|
|
83
70
|
return /*#__PURE__*/_react.default.createElement(PopupWithListeners, {
|
|
84
71
|
ariaLabel: intl.formatMessage(emojiPopupMessages.emojiPickerAriaLabel),
|
|
85
72
|
offset: [0, 12],
|
|
@@ -1,27 +1,14 @@
|
|
|
1
1
|
import React, { useCallback, useEffect } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl-next';
|
|
3
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { ACTION_SUBJECT_ID, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import { getDomRefFromSelection } from '@atlaskit/editor-common/get-dom-ref-from-selection';
|
|
4
5
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
5
6
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
6
7
|
import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
|
|
7
|
-
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
8
8
|
import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
|
|
9
9
|
import { EmojiPicker } from '@atlaskit/emoji';
|
|
10
10
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
11
|
const PopupWithListeners = withOuterListeners(Popup);
|
|
12
|
-
const getDomRefFromSelection = view => {
|
|
13
|
-
const domRef = findDomRefAtPos(view.state.selection.from, view.domAtPos.bind(view));
|
|
14
|
-
if (domRef instanceof HTMLElement) {
|
|
15
|
-
if (domRef.nodeName !== 'P') {
|
|
16
|
-
const paragraphRef = domRef.closest('p');
|
|
17
|
-
if (paragraphRef) {
|
|
18
|
-
return paragraphRef;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return domRef;
|
|
22
|
-
}
|
|
23
|
-
throw new Error('Invalid DOM reference');
|
|
24
|
-
};
|
|
25
12
|
const emojiPopupMessages = {
|
|
26
13
|
emojiPickerAriaLabel: {
|
|
27
14
|
id: 'fabric.emoji.picker.aria.label',
|
|
@@ -37,7 +24,7 @@ export const InlineEmojiPopup = ({
|
|
|
37
24
|
editorView,
|
|
38
25
|
onClose
|
|
39
26
|
}) => {
|
|
40
|
-
var _useSharedPluginState, _useSharedPluginState2;
|
|
27
|
+
var _useSharedPluginState, _useSharedPluginState2, _api$analytics;
|
|
41
28
|
const {
|
|
42
29
|
emojiProvider,
|
|
43
30
|
inlineEmojiPopupOpen: isOpen
|
|
@@ -70,7 +57,7 @@ export const InlineEmojiPopup = ({
|
|
|
70
57
|
if (!isOpen || !emojiProvider) {
|
|
71
58
|
return null;
|
|
72
59
|
}
|
|
73
|
-
const domRef = getDomRefFromSelection(editorView);
|
|
60
|
+
const domRef = getDomRefFromSelection(editorView, ACTION_SUBJECT_ID.PICKER_EMOJI, api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
|
|
74
61
|
return /*#__PURE__*/React.createElement(PopupWithListeners, {
|
|
75
62
|
ariaLabel: intl.formatMessage(emojiPopupMessages.emojiPickerAriaLabel),
|
|
76
63
|
offset: [0, 12],
|
|
@@ -1,27 +1,14 @@
|
|
|
1
1
|
import React, { useCallback, useEffect } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl-next';
|
|
3
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { ACTION_SUBJECT_ID, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import { getDomRefFromSelection } from '@atlaskit/editor-common/get-dom-ref-from-selection';
|
|
4
5
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
5
6
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
6
7
|
import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
|
|
7
|
-
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
8
8
|
import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
|
|
9
9
|
import { EmojiPicker } from '@atlaskit/emoji';
|
|
10
10
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
11
|
var PopupWithListeners = withOuterListeners(Popup);
|
|
12
|
-
var getDomRefFromSelection = function getDomRefFromSelection(view) {
|
|
13
|
-
var domRef = findDomRefAtPos(view.state.selection.from, view.domAtPos.bind(view));
|
|
14
|
-
if (domRef instanceof HTMLElement) {
|
|
15
|
-
if (domRef.nodeName !== 'P') {
|
|
16
|
-
var paragraphRef = domRef.closest('p');
|
|
17
|
-
if (paragraphRef) {
|
|
18
|
-
return paragraphRef;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return domRef;
|
|
22
|
-
}
|
|
23
|
-
throw new Error('Invalid DOM reference');
|
|
24
|
-
};
|
|
25
12
|
var emojiPopupMessages = {
|
|
26
13
|
emojiPickerAriaLabel: {
|
|
27
14
|
id: 'fabric.emoji.picker.aria.label',
|
|
@@ -30,7 +17,7 @@ var emojiPopupMessages = {
|
|
|
30
17
|
}
|
|
31
18
|
};
|
|
32
19
|
export var InlineEmojiPopup = function InlineEmojiPopup(_ref) {
|
|
33
|
-
var _useSharedPluginState, _useSharedPluginState2;
|
|
20
|
+
var _useSharedPluginState, _useSharedPluginState2, _api$analytics;
|
|
34
21
|
var api = _ref.api,
|
|
35
22
|
popupsMountPoint = _ref.popupsMountPoint,
|
|
36
23
|
popupsBoundariesElement = _ref.popupsBoundariesElement,
|
|
@@ -70,7 +57,7 @@ export var InlineEmojiPopup = function InlineEmojiPopup(_ref) {
|
|
|
70
57
|
if (!isOpen || !emojiProvider) {
|
|
71
58
|
return null;
|
|
72
59
|
}
|
|
73
|
-
var domRef = getDomRefFromSelection(editorView);
|
|
60
|
+
var domRef = getDomRefFromSelection(editorView, ACTION_SUBJECT_ID.PICKER_EMOJI, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
|
|
74
61
|
return /*#__PURE__*/React.createElement(PopupWithListeners, {
|
|
75
62
|
ariaLabel: intl.formatMessage(emojiPopupMessages.emojiPickerAriaLabel),
|
|
76
63
|
offset: [0, 12],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-emoji",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.1",
|
|
4
4
|
"description": "Emoji plugin for @atlaskit/editor-core",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -23,22 +23,22 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
26
|
-
"@atlaskit/editor-common": "^103.
|
|
26
|
+
"@atlaskit/editor-common": "^103.19.0",
|
|
27
27
|
"@atlaskit/editor-plugin-analytics": "^2.2.0",
|
|
28
|
-
"@atlaskit/editor-plugin-annotation": "^2.
|
|
28
|
+
"@atlaskit/editor-plugin-annotation": "^2.7.0",
|
|
29
29
|
"@atlaskit/editor-plugin-base": "^2.3.0",
|
|
30
30
|
"@atlaskit/editor-plugin-editor-viewmode": "^3.1.0",
|
|
31
31
|
"@atlaskit/editor-plugin-metrics": "^3.4.0",
|
|
32
32
|
"@atlaskit/editor-plugin-type-ahead": "^2.5.0",
|
|
33
33
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
34
34
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
35
|
-
"@atlaskit/emoji": "^69.
|
|
35
|
+
"@atlaskit/emoji": "^69.1.0",
|
|
36
36
|
"@atlaskit/icon": "^25.6.0",
|
|
37
37
|
"@atlaskit/node-data-provider": "^4.1.0",
|
|
38
38
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
39
39
|
"@atlaskit/prosemirror-input-rules": "^3.3.0",
|
|
40
40
|
"@atlaskit/theme": "^18.0.0",
|
|
41
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
41
|
+
"@atlaskit/tmp-editor-statsig": "^4.15.0",
|
|
42
42
|
"@atlaskit/tokens": "^4.8.0",
|
|
43
43
|
"@babel/runtime": "^7.0.0",
|
|
44
44
|
"@emotion/react": "^11.7.1",
|
|
@@ -50,12 +50,12 @@
|
|
|
50
50
|
"react-dom": "^18.2.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@af/visual-regression": "
|
|
53
|
+
"@af/visual-regression": "workspace:^",
|
|
54
54
|
"@atlaskit/editor-plugin-composition": "^1.3.0",
|
|
55
55
|
"@atlaskit/editor-plugin-decorations": "^2.0.0",
|
|
56
|
-
"@atlaskit/ssr": "
|
|
56
|
+
"@atlaskit/ssr": "workspace:^",
|
|
57
57
|
"@atlaskit/util-data-test": "^18.0.0",
|
|
58
|
-
"@atlaskit/visual-regression": "
|
|
58
|
+
"@atlaskit/visual-regression": "workspace:^",
|
|
59
59
|
"@testing-library/react": "^13.4.0",
|
|
60
60
|
"typescript": "~5.4.2",
|
|
61
61
|
"wait-for-expect": "^1.2.0"
|