diff --git a/rollup.config.mjs b/rollup.config.mjs index 9f0645d..ae10f00 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -18,6 +18,7 @@ export default [ format: "esm", }, ], + external: ['react', 'react-dom'], plugins: [ resolve(), commonjs(), @@ -27,6 +28,7 @@ export default [ { input: "dist/index.d.ts", output: [{ file: "dist/index.d.ts", format: "esm" }], + external: ['react', 'react-dom'], plugins: [dts()], }, ]; diff --git a/src/DaftarNaghashi.stories.tsx b/src/DaftarNaghashi.stories.tsx index 4e6fbeb..4f2fe86 100644 --- a/src/DaftarNaghashi.stories.tsx +++ b/src/DaftarNaghashi.stories.tsx @@ -50,7 +50,7 @@ CustomToolbar.args = { }, onStopDrawing: () => console.log("onStopDrawing"), renderToolbar: ({ - setLineWidth, + setThickness, thickness, setColor, color, @@ -130,7 +130,7 @@ CustomToolbar.args = { {thicknesses.map((t) => ( diff --git a/src/DaftarNaghashi.tsx b/src/DaftarNaghashi.tsx index c5ea917..4e182f1 100644 --- a/src/DaftarNaghashi.tsx +++ b/src/DaftarNaghashi.tsx @@ -1,4 +1,4 @@ -import React, { MouseEvent, useEffect, useReducer, useRef } from "react"; +import React, { MouseEvent, useEffect, useReducer, useRef, TouchEvent } from "react"; import { floodFill, getPixelColor, hexToRgba } from "./utils.ts"; import { Mode, ToolbarProps } from "./types.ts"; import drawingReducer from "./reducer.ts"; @@ -16,7 +16,7 @@ type Props = { }; const renderDefaultToolbar = ({ - setLineWidth, + setThickness, thickness, setColor, color, @@ -43,7 +43,7 @@ const renderDefaultToolbar = ({ value={thickness} min="1" max="100" - onChange={(e) => setLineWidth(parseInt(e.target.value, 10))} + onChange={(e) => setThickness(parseInt(e.target.value, 10))} />