@mdxeditor/editor 0.15.0 → 0.15.2
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/MDXEditor.js +1 -1
- package/dist/gurx/react.js +11 -4
- package/package.json +1 -1
package/dist/MDXEditor.js
CHANGED
|
@@ -39,7 +39,7 @@ const RichTextEditor = () => {
|
|
|
39
39
|
RichTextPlugin,
|
|
40
40
|
{
|
|
41
41
|
contentEditable: /* @__PURE__ */ React__default.createElement(ContentEditable, { className: classNames(styles.contentEditable, contentEditableClassName) }),
|
|
42
|
-
placeholder: /* @__PURE__ */ React__default.createElement("div", { className: classNames(styles.contentEditable, styles.placeholder) }, /* @__PURE__ */ React__default.createElement("p", null, placeholder)),
|
|
42
|
+
placeholder: /* @__PURE__ */ React__default.createElement("div", { className: classNames(styles.contentEditable, styles.placeholder, contentEditableClassName) }, /* @__PURE__ */ React__default.createElement("p", null, placeholder)),
|
|
43
43
|
ErrorBoundary: LexicalErrorBoundary
|
|
44
44
|
}
|
|
45
45
|
))), composerChildren.map((Child, index) => /* @__PURE__ */ React__default.createElement(Child, { key: index })));
|
package/dist/gurx/react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React__default from "react";
|
|
1
|
+
import React__default, { useEffect } from "react";
|
|
2
2
|
import { tap, always } from "../utils/fp.js";
|
|
3
3
|
import { realmFactory } from "./realmFactory.js";
|
|
4
4
|
function omit(keys, obj) {
|
|
@@ -98,14 +98,21 @@ function sysHooks() {
|
|
|
98
98
|
const useEmitterValues = (...keys) => {
|
|
99
99
|
const realm = React__default.useContext(Context);
|
|
100
100
|
const [values, setValues] = React__default.useState(() => realm.getKeyValues(keys));
|
|
101
|
-
|
|
101
|
+
useEffect(
|
|
102
102
|
() => realm == null ? void 0 : realm.subKeys(keys, (newValues) => {
|
|
103
103
|
const setter = () => {
|
|
104
|
-
|
|
104
|
+
if (keys.length === 1) {
|
|
105
|
+
newValues = [newValues];
|
|
106
|
+
}
|
|
107
|
+
for (let i = 0; i < keys.length; i++) {
|
|
108
|
+
if (newValues[i] !== values[i]) {
|
|
109
|
+
setValues(newValues);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
105
112
|
};
|
|
106
113
|
setter();
|
|
107
114
|
}),
|
|
108
|
-
[keys]
|
|
115
|
+
[keys, realm, values]
|
|
109
116
|
);
|
|
110
117
|
return values;
|
|
111
118
|
};
|