mtxuilib 0.1.85 → 0.1.87
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/package.json
CHANGED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type React from "react";
|
|
2
|
-
interface RichTextInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "name"> {
|
|
3
|
-
name: string;
|
|
4
|
-
}
|
|
5
|
-
export declare const RichTextInput: (props: RichTextInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import dynamic from "next/dynamic";
|
|
4
|
-
import { useFormContext } from "react-hook-form";
|
|
5
|
-
import { convertEditorJsonToHTML } from "../../mtedtior/utils/utils";
|
|
6
|
-
import { SkeletonInput } from "../skeleton/SkeletonInput";
|
|
7
|
-
const LzMtEditor = dynamic(() => import("../../mtedtior/MtEditor").then((x) => x.MtEditor), {
|
|
8
|
-
ssr: false,
|
|
9
|
-
loading: SkeletonInput,
|
|
10
|
-
});
|
|
11
|
-
export const RichTextInput = (props) => {
|
|
12
|
-
const { name } = props;
|
|
13
|
-
const form = useFormContext();
|
|
14
|
-
return (_jsx(_Fragment, { children: _jsx(LzMtEditor, { content: form.getValues(name), onValueChange: (v) => {
|
|
15
|
-
const html = convertEditorJsonToHTML(v);
|
|
16
|
-
form.setValue("content", html);
|
|
17
|
-
} }) }));
|
|
18
|
-
};
|