@monza-editor/react 0.1.6 → 0.1.8

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