Skip to content

Commit

Permalink
Merge branch 'refs/heads/recogito#103-redraw-export' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandr-danylchenko committed Jun 6, 2024
2 parents 205929f + 932f585 commit 0eec7b4
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions packages/text-annotator/src/TextAnnotator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export interface TextAnnotator<E extends unknown = TextAnnotation> extends Annot

setStyle(style: HighlightStyleExpression | undefined): void;

redraw(force?: boolean): void;

// Returns true if successful (or false if the annotation is not currently rendered)
scrollIntoView(annotation: TextAnnotation): boolean;

Expand Down Expand Up @@ -83,12 +85,6 @@ export const createTextAnnotator = <E extends unknown = TextAnnotation>(

const getUser = () => currentUser;

const setFilter = (filter?: Filter) =>
highlightRenderer.setFilter(filter);

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

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

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

const destroy = () => {
highlightRenderer.destroy();
selectionHandler.destroy();
Expand All @@ -125,12 +118,13 @@ export const createTextAnnotator = <E extends unknown = TextAnnotation>(
destroy,
element: container,
getUser,
setFilter,
setStyle,
setFilter: highlightRenderer.setFilter.bind(highlightRenderer),
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 0eec7b4

Please sign in to comment.