@bigbinary/neeto-editor 1.47.126 → 1.47.130
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/dist/Editor.js +32 -29
- package/dist/Editor.js.map +1 -1
- package/dist/{chunk-COgPAsPy.js → chunk-BSdgi_3H.js} +20 -5
- package/dist/chunk-BSdgi_3H.js.map +1 -0
- package/dist/cjs/Editor.cjs.js +32 -29
- package/dist/cjs/Editor.cjs.js.map +1 -1
- package/dist/cjs/{chunk-DoYRXWHQ.cjs.js → chunk-DRJy8PFC.cjs.js} +20 -4
- package/dist/cjs/chunk-DRJy8PFC.cjs.js.map +1 -0
- package/dist/cjs/v2/Editor.cjs.js +33 -30
- package/dist/cjs/v2/Editor.cjs.js.map +1 -1
- package/dist/cjs/v2/FormikEditor.cjs.js +1 -1
- package/dist/cjs/v2/Menu.cjs.js +1 -1
- package/dist/cjs/v2/index.cjs.js +1 -1
- package/dist/editor-stats.html +19 -1
- package/dist/v2/Editor.js +33 -30
- package/dist/v2/Editor.js.map +1 -1
- package/dist/v2/FormikEditor.js +1 -1
- package/dist/v2/Menu.js +1 -1
- package/dist/v2/index.js +1 -1
- package/package.json +1 -1
- package/types.d.ts +1 -0
- package/dist/chunk-COgPAsPy.js.map +0 -1
- package/dist/cjs/chunk-DoYRXWHQ.cjs.js.map +0 -1
package/dist/Editor.js
CHANGED
|
@@ -2028,8 +2028,6 @@ var MentionList = /*#__PURE__*/function (_React$Component) {
|
|
|
2028
2028
|
var _this2 = this;
|
|
2029
2029
|
var selectedIndex = this.state.selectedIndex;
|
|
2030
2030
|
var items = this.props.items;
|
|
2031
|
-
var Menu = Dropdown.Menu,
|
|
2032
|
-
MenuItem = Dropdown.MenuItem;
|
|
2033
2031
|
if (isEmpty(items)) {
|
|
2034
2032
|
return /*#__PURE__*/jsx("div", {
|
|
2035
2033
|
className: "neeto-editor-mentions__wrapper",
|
|
@@ -2039,40 +2037,45 @@ var MentionList = /*#__PURE__*/function (_React$Component) {
|
|
|
2039
2037
|
})
|
|
2040
2038
|
});
|
|
2041
2039
|
}
|
|
2040
|
+
|
|
2041
|
+
// Rendered with plain elements instead of neetoUI's Dropdown.Menu. That Menu
|
|
2042
|
+
// auto-focuses its <ul> on mount, which pulls focus out of the editor and
|
|
2043
|
+
// breaks mention typing/arrow navigation (the list is driven entirely by the
|
|
2044
|
+
// editor's keydown). neetoUI's class names are kept so the popup styling is
|
|
2045
|
+
// unchanged.
|
|
2042
2046
|
return /*#__PURE__*/jsx("div", {
|
|
2043
2047
|
className: "neeto-ui-dropdown__popup",
|
|
2044
|
-
children: /*#__PURE__*/jsx(
|
|
2045
|
-
className: "neeto-editor-mentions__wrapper",
|
|
2048
|
+
children: /*#__PURE__*/jsx("ul", {
|
|
2049
|
+
className: "neeto-ui-dropdown__popup-menu neeto-editor-mentions__wrapper",
|
|
2046
2050
|
"data-testid": "neeto-editor-mention-list",
|
|
2047
|
-
ref: this.mentionRef
|
|
2048
|
-
// Keep the list non-focusable so neetoUI's Menu can't auto-focus its
|
|
2049
|
-
// <ul> and steal focus from the editor; mention keystrokes and arrow
|
|
2050
|
-
// keys are handled through the editor's own keydown.
|
|
2051
|
-
,
|
|
2052
|
-
tabIndex: null,
|
|
2051
|
+
ref: this.mentionRef,
|
|
2053
2052
|
children: items.map(function (_ref2, index) {
|
|
2054
2053
|
var key = _ref2.key,
|
|
2055
2054
|
name = _ref2.name,
|
|
2056
2055
|
imageUrl = _ref2.imageUrl;
|
|
2057
|
-
return /*#__PURE__*/
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2056
|
+
return /*#__PURE__*/jsx("li", {
|
|
2057
|
+
className: "neeto-ui-dropdown__popup-menu-item",
|
|
2058
|
+
role: "menuitem",
|
|
2059
|
+
children: /*#__PURE__*/jsxs("button", {
|
|
2060
|
+
"data-testid": "neeto-editor-mention-list-".concat(name),
|
|
2061
|
+
type: "button",
|
|
2062
|
+
className: classnames("neeto-ui-dropdown__popup-menu-item-btn neeto-editor-mentions__item", {
|
|
2063
|
+
active: index === selectedIndex
|
|
2064
|
+
}),
|
|
2065
|
+
onClick: function onClick() {
|
|
2066
|
+
return _this2.selectItem(index);
|
|
2067
|
+
},
|
|
2068
|
+
children: [/*#__PURE__*/jsx(Avatar, {
|
|
2069
|
+
size: "small",
|
|
2070
|
+
user: {
|
|
2071
|
+
name: name,
|
|
2072
|
+
imageUrl: imageUrl
|
|
2073
|
+
}
|
|
2074
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
2075
|
+
style: "body2",
|
|
2076
|
+
children: name
|
|
2077
|
+
})]
|
|
2078
|
+
})
|
|
2076
2079
|
}, key);
|
|
2077
2080
|
})
|
|
2078
2081
|
})
|