@revisium/schema-toolkit-ui 0.6.6 → 0.6.7
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/index.cjs +16 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -26
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +26 -26
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +16 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6681,11 +6681,25 @@ const FileRendererComponent = (0, mobx_react_lite.observer)(({ node }) => {
|
|
|
6681
6681
|
});
|
|
6682
6682
|
});
|
|
6683
6683
|
|
|
6684
|
+
//#endregion
|
|
6685
|
+
//#region src/hooks/useAutoResize.ts
|
|
6686
|
+
const MIN_HEIGHT = 120;
|
|
6687
|
+
function useAutoResize(value) {
|
|
6688
|
+
const ref = (0, react.useRef)(null);
|
|
6689
|
+
(0, react.useEffect)(() => {
|
|
6690
|
+
const el = ref.current;
|
|
6691
|
+
if (!el) return;
|
|
6692
|
+
el.style.height = "auto";
|
|
6693
|
+
el.style.height = `${Math.max(el.scrollHeight, MIN_HEIGHT)}px`;
|
|
6694
|
+
}, [value]);
|
|
6695
|
+
return ref;
|
|
6696
|
+
}
|
|
6697
|
+
|
|
6684
6698
|
//#endregion
|
|
6685
6699
|
//#region src/row-editor/ui/editors/MarkdownEditor.tsx
|
|
6686
6700
|
const MarkdownEditor = ({ value, setValue, readonly, dataTestId }) => {
|
|
6687
6701
|
const [internalValue, setInternalValue] = (0, react.useState)(value);
|
|
6688
|
-
const textareaRef = (
|
|
6702
|
+
const textareaRef = useAutoResize(internalValue);
|
|
6689
6703
|
(0, react.useEffect)(() => {
|
|
6690
6704
|
setInternalValue(value);
|
|
6691
6705
|
}, [value]);
|
|
@@ -6710,6 +6724,7 @@ const MarkdownEditor = ({ value, setValue, readonly, dataTestId }) => {
|
|
|
6710
6724
|
lineHeight: "1.5",
|
|
6711
6725
|
minHeight: "120px",
|
|
6712
6726
|
resize: "vertical",
|
|
6727
|
+
overflow: "hidden",
|
|
6713
6728
|
borderColor: "gray.200",
|
|
6714
6729
|
_focus: {
|
|
6715
6730
|
borderColor: "blue.400",
|