[lexical-react] replace abstract component (#6752)

This commit is contained in:
Sherry
2024-10-26 00:47:28 +08:00
committed by GitHub
parent 409c65e56e
commit e96ee55b74
5 changed files with 21 additions and 20 deletions

View File

@ -17,6 +17,7 @@ untyped-type-import=error
[options]
server.max_workers=4
exact_by_default=true
component_syntax=true
;; [generated-start update-flowconfig]
module.name_mapper='^lexical$' -> '<PROJECT_ROOT>/packages/lexical/flow/Lexical.js.flow'
@ -105,4 +106,4 @@ nonstrict-import
unclear-type
[version]
^0.226.0
^0.250.0

View File

@ -644,6 +644,7 @@ declare module 'yjs' {
};
declare type StackItem = {
// $FlowFixMe: perhaps add generic typing instead of mixed
meta: Map<mixed, mixed>,
type: 'undo' | 'redo',
};

15
package-lock.json generated
View File

@ -65,7 +65,7 @@
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-simple-import-sort": "^12.1.0",
"eslint-plugin-sort-keys-fix": "^1.1.2",
"flow-bin": "^0.226.0",
"flow-bin": "^0.250.0",
"fs-extra": "^10.0.0",
"glob": "^10.4.1",
"google-closure-compiler": "^20220202.0.0",
@ -17265,10 +17265,11 @@
"dev": true
},
"node_modules/flow-bin": {
"version": "0.226.0",
"resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.226.0.tgz",
"integrity": "sha512-q8hXSRhZ+I14jS0KGDDsPYCvPufvBexk6nJXSOsSP6DgCuXbvCOByWhsXRAjPtmXKmO8v9RKSJm1kRaWaf0fZw==",
"version": "0.250.0",
"resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.250.0.tgz",
"integrity": "sha512-OYEPzpgSzvV+33kBuOOA1C0AjQkzIjrmbS/324CRRijnU1tABKyM5unzf4KIkyN5IQutgxqsSRZ1GsixC8+xIQ==",
"dev": true,
"license": "MIT",
"bin": {
"flow": "cli.js"
},
@ -49129,9 +49130,9 @@
"dev": true
},
"flow-bin": {
"version": "0.226.0",
"resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.226.0.tgz",
"integrity": "sha512-q8hXSRhZ+I14jS0KGDDsPYCvPufvBexk6nJXSOsSP6DgCuXbvCOByWhsXRAjPtmXKmO8v9RKSJm1kRaWaf0fZw==",
"version": "0.250.0",
"resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.250.0.tgz",
"integrity": "sha512-OYEPzpgSzvV+33kBuOOA1C0AjQkzIjrmbS/324CRRijnU1tABKyM5unzf4KIkyN5IQutgxqsSRZ1GsixC8+xIQ==",
"dev": true
},
"flow-enums-runtime": {

View File

@ -160,7 +160,7 @@
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-simple-import-sort": "^12.1.0",
"eslint-plugin-sort-keys-fix": "^1.1.2",
"flow-bin": "^0.226.0",
"flow-bin": "^0.250.0",
"fs-extra": "^10.0.0",
"glob": "^10.4.1",
"google-closure-compiler": "^20220202.0.0",

View File

@ -12,11 +12,10 @@ import type { LexicalEditor } from 'lexical';
import type {TRefFor} from 'CoreTypes.flow';
import * as React from 'react';
import type { AbstractComponent } from "react";
type InlineStyle = {
[key: string]: mixed;
}
[key: string]: mixed,
};
// Due to Flow limitations, we prefer fixed types over the built-in inexact HTMLElement
type HTMLDivElementDOMProps = $ReadOnly<{
@ -29,7 +28,7 @@ type HTMLDivElementDOMProps = $ReadOnly<{
'aria-invalid'?: void | boolean,
'aria-owns'?: void | string,
'title'?: void | string,
onClick?: void | (e: SyntheticEvent<HTMLDivElement>) => mixed,
onClick?: void | ((e: SyntheticEvent<HTMLDivElement>) => mixed),
autoCapitalize?: void | boolean,
autoComplete?: void | boolean,
autoCorrect?: void | boolean,
@ -72,11 +71,10 @@ export type Props = $ReadOnly<{
ariaOwns?: string,
ariaRequired?: string,
autoCapitalize?: boolean,
ref?: TRefFor<HTMLDivElement>,
...PlaceholderProps
}>
...PlaceholderProps,
}>;
declare export var ContentEditable: AbstractComponent<
Props,
HTMLDivElement,
>;
declare export var ContentEditable: component(
ref: React.RefSetter<HTMLDivElement>,
...Props
);