Skip to content

Commit 09c72c0

Browse files
committed
dist
1 parent a56adb9 commit 09c72c0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2664
-0
lines changed

dist/Highlight.d.ts

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import SerializedHighlight from './SerializedHighlight';
2+
export interface IHighlightData {
3+
style?: string;
4+
id: string;
5+
content: string;
6+
}
7+
export interface IOptions {
8+
skipIDsBy?: RegExp;
9+
formatMessage: (descriptor: {
10+
id: string;
11+
}, values: {
12+
style: IHighlightData['style'];
13+
}) => string;
14+
tabbable?: boolean;
15+
}
16+
export default class Highlight {
17+
readonly id: string;
18+
readonly content: string;
19+
elements: HTMLElement[];
20+
readonly range: Range;
21+
readonly options: IOptions;
22+
private data;
23+
private _elements;
24+
constructor(range: Range, data: Pick<IHighlightData, Exclude<keyof IHighlightData, 'id'>> & Partial<Pick<IHighlightData, 'id'>>, options: IOptions);
25+
getMessage(id: string): string;
26+
setStyle(style: string): void;
27+
getStyle(): string | undefined;
28+
removeStyle(): void;
29+
isAttached(): boolean;
30+
scrollTo(handler?: (elements: HTMLElement[]) => void): Highlight;
31+
updateStartMarker(el: Element, position: string): void;
32+
/**
33+
* Add class 'focus' to all elements of this highlight.
34+
*/
35+
addFocusedStyles(): Highlight;
36+
/**
37+
* Move focus to the first element of this highlight.
38+
* @return boolean indicating if the action was a success.
39+
*/
40+
focus(): boolean;
41+
intersects(range: Range): boolean;
42+
serialize(referenceElement?: HTMLElement): SerializedHighlight;
43+
private loadStyle;
44+
private checkReferenceElement;
45+
private getValidReferenceElement;
46+
}

dist/Highlight.js

+143
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/Highlight.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/Highlighter.d.ts

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import Highlight, { IHighlightData, IOptions as HighlightOptions } from './Highlight';
2+
import SerializedHighlight from './SerializedHighlight';
3+
export declare const ON_SELECT_DELAY = 300;
4+
interface IOptions {
5+
snapCode?: boolean;
6+
snapTableRows?: boolean;
7+
snapMathJax?: boolean;
8+
snapWords?: boolean;
9+
className?: string;
10+
skipIDsBy?: RegExp;
11+
formatMessage: (descriptor: {
12+
id: string;
13+
}, values: {
14+
style: IHighlightData['style'];
15+
}) => string;
16+
onClick?: (highlight: Highlight | undefined, event: MouseEvent) => void;
17+
onSelect?: (highlights: Highlight[], newHighlight?: Highlight) => void;
18+
onFocusIn?: (highlight: Highlight) => void;
19+
onFocusOut?: (highlight: Highlight) => void;
20+
tabbable?: boolean;
21+
}
22+
export default class Highlighter {
23+
readonly container: HTMLElement;
24+
private highlights;
25+
private options;
26+
private previousRange;
27+
private focusInHandler;
28+
private focusOutHandler;
29+
constructor(container: HTMLElement, options: IOptions);
30+
unmount(): void;
31+
eraseAll: () => void;
32+
teardown: () => void;
33+
erase: (highlight: Highlight) => void;
34+
highlight(highlight?: Highlight | SerializedHighlight): void;
35+
getHighlight(id: string): Highlight | undefined;
36+
getReferenceElement(id: string): HTMLElement | null;
37+
getHighlightFromElement(el: Element): Highlight | null | undefined;
38+
clearFocusedStyles(): void;
39+
getHighlights(): Highlight[];
40+
getHighlightOptions(): HighlightOptions;
41+
getOrderedHighlights(): Highlight[];
42+
getHighlightBefore(target: Highlight): Highlight | undefined;
43+
getHighlightAfter(target: Highlight): Highlight | undefined;
44+
readonly document: Document;
45+
private snapSelection;
46+
private debouncedSnapSelection;
47+
private debouncedOnSelect;
48+
private onSelectionChange;
49+
private onClickHandler;
50+
private onFocusHandler;
51+
private onClick;
52+
private onSelect;
53+
private compareRanges;
54+
}
55+
export {};

0 commit comments

Comments
 (0)