@monza-editor/preact 0.1.7 → 0.1.9

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.
@@ -0,0 +1,17 @@
1
+ import { RenderOptions } from "monza-editor";
2
+ import { JSX } from "preact";
3
+
4
+ //#region src/index.d.ts
5
+ interface Props extends Omit<RenderOptions, "highlight"> {
6
+ class?: string;
7
+ id?: string;
8
+ onHighlight: RenderOptions["highlight"];
9
+ }
10
+ declare const Editor: ({
11
+ id,
12
+ onHighlight,
13
+ value,
14
+ ...rest
15
+ }: Props) => JSX.Element;
16
+ //#endregion
17
+ export { Editor };
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ import{initialize as e,styles as t}from"monza-editor";import{useEffect as n,useRef as r}from"preact/hooks";import{jsx as i,jsxs as a}from"preact/jsx-runtime";const o=({id:o,onHighlight:s,value:c,...l})=>{let u=r(null),d=r(null),f=r(null);return n(()=>{u.current&&d.current&&f.current&&e({...l,code:f.current,highlight:s,pre:d.current,textarea:u.current})},[u.current,d.current,f.current]),a(`div`,{class:`${t.main} ${l.class}`,id:o,children:[i(`textarea`,{class:t.textarea,ref:u,children:c}),i(`pre`,{class:t.pre,ref:d,children:i(`code`,{class:t.code,ref:f})})]})};export{o as Editor};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monza-editor/preact",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Preact component of Monza editor",
5
5
  "repository": "https://github.com/raviqqe/monza-editor",
6
6
  "license": "MIT",
@@ -15,20 +15,19 @@
15
15
  }
16
16
  },
17
17
  "dependencies": {
18
- "preact": "^10.27.1",
19
- "monza-editor": "0.5.3"
18
+ "preact": "^10.27.2",
19
+ "monza-editor": "0.5.5"
20
20
  },
21
21
  "devDependencies": {
22
- "@raviqqe/react-tsconfig": "^2.0.0",
23
- "@raviqqe/tsconfig": "^2.0.1",
24
- "@rsbuild/plugin-preact": "^1.5.2",
25
- "@rslib/core": "^0.12.4",
22
+ "@raviqqe/react-tsconfig": "^2.0.1",
23
+ "@raviqqe/tsconfig": "^2.0.3",
26
24
  "@testing-library/preact": "^3.2.4",
25
+ "tsdown": "^0.15.4",
27
26
  "typescript": "^5.9.2",
28
27
  "vitest": "^3.0.2"
29
28
  },
30
29
  "scripts": {
31
- "build": "rslib build",
30
+ "build": "tsdown",
32
31
  "test": "vitest"
33
32
  }
34
33
  }