mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-31 19:01:54 +02:00
Upgrade next.js to 12 and related packages (#5042)
* Upgrade next.js and source-map-loader * Add changeset * Upgrade eslint and typescript * improve reliability of iframe test * fix lint
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
"lodash": "^4.17.21",
|
||||
"slate": "^0.81.0",
|
||||
"slate-hyperscript": "^0.77.0",
|
||||
"source-map-loader": "^0.2.4"
|
||||
"source-map-loader": "^4.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"slate": ">=0.65.3"
|
||||
|
@@ -19,6 +19,7 @@ export interface HistoryEditor extends BaseEditor {
|
||||
redo: () => void
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export const HistoryEditor = {
|
||||
/**
|
||||
* Check if a value is a `HistoryEditor` object.
|
||||
|
@@ -11,6 +11,7 @@ export interface History {
|
||||
undos: Operation[][]
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export const History = {
|
||||
/**
|
||||
* Check if a value is a `History` object.
|
||||
|
@@ -19,7 +19,7 @@
|
||||
"devDependencies": {
|
||||
"@babel/runtime": "^7.7.4",
|
||||
"slate": "^0.81.0",
|
||||
"source-map-loader": "^0.2.4"
|
||||
"source-map-loader": "^4.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"slate": ">=0.65.3"
|
||||
|
@@ -35,7 +35,7 @@
|
||||
"react-test-renderer": ">=16.8.0",
|
||||
"slate": "^0.81.0",
|
||||
"slate-hyperscript": "^0.77.0",
|
||||
"source-map-loader": "^0.2.4"
|
||||
"source-map-loader": "^4.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=16.8.0",
|
||||
|
@@ -1479,6 +1479,7 @@ const defaultScrollSelectionIntoView = (
|
||||
scrollIntoView(leafEl, {
|
||||
scrollMode: 'if-needed',
|
||||
})
|
||||
// @ts-expect-error an unorthodox delete D:
|
||||
delete leafEl.getBoundingClientRect
|
||||
}
|
||||
}
|
||||
|
@@ -51,6 +51,7 @@ export interface ReactEditor extends BaseEditor {
|
||||
hasRange: (editor: ReactEditor, range: Range) => boolean
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export const ReactEditor = {
|
||||
/**
|
||||
* Check if the user is currently composing inside the editor.
|
||||
|
@@ -22,7 +22,7 @@
|
||||
"@babel/runtime": "^7.7.4",
|
||||
"lodash": "^4.17.21",
|
||||
"slate-hyperscript": "^0.77.0",
|
||||
"source-map-loader": "^0.2.4"
|
||||
"source-map-loader": "^4.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"canvas",
|
||||
|
@@ -326,6 +326,7 @@ export interface EditorInterface {
|
||||
|
||||
const IS_EDITOR_CACHE = new WeakMap<object, boolean>()
|
||||
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export const Editor: EditorInterface = {
|
||||
/**
|
||||
* Get the ancestor above a location in the document.
|
||||
|
@@ -37,6 +37,7 @@ const isElement = (value: any): value is Element => {
|
||||
)
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export const Element: ElementInterface = {
|
||||
/**
|
||||
* Check if a value implements the 'Ancestor' interface.
|
||||
|
@@ -15,6 +15,7 @@ export interface LocationInterface {
|
||||
isLocation: (value: any) => value is Location
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export const Location: LocationInterface = {
|
||||
/**
|
||||
* Check if a value implements the `Location` interface.
|
||||
@@ -36,6 +37,7 @@ export interface SpanInterface {
|
||||
isSpan: (value: any) => value is Span
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export const Span: SpanInterface = {
|
||||
/**
|
||||
* Check if a value implements the `Span` interface.
|
||||
|
@@ -102,6 +102,7 @@ export interface NodeInterface {
|
||||
|
||||
const IS_NODE_LIST_CACHE = new WeakMap<any[], boolean>()
|
||||
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export const Node: NodeInterface = {
|
||||
/**
|
||||
* Get the node at a specific path, asserting that it's an ancestor node.
|
||||
|
@@ -147,6 +147,7 @@ export interface OperationInterface {
|
||||
inverse: (op: Operation) => Operation
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export const Operation: OperationInterface = {
|
||||
/**
|
||||
* Check of a value is a `NodeOperation` object.
|
||||
|
@@ -16,6 +16,7 @@ export interface PathRefInterface {
|
||||
transform: (ref: PathRef, op: Operation) => void
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export const PathRef: PathRefInterface = {
|
||||
/**
|
||||
* Transform the path ref's current value by an operation.
|
||||
|
@@ -53,6 +53,7 @@ export interface PathInterface {
|
||||
) => Path | null
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export const Path: PathInterface = {
|
||||
/**
|
||||
* Get a list of ancestor paths for a given path.
|
||||
|
@@ -17,6 +17,7 @@ export interface PointRefInterface {
|
||||
transform: (ref: PointRef, op: Operation) => void
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export const PointRef: PointRefInterface = {
|
||||
/**
|
||||
* Transform the point ref's current value by an operation.
|
||||
|
@@ -34,6 +34,7 @@ export interface PointInterface {
|
||||
) => Point | null
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export const Point: PointInterface = {
|
||||
/**
|
||||
* Compare a point to another, returning an integer indicating whether the
|
||||
|
@@ -16,6 +16,7 @@ export interface RangeRefInterface {
|
||||
transform: (ref: RangeRef, op: Operation) => void
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export const RangeRef: RangeRefInterface = {
|
||||
/**
|
||||
* Transform the range ref's current value by an operation.
|
||||
|
@@ -44,6 +44,7 @@ export interface RangeInterface {
|
||||
) => Range | null
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export const Range: RangeInterface = {
|
||||
/**
|
||||
* Get the start and end points of a range, in the order in which they appear
|
||||
|
@@ -22,6 +22,7 @@ let _scrubber: Scrubber | undefined = undefined
|
||||
* });
|
||||
*
|
||||
*/
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export const Scrubber: ScrubberInterface = {
|
||||
setScrubber(scrubber: Scrubber | undefined): void {
|
||||
_scrubber = scrubber
|
||||
|
@@ -28,6 +28,7 @@ export interface TextInterface {
|
||||
decorations: (node: Text, decorations: Range[]) => Text[]
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export const Text: TextInterface = {
|
||||
/**
|
||||
* Check if two text nodes are equal.
|
||||
|
@@ -313,6 +313,7 @@ const applyToDraft = (editor: Editor, selection: Selection, op: Operation) => {
|
||||
return selection
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export const GeneralTransforms: GeneralTransforms = {
|
||||
/**
|
||||
* Transform the editor by an operation.
|
||||
|
@@ -127,6 +127,7 @@ export interface NodeTransforms {
|
||||
) => void
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export const NodeTransforms: NodeTransforms = {
|
||||
/**
|
||||
* Insert nodes at a specific location in the Editor.
|
||||
|
@@ -29,6 +29,7 @@ export interface SelectionTransforms {
|
||||
setSelection: (editor: Editor, props: Partial<Range>) => void
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export const SelectionTransforms: SelectionTransforms = {
|
||||
/**
|
||||
* Collapse the selection.
|
||||
|
@@ -46,6 +46,7 @@ export interface TextTransforms {
|
||||
) => void
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-redeclare
|
||||
export const TextTransforms: TextTransforms = {
|
||||
/**
|
||||
* Delete content in the editor.
|
||||
|
Reference in New Issue
Block a user