box-annotations 4.1.1-beta.5 → 5.1.0
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/dist/annotations.css +1 -1
- package/dist/annotations.js +2 -1
- package/dist/annotations.js.LICENSE.txt +89 -0
- package/package.json +47 -42
- package/src/@types/global.ts +1 -4
- package/src/common/BaseAnnotator.scss +1 -14
- package/src/common/BaseManager.ts +10 -6
- package/src/common/DeselectManager.tsx +6 -3
- package/src/common/useAutoScroll/useAutoScroll.tsx +1 -1
- package/src/components/Popups/Popper.ts +18 -0
- package/src/components/Popups/PopupBase.tsx +1 -1
- package/src/components/Popups/PopupCursor.tsx +3 -10
- package/src/components/Popups/PopupHighlight.tsx +2 -9
- package/src/components/Popups/PopupHighlightError.tsx +2 -9
- package/src/components/Popups/PopupReply.tsx +7 -10
- package/src/components/ReplyForm/ReplyButton.tsx +1 -1
- package/src/components/ReplyForm/ReplyForm.tsx +8 -1
- package/src/drawing/DrawingAnnotations.tsx +1 -1
- package/src/drawing/DrawingCreator.tsx +1 -1
- package/src/drawing/DrawingManager.tsx +6 -2
- package/src/drawing/actions.ts +0 -2
- package/src/drawing/drawingUtil.ts +0 -1
- package/src/highlight/HighlightManager.tsx +6 -2
- package/src/highlight/actions.ts +0 -1
- package/src/popup/PopupLayer.tsx +2 -2
- package/src/popup/PopupManager.tsx +6 -2
- package/src/region/RegionCreationManager.tsx +6 -2
- package/src/region/RegionManager.tsx +6 -2
- package/src/region/actions.ts +0 -1
- package/src/store/highlight/actions.ts +1 -1
- package/src/store/users/actions.ts +3 -3
- package/src/common/usePrevious.ts +0 -13
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import * as ReactDOM from 'react-dom';
|
|
2
|
+
import * as ReactDOM from 'react-dom/client';
|
|
3
3
|
import BaseManager, { Props } from '../common/BaseManager';
|
|
4
4
|
import PopupContainer from './PopupContainer';
|
|
5
5
|
|
|
@@ -10,6 +10,10 @@ export default class PopupManager extends BaseManager {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
render(props: Props): void {
|
|
13
|
-
|
|
13
|
+
if (!this.root) {
|
|
14
|
+
this.root = ReactDOM.createRoot(this.reactEl);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
this.root.render(<PopupContainer location={this.location} {...props} />);
|
|
14
18
|
}
|
|
15
19
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import * as ReactDOM from 'react-dom';
|
|
2
|
+
import * as ReactDOM from 'react-dom/client';
|
|
3
3
|
import BaseManager, { Props } from '../common/BaseManager';
|
|
4
4
|
import RegionCreationContainer from './RegionCreationContainer';
|
|
5
5
|
|
|
@@ -10,6 +10,10 @@ export default class RegionManager extends BaseManager {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
render(props: Props): void {
|
|
13
|
-
|
|
13
|
+
if (!this.root) {
|
|
14
|
+
this.root = ReactDOM.createRoot(this.reactEl);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
this.root.render(<RegionCreationContainer location={this.location} {...props} />);
|
|
14
18
|
}
|
|
15
19
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import * as ReactDOM from 'react-dom';
|
|
2
|
+
import * as ReactDOM from 'react-dom/client';
|
|
3
3
|
import BaseManager, { Props } from '../common/BaseManager';
|
|
4
4
|
import RegionAnnotationsContainer from './RegionAnnotationsContainer';
|
|
5
5
|
|
|
@@ -10,6 +10,10 @@ export default class RegionListManager extends BaseManager {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
render(props: Props): void {
|
|
13
|
-
|
|
13
|
+
if (!this.root) {
|
|
14
|
+
this.root = ReactDOM.createRoot(this.reactEl);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
this.root.render(<RegionAnnotationsContainer location={this.location} {...props} />);
|
|
14
18
|
}
|
|
15
19
|
}
|
package/src/region/actions.ts
CHANGED
|
@@ -20,9 +20,9 @@ export const fetchCollaboratorsAction = createAsyncThunk<APICollection<Collabora
|
|
|
20
20
|
// Wrap the client request in a promise to allow it to be returned and cancelled
|
|
21
21
|
return new Promise<APICollection<Collaborator>>((resolve, reject) => {
|
|
22
22
|
client.getFileCollaborators(fileId, resolve, reject, {
|
|
23
|
-
filter_term: searchString,
|
|
24
|
-
include_groups: false,
|
|
25
|
-
include_uploader_collabs: false,
|
|
23
|
+
filter_term: searchString,
|
|
24
|
+
include_groups: false,
|
|
25
|
+
include_uploader_collabs: false,
|
|
26
26
|
});
|
|
27
27
|
});
|
|
28
28
|
},
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
// Returns the last provided value, then caches the new value via an effect
|
|
4
|
-
export default function usePrevious<T>(value: T): T | undefined {
|
|
5
|
-
const ref = React.useRef<T>();
|
|
6
|
-
|
|
7
|
-
// The useEffect callback is only invoked after the parent component has rendered
|
|
8
|
-
React.useEffect(() => {
|
|
9
|
-
ref.current = value;
|
|
10
|
-
}, [value]);
|
|
11
|
-
|
|
12
|
-
return ref.current;
|
|
13
|
-
}
|