Skip to content

Commit 4d0f2d9

Browse files
committed
feat: adapt to React 19
1 parent c137b7b commit 4d0f2d9

4 files changed

Lines changed: 1103 additions & 961 deletions

File tree

lib/ContentEditable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ const ContentEditable: React.FC<ContentEditableProps> = ({
268268
return (
269269
<div
270270
className={containerClassName}
271-
style={{ display: "flex", alignItems: "center" }}
271+
style={{ display: "flex", alignItems: "center", position: "relative" }}
272272
>
273273
<div
274274
ref={divRef}
@@ -280,7 +280,7 @@ const ContentEditable: React.FC<ContentEditableProps> = ({
280280
aria-label={placeholder ?? ""}
281281
className={contentEditableClassName}
282282
style={{
283-
padding: "calc((1.5rem * 1.3125)/2) 0 calc((1.5rem * 1.3125)/2) 1rem",
283+
padding: "0.85rem",
284284
overflow: "auto",
285285
height: "auto",
286286
textAlign: "initial",

package.json

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-basic-contenteditable",
33
"description": "React 18 contenteditable component. Super-customizable!",
4-
"version": "1.0.2",
4+
"version": "1.0.3",
55
"type": "module",
66
"main": "dist/main.js",
77
"types": "dist/main.d.ts",
@@ -40,20 +40,21 @@
4040
"react-dom": "^18.2.0"
4141
},
4242
"devDependencies": {
43-
"@types/node": "^20.11.17",
44-
"@types/react": "^18.2.55",
45-
"@types/react-dom": "^18.2.19",
46-
"@typescript-eslint/eslint-plugin": "^6.21.0",
47-
"@typescript-eslint/parser": "^6.21.0",
48-
"@vitejs/plugin-react-swc": "^3.5.0",
49-
"eslint": "^8.56.0",
50-
"eslint-plugin-react-hooks": "^4.6.0",
51-
"eslint-plugin-react-refresh": "^0.4.5",
52-
"react": "^18.2.0",
53-
"react-dom": "^18.2.0",
54-
"typescript": "^5.2.2",
55-
"vite": "^5.1.0",
56-
"vite-plugin-dts": "^3.7.2"
43+
"@types/node": "^22.10.2",
44+
"@types/react": "^19.0.2",
45+
"@types/react-dom": "^19.0.2",
46+
"@typescript-eslint/eslint-plugin": "^8.18.2",
47+
"@typescript-eslint/parser": "^8.18.2",
48+
"@vitejs/plugin-react-swc": "^3.7.2",
49+
"eslint": "^9.17.0",
50+
"eslint-plugin-react-hooks": "^5.1.0",
51+
"eslint-plugin-react-refresh": "^0.4.16",
52+
"glob": "^11.0.0",
53+
"react": "^19.0.0",
54+
"react-dom": "^19.0.0",
55+
"typescript": "^5.7.2",
56+
"vite": "^6.0.6",
57+
"vite-plugin-dts": "^4.4.0"
5758
},
5859
"bugs": {
5960
"url": "https://github.com/ChrisUser/react-basic-contenteditable/issues"

vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineConfig } from "vite"
22
import { extname, relative, resolve } from "path"
33
import { fileURLToPath } from "node:url"
4-
import glob from "glob"
4+
import { glob } from "glob"
55
import react from "@vitejs/plugin-react-swc"
66
import dts from "vite-plugin-dts"
77

0 commit comments

Comments
 (0)