UPDATE: Update to React 19.0.0
Diverse fixes
This commit is contained in:
committed by
Nicolás Hatcher Andrés
parent
8a54f45d75
commit
d866e283e9
899
webapp/IronCalc/package-lock.json
generated
899
webapp/IronCalc/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,13 +1,12 @@
|
||||
{
|
||||
"name": "@ironcalc/workbook",
|
||||
"version": "0.3.1",
|
||||
"version": "0.3.2",
|
||||
"type": "module",
|
||||
"main": "./dist/ironcalc.js",
|
||||
"module": "./dist/ironcalc.js",
|
||||
"source": "./src/index.ts",
|
||||
"types": "./dist/index.d.ts",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build && tsc",
|
||||
"check": "biome check ./src",
|
||||
"check-write": "biome check --write ./src",
|
||||
@@ -27,19 +26,19 @@
|
||||
"react-i18next": "^15.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "1.8.3",
|
||||
"@biomejs/biome": "1.9.4",
|
||||
"@chromatic-com/storybook": "^3.2.4",
|
||||
"@storybook/addon-essentials": "^8.6.0-alpha.0",
|
||||
"@storybook/addon-interactions": "^8.6.0-alpha.0",
|
||||
"@storybook/addon-onboarding": "^8.6.0-alpha.0",
|
||||
"@storybook/blocks": "^8.6.0-alpha.0",
|
||||
"@storybook/react": "^8.6.0-alpha.0",
|
||||
"@storybook/react-vite": "^8.6.0-alpha.0",
|
||||
"@storybook/test": "^8.6.0-alpha.0",
|
||||
"@storybook/addon-essentials": "^8.5.3",
|
||||
"@storybook/addon-interactions": "^8.5.3",
|
||||
"@storybook/addon-onboarding": "^8.5.3",
|
||||
"@storybook/blocks": "^8.5.3",
|
||||
"@storybook/react": "^8.5.3",
|
||||
"@storybook/react-vite": "^8.5.3",
|
||||
"@storybook/test": "^8.5.3",
|
||||
"@vitejs/plugin-react": "^4.2.1",
|
||||
"react": "^18.0.0",
|
||||
"react-dom": "^18.0.0",
|
||||
"storybook": "^8.6.0-alpha.0",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"storybook": "^8.5.3",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "~5.6.2",
|
||||
"vite": "^6.0.5",
|
||||
@@ -47,9 +46,9 @@
|
||||
"vitest": "^2.0.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "^18.0.0",
|
||||
"react": "^18.0.0",
|
||||
"react-dom": "^18.0.0"
|
||||
"@types/react": "^18.0.0 || ^19.0.0",
|
||||
"react": "^18.0.0 || ^19.0.0",
|
||||
"react-dom": "^18.0.0 || ^19.0.0"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
|
||||
@@ -26,7 +26,7 @@ function SheetTab(props: SheetTabProps) {
|
||||
const { name, color, selected, workbookState, onSelected } = props;
|
||||
const [anchorEl, setAnchorEl] = useState<null | HTMLButtonElement>(null);
|
||||
const [colorPickerOpen, setColorPickerOpen] = useState(false);
|
||||
const colorButton = useRef(null);
|
||||
const colorButton = useRef<HTMLDivElement>(null);
|
||||
const open = Boolean(anchorEl);
|
||||
const handleOpen = (event: React.MouseEvent<HTMLButtonElement>) => {
|
||||
setAnchorEl(event.currentTarget);
|
||||
@@ -57,12 +57,12 @@ function SheetTab(props: SheetTabProps) {
|
||||
<TabWrapper
|
||||
$color={color}
|
||||
$selected={selected}
|
||||
onClick={(event) => {
|
||||
onClick={(event: React.MouseEvent) => {
|
||||
onSelected();
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
}}
|
||||
onPointerDown={(event) => {
|
||||
onPointerDown={(event: React.PointerEvent) => {
|
||||
// If it is in browse mode stop he event
|
||||
const cell = workbookState.getEditingCell();
|
||||
if (cell && isInReferenceMode(cell.text, cell.cursorStart)) {
|
||||
|
||||
@@ -28,7 +28,7 @@ type BorderPickerProps = {
|
||||
className?: string;
|
||||
onChange: (border: BorderOptions) => void;
|
||||
onClose: () => void;
|
||||
anchorEl: React.RefObject<HTMLElement>;
|
||||
anchorEl: React.RefObject<HTMLElement | null>;
|
||||
anchorOrigin?: PopoverOrigin;
|
||||
transformOrigin?: PopoverOrigin;
|
||||
open: boolean;
|
||||
|
||||
@@ -10,7 +10,7 @@ type ColorPickerProps = {
|
||||
color: string;
|
||||
onChange: (color: string) => void;
|
||||
onClose: () => void;
|
||||
anchorEl: React.RefObject<HTMLElement>;
|
||||
anchorEl: React.RefObject<HTMLElement | null>;
|
||||
anchorOrigin?: PopoverOrigin;
|
||||
transformOrigin?: PopoverOrigin;
|
||||
open: boolean;
|
||||
|
||||
@@ -9,7 +9,7 @@ interface Options {
|
||||
onEditEnd: () => void;
|
||||
onTextUpdated: () => void;
|
||||
workbookState: WorkbookState;
|
||||
textareaRef: RefObject<HTMLTextAreaElement>;
|
||||
textareaRef: RefObject<HTMLTextAreaElement | null>;
|
||||
}
|
||||
|
||||
export const useKeyDown = (
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
type TokenType,
|
||||
getTokens,
|
||||
} from "@ironcalc/wasm";
|
||||
import type { JSX } from "react";
|
||||
import type { ActiveRange } from "../workbookState";
|
||||
|
||||
function sliceString(
|
||||
|
||||
@@ -32,7 +32,7 @@ interface Options {
|
||||
onNextSheet: () => void;
|
||||
onPreviousSheet: () => void;
|
||||
onEscape: () => void;
|
||||
root: RefObject<HTMLDivElement>;
|
||||
root: RefObject<HTMLDivElement | null>;
|
||||
}
|
||||
|
||||
// # IronCalc Keyboard accessibility:
|
||||
|
||||
@@ -11,9 +11,9 @@ import { rangeToStr } from "./util";
|
||||
import type { WorkbookState } from "./workbookState";
|
||||
|
||||
interface PointerSettings {
|
||||
canvasElement: RefObject<HTMLCanvasElement>;
|
||||
canvasElement: RefObject<HTMLCanvasElement | null>;
|
||||
worksheetCanvas: RefObject<WorksheetCanvas | null>;
|
||||
worksheetElement: RefObject<HTMLDivElement>;
|
||||
worksheetElement: RefObject<HTMLDivElement | null>;
|
||||
onCellSelected: (cell: Cell, event: React.MouseEvent) => void;
|
||||
onAreaSelecting: (cell: Cell) => void;
|
||||
onAreaSelected: () => void;
|
||||
|
||||
@@ -29,7 +29,7 @@ import Worksheet from "./worksheet";
|
||||
|
||||
const Workbook = (props: { model: Model; workbookState: WorkbookState }) => {
|
||||
const { model, workbookState } = props;
|
||||
const rootRef = useRef<HTMLDivElement>(null);
|
||||
const rootRef = useRef<HTMLDivElement | null>(null);
|
||||
|
||||
// Calling `setRedrawId((id) => id + 1);` forces a redraw
|
||||
// This is needed because `model` or `workbookState` can change without React being aware of it
|
||||
@@ -350,7 +350,7 @@ const Workbook = (props: { model: Model; workbookState: WorkbookState }) => {
|
||||
ref={rootRef}
|
||||
onKeyDown={onKeyDown}
|
||||
tabIndex={0}
|
||||
onClick={(event) => {
|
||||
onClick={(event: React.MouseEvent) => {
|
||||
if (!workbookState.getEditingCell()) {
|
||||
focusWorkbook();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user