editate 0.6.22 → 0.6.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/doc/node.d.ts +1 -0
- package/lib/editor.d.ts +4 -2
- package/lib/index.cjs +246 -209
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +290 -251
- package/lib/index.js.map +1 -1
- package/lib/plugins/history.d.ts +4 -0
- package/lib/plugins/index.d.ts +1 -1
- package/lib/plugins/transfer/index.d.ts +1 -1
- package/lib/plugins/transfer/internalTransfer.d.ts +1 -1
- package/package.json +2 -2
package/lib/doc/node.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare const getNodeSize: (node: Node) => number;
|
|
|
4
4
|
export declare const getChildAt: <T extends BlockNode>({ children }: T, offset: number, isBackwardAffinity?: boolean) => [node: T["children"][number], offset: number, index: number] | null;
|
|
5
5
|
export declare const getLeafBlockAt: <T extends DocNode | BlockNode>(node: T, offset: number) => [node: InferLeafBlockNode<T>, offset: number, path: Path];
|
|
6
6
|
export declare const getLeafAt: <T extends DocNode | BlockNode>(node: T, offset: number, isBackwardAffinity?: boolean) => [node: InferInlineNode<T>, offset: number, path: Path] | null;
|
|
7
|
+
export declare const getNodeOffset: (root: DocNode | BlockNode, target: Node) => number | null;
|
|
7
8
|
export declare const offsetToPosition: (node: DocNode | BlockNode, offset: number) => DomPosition;
|
|
8
9
|
export declare function iterLeafBlocks<T extends Node>(node: T, range: Range): Generator<[node: InferLeafBlockNode<T>, offset: number], void, void>;
|
|
9
10
|
export declare function iterLeaves<T extends Node>(node: T, range: Range): Generator<[node: InferInlineNode<T>, offset: number], void, void>;
|
package/lib/editor.d.ts
CHANGED
|
@@ -54,9 +54,11 @@ export type KeyboardHook = (keyboard: KeyboardEvent) => boolean | void;
|
|
|
54
54
|
*/
|
|
55
55
|
export type CopyHook = (dataTransfer: DataTransfer) => void;
|
|
56
56
|
/**
|
|
57
|
-
* Functions to handle paste / drop events
|
|
57
|
+
* Functions to handle paste / drop events.
|
|
58
|
+
*
|
|
59
|
+
* Return `true` if you want to stop propagation.
|
|
58
60
|
*/
|
|
59
|
-
export type PasteHook = (dataTransfer: DataTransfer) => string | Fragment | null;
|
|
61
|
+
export type PasteHook = (dataTransfer: DataTransfer) => string | Fragment | true | null;
|
|
60
62
|
type EditorHookMap = {
|
|
61
63
|
/**
|
|
62
64
|
* Call `next(op)` to continue applying the operation, or `next()` with a nullish value to cancel it.
|