Skip to content

Commit

Permalink
Merge branch 'recogito#103-redraw-export' into stagin-candidate-2
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandr-danylchenko committed Oct 9, 2024
2 parents 118776e + 2171b52 commit a659473
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions packages/text-annotator/src/TextAnnotator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export interface TextAnnotator<I extends TextAnnotation = TextAnnotation, E exte

setStyle(style: HighlightStyleExpression | undefined): void;

redraw(force?: boolean): void;

// Returns true if successful (or false if the annotation is not currently rendered)
scrollIntoView(annotationOrId: I | string): boolean;

Expand Down Expand Up @@ -93,9 +95,6 @@ export const createTextAnnotator = <E extends unknown = TextAnnotation>(
selectionHandler.setFilter(filter);
}

const setStyle = (style: HighlightStyleExpression | undefined) =>
highlightRenderer.setStyle(style);

const setUser = (user: User) => {
currentUser = user;
selectionHandler.setUser(user);
Expand All @@ -116,9 +115,6 @@ export const createTextAnnotator = <E extends unknown = TextAnnotation>(
}
}

const setVisible = (visible: boolean) =>
highlightRenderer.setVisible(visible);

const destroy = () => {
highlightRenderer.destroy();
selectionHandler.destroy();
Expand All @@ -133,11 +129,12 @@ export const createTextAnnotator = <E extends unknown = TextAnnotation>(
element: container,
getUser,
setFilter,
setStyle,
setStyle: highlightRenderer.setStyle.bind(highlightRenderer),
redraw: highlightRenderer.redraw.bind(highlightRenderer),
setUser,
setSelected,
setPresenceProvider,
setVisible,
setVisible: highlightRenderer.setVisible.bind(highlightRenderer),
on: lifecycle.on,
off: lifecycle.off,
scrollIntoView: scrollIntoView(container, store),
Expand Down

0 comments on commit a659473

Please sign in to comment.