@yuntijs/ui 1.2.0-beta.7 → 1.2.0-beta.8

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.
@@ -41,5 +41,6 @@ export interface MentionsProps extends MentionPickerPluginProps {
41
41
  autoSize?: AutoSize;
42
42
  code?: boolean;
43
43
  getPopContainer?: () => HTMLElement;
44
+ autoFocus?: 'rootStart' | 'rootEnd';
44
45
  }
45
46
  export declare const Mentions: React.ForwardRefExoticComponent<MentionsProps & React.RefAttributes<MentionsEditor>>;
@@ -1,6 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  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; }
3
3
  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; }
4
+ import { AutoFocusPlugin } from '@lexical/react/LexicalAutoFocusPlugin';
4
5
  import { ClearEditorPlugin } from '@lexical/react/LexicalClearEditorPlugin';
5
6
  import { LexicalComposer } from '@lexical/react/LexicalComposer';
6
7
  import { ContentEditable } from '@lexical/react/LexicalContentEditable';
@@ -58,7 +59,8 @@ export var Mentions = /*#__PURE__*/forwardRef(function (_ref, ref) {
58
59
  getPopContainer = _ref.getPopContainer,
59
60
  onPressEnter = _ref.onPressEnter,
60
61
  onKeyDown = _ref.onKeyDown,
61
- onTrigger = _ref.onTrigger;
62
+ onTrigger = _ref.onTrigger,
63
+ autoFocus = _ref.autoFocus;
62
64
  var _ConfigProvider$useCo = ConfigProvider.useConfig(),
63
65
  componentDisabled = _ConfigProvider$useCo.componentDisabled;
64
66
  var _useStyles = useStyles({
@@ -82,7 +84,9 @@ export var Mentions = /*#__PURE__*/forwardRef(function (_ref, ref) {
82
84
  return new CustomTextNode(node.__text);
83
85
  }
84
86
  }, MentionNode],
85
- editorState: textToEditorState(value || defaultValue || '', triggers),
87
+ editorState: textToEditorState(value || defaultValue || '', triggers, {
88
+ punctuation: punctuation
89
+ }),
86
90
  onError: function onError(error) {
87
91
  throw error;
88
92
  }
@@ -177,6 +181,8 @@ export var Mentions = /*#__PURE__*/forwardRef(function (_ref, ref) {
177
181
  onPressEnter: onPressEnter
178
182
  }), onKeyDown && /*#__PURE__*/_jsx(OnKeyDownPlugin, {
179
183
  onKeyDown: onKeyDown
184
+ }), autoFocus && /*#__PURE__*/_jsx(AutoFocusPlugin, {
185
+ defaultSelection: autoFocus
180
186
  })]
181
187
  })
182
188
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuntijs/ui",
3
- "version": "1.2.0-beta.7",
3
+ "version": "1.2.0-beta.8",
4
4
  "description": "☁️ Yunti UI - an open-source UI component library for building Cloud Native web apps",
5
5
  "keywords": [
6
6
  "yuntijs",