@bigbinary/neeto-rules-frontend 2.5.15-beta-3 → 2.5.15-beta-4
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.
|
@@ -110,7 +110,7 @@ var useActiveField = function useActiveField(name) {
|
|
|
110
110
|
react.useEffect(function () {
|
|
111
111
|
if (!shouldAutoFocus || activeField) return;
|
|
112
112
|
setFieldActive();
|
|
113
|
-
}, []);
|
|
113
|
+
}, [name]);
|
|
114
114
|
react.useEffect(function () {
|
|
115
115
|
var shouldFocus = shouldFocusRef.current;
|
|
116
116
|
shouldFocusRef.current = true;
|
|
@@ -125,10 +125,12 @@ var useActiveField = function useActiveField(name) {
|
|
|
125
125
|
shouldFocusRef.current = !ref.current;
|
|
126
126
|
if (needsRerender) {
|
|
127
127
|
setPanelState(ramda.assocPath(["data", "activeField"], null));
|
|
128
|
+
requestAnimationFrame(function () {
|
|
129
|
+
return setPanelState(ramda.assocPath(["data", "activeField"], name));
|
|
130
|
+
});
|
|
131
|
+
} else {
|
|
132
|
+
setPanelState(ramda.assocPath(["data", "activeField"], name));
|
|
128
133
|
}
|
|
129
|
-
requestAnimationFrame(function () {
|
|
130
|
-
return setPanelState(ramda.assocPath(["data", "activeField"], name));
|
|
131
|
-
});
|
|
132
134
|
};
|
|
133
135
|
var resetActiveField = function resetActiveField() {
|
|
134
136
|
return setPanelState(ramda.assocPath(["data", "activeField"], null));
|
|
@@ -968,17 +970,17 @@ var EditorAction = function EditorAction(_ref) {
|
|
|
968
970
|
editorRef = _ref$editorRef === void 0 ? null : _ref$editorRef,
|
|
969
971
|
defaults = _ref.defaults,
|
|
970
972
|
otherProps = _objectWithoutProperties(_ref, _excluded$d);
|
|
971
|
-
var
|
|
972
|
-
|
|
973
|
-
editorData =
|
|
974
|
-
setEditorData =
|
|
973
|
+
var _useStateWithDependen = reactUtils.useStateWithDependency(value, [name]),
|
|
974
|
+
_useStateWithDependen2 = _slicedToArray(_useStateWithDependen, 2),
|
|
975
|
+
editorData = _useStateWithDependen2[0],
|
|
976
|
+
setEditorData = _useStateWithDependen2[1];
|
|
975
977
|
var _useFormikContext = formik.useFormikContext(),
|
|
976
978
|
setFieldValue = _useFormikContext.setFieldValue;
|
|
977
979
|
var debouncedValue = reactUtils.useDebounce(editorData, 200);
|
|
978
980
|
react.useEffect(function () {
|
|
979
981
|
setFieldValue(name, editorData);
|
|
980
982
|
}, [debouncedValue]);
|
|
981
|
-
return /*#__PURE__*/
|
|
983
|
+
return /*#__PURE__*/react.createElement(FormikEditor, _objectSpread$n({
|
|
982
984
|
addons: addons,
|
|
983
985
|
autoFocus: autoFocus,
|
|
984
986
|
defaults: defaults,
|
|
@@ -988,6 +990,7 @@ var EditorAction = function EditorAction(_ref) {
|
|
|
988
990
|
hideSlashCommands: true,
|
|
989
991
|
className: "w-full",
|
|
990
992
|
"data-cy": "neeto-editor",
|
|
993
|
+
key: name,
|
|
991
994
|
ref: editorRef,
|
|
992
995
|
onChange: setEditorData
|
|
993
996
|
}, otherProps));
|