@monza-editor/preact 0.1.4 → 0.1.6
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.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ interface Props extends Omit<RenderOptions, "highlight"> {
|
|
|
5
5
|
id?: string;
|
|
6
6
|
onHighlight: RenderOptions["highlight"];
|
|
7
7
|
}
|
|
8
|
-
export declare const Editor: ({ id, onHighlight, ...rest }: Props) => JSX.Element;
|
|
8
|
+
export declare const Editor: ({ id, onHighlight, value, ...rest }: Props) => JSX.Element;
|
|
9
9
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r,jsxs as e}from"preact/jsx-runtime";import{initialize as t,styles as c}from"monza-editor";import{useEffect as
|
|
1
|
+
import{jsx as r,jsxs as e}from"preact/jsx-runtime";import{initialize as t,styles as c}from"monza-editor";import{useEffect as n,useRef as l}from"preact/hooks";let a=({id:a,onHighlight:o,value:i,...u})=>{let s=l(null),d=l(null),m=l(null);return n(()=>{s.current&&d.current&&m.current&&t({...u,code:m.current,highlight:o,pre:d.current,textarea:s.current})},[s.current,d.current,m.current]),e("div",{class:`${c.main} ${u.class}`,id:a,children:[r("textarea",{class:c.textarea,ref:s,children:i}),r("pre",{class:c.pre,ref:d,children:r("code",{class:c.code,ref:m})})]})};export{a as Editor};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monza-editor/preact",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Preact component of Monza editor",
|
|
5
5
|
"repository": "https://github.com/raviqqe/monza-editor",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"preact": "^10.27.
|
|
19
|
-
"monza-editor": "0.
|
|
18
|
+
"preact": "^10.27.1",
|
|
19
|
+
"monza-editor": "0.5.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@raviqqe/react-tsconfig": "^2.0.0",
|