@wangeditor-next/yjs-for-react 0.1.2 → 0.1.3

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.
@@ -2,7 +2,7 @@ import { CursorState } from '@wangeditor-next/yjs';
2
2
  import { RefObject } from 'react';
3
3
  import { BaseRange, NodeMatch, Text } from 'slate';
4
4
  import { CaretPosition, SelectionRect } from '../utils/getOverlayPosition';
5
- export declare type UseRemoteCursorOverlayPositionsOptions<T extends HTMLElement> = {
5
+ export type UseRemoteCursorOverlayPositionsOptions<T extends HTMLElement> = {
6
6
  shouldGenerateOverlay?: NodeMatch<Text>;
7
7
  } & ({
8
8
  containerRef?: undefined;
@@ -10,7 +10,7 @@ export declare type UseRemoteCursorOverlayPositionsOptions<T extends HTMLElement
10
10
  containerRef: RefObject<T>;
11
11
  refreshOnResize?: boolean | 'debounced';
12
12
  });
13
- export declare type CursorOverlayData<TCursorData extends Record<string, unknown>> = CursorState<TCursorData> & {
13
+ export type CursorOverlayData<TCursorData extends Record<string, unknown>> = CursorState<TCursorData> & {
14
14
  range: BaseRange | null;
15
15
  caretPosition: CaretPosition | null;
16
16
  selectionRects: SelectionRect[];
@@ -1,4 +1,4 @@
1
1
  import { CursorState } from '@wangeditor-next/yjs';
2
2
  import { Store } from '../types';
3
- export declare type CursorStore<TCursorData extends Record<string, unknown> = Record<string, unknown>> = Store<Record<string, CursorState<TCursorData>>>;
3
+ export type CursorStore<TCursorData extends Record<string, unknown> = Record<string, unknown>> = Store<Record<string, CursorState<TCursorData>>>;
4
4
  export declare function useRemoteCursorStateStore<TCursorData extends Record<string, unknown> = Record<string, unknown>>(): CursorStore<TCursorData>;
@@ -1,3 +1,3 @@
1
1
  import { RefObject } from 'react';
2
- export declare function useRequestRerender(): (immediately?: any) => void;
2
+ export declare function useRequestRerender(): (immediately?: boolean) => void;
3
3
  export declare function useOnResize<T extends HTMLElement>(ref: RefObject<T> | undefined, onResize: () => void): void;
package/dist/types.d.ts CHANGED
@@ -1 +1 @@
1
- export declare type Store<T> = readonly [(onStoreChange: () => void) => () => void, () => T];
1
+ export type Store<T> = readonly [(onStoreChange: () => void) => () => void, () => T];
@@ -1,21 +1,21 @@
1
1
  import { BaseRange, Path, Text } from 'slate';
2
2
  import { IDomEditor } from '@wangeditor-next/editor';
3
- export declare type SelectionRect = {
3
+ export type SelectionRect = {
4
4
  width: number;
5
5
  height: number;
6
6
  top: number;
7
7
  left: number;
8
8
  };
9
- export declare type CaretPosition = {
9
+ export type CaretPosition = {
10
10
  height: number;
11
11
  top: number;
12
12
  left: number;
13
13
  };
14
- export declare type OverlayPosition = {
14
+ export type OverlayPosition = {
15
15
  caretPosition: CaretPosition | null;
16
16
  selectionRects: SelectionRect[];
17
17
  };
18
- export declare type GetSelectionRectsOptions = {
18
+ export type GetSelectionRectsOptions = {
19
19
  xOffset: number;
20
20
  yOffset: number;
21
21
  shouldGenerateOverlay?: (node: Text, path: Path) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wangeditor-next/yjs-for-react",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "React specific components/utils for wangeditor-next-yjs.",
5
5
  "author": "cycleccc <2991205548@qq.com>",
6
6
  "contributors": [],
@@ -45,8 +45,8 @@
45
45
  "size-stats": "cross-env NODE_ENV=production:size_stats rollup -c rollup.config.js"
46
46
  },
47
47
  "devDependencies": {
48
- "@types/react": "^17.0.34",
49
- "@types/use-sync-external-store": "^0.0.3"
48
+ "@types/react": "^18.0.0",
49
+ "@types/use-sync-external-store": "^0.0.6"
50
50
  },
51
51
  "bugs": {
52
52
  "url": "https://github.com/cycleccc/wangEditor/issues"
@@ -57,9 +57,9 @@
57
57
  },
58
58
  "peerDependencies": {
59
59
  "react": ">=16.8.0",
60
- "@wangeditor-next/core": "1.7.4",
60
+ "@wangeditor-next/core": "1.7.5",
61
61
  "@wangeditor-next/editor": "5.5.6",
62
- "@wangeditor-next/yjs": "^0.1.2",
62
+ "@wangeditor-next/yjs": "^0.1.3",
63
63
  "slate": "^0.72.0",
64
64
  "yjs": "^13.5.29"
65
65
  }