@onesy/ui-react 1.0.13 → 1.0.14

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.
@@ -197,9 +197,8 @@ const SmartTextField = react_1.default.forwardRef((props_, ref) => {
197
197
  init();
198
198
  }, []);
199
199
  react_1.default.useEffect(() => {
200
- if (optionsMention !== optionsMention_)
201
- setOptionsMention(optionsMention_);
202
- }, [optionsMention_]);
200
+ setOptionsMention([...(optionsMention_ || [])]);
201
+ }, [(0, utils_1.hash)(optionsMention_)]);
203
202
  react_1.default.useEffect(() => {
204
203
  const valuePrevious = (refs.root.current.innerHTML || '').replaceAll(' ', ' ');
205
204
  const valueNew = (0, utils_1.textToInnerHTML)(value_);
@@ -472,7 +471,7 @@ const SmartTextField = react_1.default.forwardRef((props_, ref) => {
472
471
  if (mention) {
473
472
  if (refs.openMenu.current && !optionsMention.length)
474
473
  onCloseSearch();
475
- else if (!refs.openMenu.current && refs.search.current && !!optionsMention.length)
474
+ else if (!refs.openMenu.current && !!optionsMention.length)
476
475
  onOpenSearch();
477
476
  }
478
477
  }, [mention, optionsMention]);
@@ -8,7 +8,7 @@ const _excluded = ["version", "size", "valueDefault", "value", "inputProps", "on
8
8
  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; }
9
9
  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; }
10
10
  import React from 'react';
11
- import { innerHTMLToText, is, isEnvironment, parse, stringToColor, textToInnerHTML } from '@onesy/utils';
11
+ import { hash, innerHTMLToText, is, isEnvironment, parse, stringToColor, textToInnerHTML } from '@onesy/utils';
12
12
  import { classNames, style as styleMethod, useOnesyTheme } from '@onesy/style-react';
13
13
  import IconMaterialFormatItalic from '@onesy/icons-material-rounded-react/IconMaterialFormatItalicW100';
14
14
  import IconMaterialFormatUnderlined from '@onesy/icons-material-rounded-react/IconMaterialFormatUnderlinedW100';
@@ -223,8 +223,8 @@ const SmartTextField = /*#__PURE__*/React.forwardRef((props_, ref) => {
223
223
  init();
224
224
  }, []);
225
225
  React.useEffect(() => {
226
- if (optionsMention !== optionsMention_) setOptionsMention(optionsMention_);
227
- }, [optionsMention_]);
226
+ setOptionsMention([...(optionsMention_ || [])]);
227
+ }, [hash(optionsMention_)]);
228
228
  React.useEffect(() => {
229
229
  const valuePrevious = (refs.root.current.innerHTML || '').replaceAll('&nbsp;', ' ');
230
230
  const valueNew = textToInnerHTML(value_);
@@ -491,7 +491,7 @@ const SmartTextField = /*#__PURE__*/React.forwardRef((props_, ref) => {
491
491
  // else if no users response & opened, close the search
492
492
  React.useEffect(() => {
493
493
  if (mention) {
494
- if (refs.openMenu.current && !optionsMention.length) onCloseSearch();else if (!refs.openMenu.current && refs.search.current && !!optionsMention.length) onOpenSearch();
494
+ if (refs.openMenu.current && !optionsMention.length) onCloseSearch();else if (!refs.openMenu.current && !!optionsMention.length) onOpenSearch();
495
495
  }
496
496
  }, [mention, optionsMention]);
497
497
  React.useEffect(() => {
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license UiReact v1.0.13
1
+ /** @license UiReact v1.0.14
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onesy/ui-react",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "UI for React",
5
5
  "repository": "https://github.com/onesy-org/onesy.git",
6
6
  "author": "Lazar <lazareric2@gmail.com>",