@prose-reader/core
Advanced tools
Comparing version 1.117.0 to 1.118.0
@@ -1,3 +0,3 @@ | ||
import { SpineItem } from '../../spineItem/createSpineItem'; | ||
import { SpineItemLocator } from '../../spineItem/locationResolver'; | ||
import { SpineItem } from '../../spineItem/SpineItem'; | ||
export declare const generateCfiForSpineItemPage: (({ pageIndex, spineItem, spineItemLocator, }: { | ||
@@ -4,0 +4,0 @@ pageIndex: number; |
@@ -1,2 +0,2 @@ | ||
import { SpineItem } from '../../spineItem/createSpineItem'; | ||
import { SpineItem } from '../../spineItem/SpineItem'; | ||
export declare const getItemAnchor: (spineItem: SpineItem) => string; |
@@ -1,2 +0,2 @@ | ||
import { SpineItem } from '../../spineItem/createSpineItem'; | ||
import { SpineItem } from '../../spineItem/SpineItem'; | ||
export declare const getRootCfi: (spineItem: SpineItem) => string; |
@@ -9,242 +9,8 @@ import { SpineItemsManager } from '../../spine/SpineItemsManager'; | ||
spineItemIndex: number; | ||
spineItem: { | ||
layout: ({ blankPagePosition, minimumWidth, spreadPosition, }: { | ||
blankPagePosition: `before` | `after` | `none`; | ||
minimumWidth: number; | ||
spreadPosition: `none` | `left` | `right`; | ||
}) => { | ||
width: number; | ||
height: number; | ||
}; | ||
item: { | ||
id: string; | ||
href: string; | ||
renditionLayout?: `reflowable` | `pre-paginated`; | ||
progressionWeight?: number; | ||
pageSpreadLeft?: true | undefined; | ||
pageSpreadRight?: true | undefined; | ||
mediaType?: string; | ||
}; | ||
overlayElement: HTMLDivElement; | ||
adjustPositionOfElement: ({ right, left, top, }: { | ||
right?: number; | ||
left?: number; | ||
top?: number; | ||
}) => void; | ||
getElementDimensions: () => { | ||
width: number; | ||
height: number; | ||
x: number; | ||
y: number; | ||
bottom: number; | ||
left: number; | ||
right: number; | ||
top: number; | ||
toJSON(): any; | ||
}; | ||
getHtmlFromResource: (response: Response) => Promise<string>; | ||
getResource: () => Promise<Response>; | ||
translateFramePositionIntoPage: (position: { | ||
clientX: number; | ||
clientY: number; | ||
}) => { | ||
clientX: number; | ||
clientY: number; | ||
}; | ||
injectStyle: (cssText: string) => void; | ||
load: () => void; | ||
unload: () => void; | ||
frame: import('../../spineItem/frame/FrameItem').FrameItem; | ||
element: HTMLElement; | ||
getBoundingRectOfElementFromSelector: (selector: string) => DOMRect | undefined; | ||
getViewPortInformation: () => { | ||
computedScale: number; | ||
computedWidthScale: number; | ||
viewportDimensions: { | ||
width: number; | ||
height: number; | ||
}; | ||
} | undefined; | ||
isImageType: () => boolean; | ||
isReady: () => boolean; | ||
destroy: () => void; | ||
readingDirection: "ltr" | "rtl" | undefined; | ||
isUsingVerticalWriting: () => boolean | undefined; | ||
executeOnLayoutBeforeMeasurementHook: (options: { | ||
minimumWidth: number; | ||
}) => void[]; | ||
selectionTracker: { | ||
track: (frameToTrack: HTMLIFrameElement) => void; | ||
destroy: () => void; | ||
isSelecting: () => boolean; | ||
getSelection: () => Selection | undefined; | ||
$: import('rxjs').Observable<{ | ||
event: `selectionchange`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectstart`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectend`; | ||
data: Selection | null; | ||
}>; | ||
}; | ||
fingerTracker: { | ||
track: (frame: HTMLIFrameElement) => void; | ||
getFingerPositionInIframe(): { | ||
x: number | undefined; | ||
y: number | undefined; | ||
} | undefined; | ||
destroy: () => void; | ||
$: import('rxjs').Observable<{ | ||
event: `fingermove`; | ||
data: { | ||
x: number; | ||
y: number; | ||
}; | ||
} | { | ||
event: `fingerout`; | ||
data: undefined; | ||
}>; | ||
}; | ||
getDimensionsForReflowableContent: (isUsingVerticalWriting: boolean, minimumWidth: number) => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
width: number; | ||
}; | ||
getDimensionsForPaginatedContent: () => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
}; | ||
$: { | ||
contentLayout$: import('rxjs').Observable<{ | ||
isFirstLayout: boolean; | ||
isReady: boolean; | ||
}>; | ||
loaded$: import('rxjs').Observable<HTMLIFrameElement>; | ||
isReady$: import('rxjs').Observable<boolean>; | ||
}; | ||
}; | ||
spineItem: import('../../spineItem/SpineItem').SpineItem; | ||
} | { | ||
spineItemIndex: number; | ||
spineItem: { | ||
layout: ({ blankPagePosition, minimumWidth, spreadPosition, }: { | ||
blankPagePosition: `before` | `after` | `none`; | ||
minimumWidth: number; | ||
spreadPosition: `none` | `left` | `right`; | ||
}) => { | ||
width: number; | ||
height: number; | ||
}; | ||
item: { | ||
id: string; | ||
href: string; | ||
renditionLayout?: `reflowable` | `pre-paginated`; | ||
progressionWeight?: number; | ||
pageSpreadLeft?: true | undefined; | ||
pageSpreadRight?: true | undefined; | ||
mediaType?: string; | ||
}; | ||
overlayElement: HTMLDivElement; | ||
adjustPositionOfElement: ({ right, left, top, }: { | ||
right?: number; | ||
left?: number; | ||
top?: number; | ||
}) => void; | ||
getElementDimensions: () => { | ||
width: number; | ||
height: number; | ||
x: number; | ||
y: number; | ||
bottom: number; | ||
left: number; | ||
right: number; | ||
top: number; | ||
toJSON(): any; | ||
}; | ||
getHtmlFromResource: (response: Response) => Promise<string>; | ||
getResource: () => Promise<Response>; | ||
translateFramePositionIntoPage: (position: { | ||
clientX: number; | ||
clientY: number; | ||
}) => { | ||
clientX: number; | ||
clientY: number; | ||
}; | ||
injectStyle: (cssText: string) => void; | ||
load: () => void; | ||
unload: () => void; | ||
frame: import('../../spineItem/frame/FrameItem').FrameItem; | ||
element: HTMLElement; | ||
getBoundingRectOfElementFromSelector: (selector: string) => DOMRect | undefined; | ||
getViewPortInformation: () => { | ||
computedScale: number; | ||
computedWidthScale: number; | ||
viewportDimensions: { | ||
width: number; | ||
height: number; | ||
}; | ||
} | undefined; | ||
isImageType: () => boolean; | ||
isReady: () => boolean; | ||
destroy: () => void; | ||
readingDirection: "ltr" | "rtl" | undefined; | ||
isUsingVerticalWriting: () => boolean | undefined; | ||
executeOnLayoutBeforeMeasurementHook: (options: { | ||
minimumWidth: number; | ||
}) => void[]; | ||
selectionTracker: { | ||
track: (frameToTrack: HTMLIFrameElement) => void; | ||
destroy: () => void; | ||
isSelecting: () => boolean; | ||
getSelection: () => Selection | undefined; | ||
$: import('rxjs').Observable<{ | ||
event: `selectionchange`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectstart`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectend`; | ||
data: Selection | null; | ||
}>; | ||
}; | ||
fingerTracker: { | ||
track: (frame: HTMLIFrameElement) => void; | ||
getFingerPositionInIframe(): { | ||
x: number | undefined; | ||
y: number | undefined; | ||
} | undefined; | ||
destroy: () => void; | ||
$: import('rxjs').Observable<{ | ||
event: `fingermove`; | ||
data: { | ||
x: number; | ||
y: number; | ||
}; | ||
} | { | ||
event: `fingerout`; | ||
data: undefined; | ||
}>; | ||
}; | ||
getDimensionsForReflowableContent: (isUsingVerticalWriting: boolean, minimumWidth: number) => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
width: number; | ||
}; | ||
getDimensionsForPaginatedContent: () => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
}; | ||
$: { | ||
contentLayout$: import('rxjs').Observable<{ | ||
isFirstLayout: boolean; | ||
isReady: boolean; | ||
}>; | ||
loaded$: import('rxjs').Observable<HTMLIFrameElement>; | ||
isReady$: import('rxjs').Observable<boolean>; | ||
}; | ||
}; | ||
spineItem: import('../../spineItem/SpineItem').SpineItem; | ||
node?: undefined; | ||
offset?: undefined; | ||
} | undefined; |
@@ -35,3 +35,3 @@ import { BehaviorSubject, Subject } from 'rxjs'; | ||
get manifest(): Manifest | undefined; | ||
get readingDirection(): "ltr" | "rtl" | undefined; | ||
get readingDirection(): "rtl" | "ltr" | undefined; | ||
getPageSize(): { | ||
@@ -38,0 +38,0 @@ width: number; |
@@ -32,3 +32,3 @@ export declare const createReaderWithEnhancers: (options: Partial<import('./settings/types').CoreInputSettings> & { | ||
pageIndex: number; | ||
spineItem: import('./spineItem/createSpineItem').SpineItem; | ||
spineItem: import('./spineItem/SpineItem').SpineItem; | ||
}) => string; | ||
@@ -39,240 +39,6 @@ resolveCfi: (params: Omit<Parameters<typeof import('./cfi/lookup/resolveCfi').resolveCfi>[0], "spineItemsManager">) => { | ||
spineItemIndex: number; | ||
spineItem: { | ||
layout: ({ blankPagePosition, minimumWidth, spreadPosition, }: { | ||
blankPagePosition: `before` | `after` | `none`; | ||
minimumWidth: number; | ||
spreadPosition: `none` | `left` | `right`; | ||
}) => { | ||
width: number; | ||
height: number; | ||
}; | ||
item: { | ||
id: string; | ||
href: string; | ||
renditionLayout?: `reflowable` | `pre-paginated`; | ||
progressionWeight?: number; | ||
pageSpreadLeft?: true | undefined; | ||
pageSpreadRight?: true | undefined; | ||
mediaType?: string; | ||
}; | ||
overlayElement: HTMLDivElement; | ||
adjustPositionOfElement: ({ right, left, top, }: { | ||
right?: number; | ||
left?: number; | ||
top?: number; | ||
}) => void; | ||
getElementDimensions: () => { | ||
width: number; | ||
height: number; | ||
x: number; | ||
y: number; | ||
bottom: number; | ||
left: number; | ||
right: number; | ||
top: number; | ||
toJSON(): any; | ||
}; | ||
getHtmlFromResource: (response: Response) => Promise<string>; | ||
getResource: () => Promise<Response>; | ||
translateFramePositionIntoPage: (position: { | ||
clientX: number; | ||
clientY: number; | ||
}) => { | ||
clientX: number; | ||
clientY: number; | ||
}; | ||
injectStyle: (cssText: string) => void; | ||
load: () => void; | ||
unload: () => void; | ||
frame: import('./spineItem/frame/FrameItem').FrameItem; | ||
element: HTMLElement; | ||
getBoundingRectOfElementFromSelector: (selector: string) => DOMRect | undefined; | ||
getViewPortInformation: () => { | ||
computedScale: number; | ||
computedWidthScale: number; | ||
viewportDimensions: { | ||
width: number; | ||
height: number; | ||
}; | ||
} | undefined; | ||
isImageType: () => boolean; | ||
isReady: () => boolean; | ||
destroy: () => void; | ||
readingDirection: "ltr" | "rtl" | undefined; | ||
isUsingVerticalWriting: () => boolean | undefined; | ||
executeOnLayoutBeforeMeasurementHook: (options: { | ||
minimumWidth: number; | ||
}) => void[]; | ||
selectionTracker: { | ||
track: (frameToTrack: HTMLIFrameElement) => void; | ||
destroy: () => void; | ||
isSelecting: () => boolean; | ||
getSelection: () => Selection | undefined; | ||
$: import('rxjs').Observable<{ | ||
event: `selectionchange`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectstart`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectend`; | ||
data: Selection | null; | ||
}>; | ||
}; | ||
fingerTracker: { | ||
track: (frame: HTMLIFrameElement) => void; | ||
getFingerPositionInIframe(): { | ||
x: number | undefined; | ||
y: number | undefined; | ||
} | undefined; | ||
destroy: () => void; | ||
$: import('rxjs').Observable<{ | ||
event: `fingermove`; | ||
data: { | ||
x: number; | ||
y: number; | ||
}; | ||
} | { | ||
event: `fingerout`; | ||
data: undefined; | ||
}>; | ||
}; | ||
getDimensionsForReflowableContent: (isUsingVerticalWriting: boolean, minimumWidth: number) => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
width: number; | ||
}; | ||
getDimensionsForPaginatedContent: () => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
}; | ||
$: { | ||
contentLayout$: import('rxjs').Observable<{ | ||
isFirstLayout: boolean; | ||
isReady: boolean; | ||
}>; | ||
loaded$: import('rxjs').Observable<HTMLIFrameElement>; | ||
isReady$: import('rxjs').Observable<boolean>; | ||
}; | ||
}; | ||
spineItem: import('./spineItem/SpineItem').SpineItem; | ||
} | { | ||
spineItemIndex: number; | ||
spineItem: { | ||
layout: ({ blankPagePosition, minimumWidth, spreadPosition, }: { | ||
blankPagePosition: `before` | `after` | `none`; | ||
minimumWidth: number; | ||
spreadPosition: `none` | `left` | `right`; | ||
}) => { | ||
width: number; | ||
height: number; | ||
}; | ||
item: { | ||
id: string; | ||
href: string; | ||
renditionLayout?: `reflowable` | `pre-paginated`; | ||
progressionWeight?: number; | ||
pageSpreadLeft?: true | undefined; | ||
pageSpreadRight?: true | undefined; | ||
mediaType?: string; | ||
}; | ||
overlayElement: HTMLDivElement; | ||
adjustPositionOfElement: ({ right, left, top, }: { | ||
right?: number; | ||
left?: number; | ||
top?: number; | ||
}) => void; | ||
getElementDimensions: () => { | ||
width: number; | ||
height: number; | ||
x: number; | ||
y: number; | ||
bottom: number; | ||
left: number; | ||
right: number; | ||
top: number; | ||
toJSON(): any; | ||
}; | ||
getHtmlFromResource: (response: Response) => Promise<string>; | ||
getResource: () => Promise<Response>; | ||
translateFramePositionIntoPage: (position: { | ||
clientX: number; | ||
clientY: number; | ||
}) => { | ||
clientX: number; | ||
clientY: number; | ||
}; | ||
injectStyle: (cssText: string) => void; | ||
load: () => void; | ||
unload: () => void; | ||
frame: import('./spineItem/frame/FrameItem').FrameItem; | ||
element: HTMLElement; | ||
getBoundingRectOfElementFromSelector: (selector: string) => DOMRect | undefined; | ||
getViewPortInformation: () => { | ||
computedScale: number; | ||
computedWidthScale: number; | ||
viewportDimensions: { | ||
width: number; | ||
height: number; | ||
}; | ||
} | undefined; | ||
isImageType: () => boolean; | ||
isReady: () => boolean; | ||
destroy: () => void; | ||
readingDirection: "ltr" | "rtl" | undefined; | ||
isUsingVerticalWriting: () => boolean | undefined; | ||
executeOnLayoutBeforeMeasurementHook: (options: { | ||
minimumWidth: number; | ||
}) => void[]; | ||
selectionTracker: { | ||
track: (frameToTrack: HTMLIFrameElement) => void; | ||
destroy: () => void; | ||
isSelecting: () => boolean; | ||
getSelection: () => Selection | undefined; | ||
$: import('rxjs').Observable<{ | ||
event: `selectionchange`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectstart`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectend`; | ||
data: Selection | null; | ||
}>; | ||
}; | ||
fingerTracker: { | ||
track: (frame: HTMLIFrameElement) => void; | ||
getFingerPositionInIframe(): { | ||
x: number | undefined; | ||
y: number | undefined; | ||
} | undefined; | ||
destroy: () => void; | ||
$: import('rxjs').Observable<{ | ||
event: `fingermove`; | ||
data: { | ||
x: number; | ||
y: number; | ||
}; | ||
} | { | ||
event: `fingerout`; | ||
data: undefined; | ||
}>; | ||
}; | ||
getDimensionsForReflowableContent: (isUsingVerticalWriting: boolean, minimumWidth: number) => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
width: number; | ||
}; | ||
getDimensionsForPaginatedContent: () => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
}; | ||
$: { | ||
contentLayout$: import('rxjs').Observable<{ | ||
isFirstLayout: boolean; | ||
isReady: boolean; | ||
}>; | ||
loaded$: import('rxjs').Observable<HTMLIFrameElement>; | ||
isReady$: import('rxjs').Observable<boolean>; | ||
}; | ||
}; | ||
spineItem: import('./spineItem/SpineItem').SpineItem; | ||
node?: undefined; | ||
@@ -301,7 +67,7 @@ offset?: undefined; | ||
spineItemPosition: import('./spineItem/types').UnsafeSpineItemPosition; | ||
spineItem: import('./spineItem/createSpineItem').SpineItem; | ||
spineItem: import('./spineItem/SpineItem').SpineItem; | ||
}) => import('./navigation/viewport/ViewportNavigator').ViewportPosition; | ||
getNavigationForCfi: (cfi: string) => import('./navigation/viewport/ViewportNavigator').ViewportPosition | undefined; | ||
getNavigationForLastPage: (spineItem: import('./spineItem/createSpineItem').SpineItem) => import('./navigation/viewport/ViewportNavigator').ViewportPosition; | ||
getNavigationForSpineIndexOrId: (indexOrId: number | string | import('./spineItem/createSpineItem').SpineItem) => import('./navigation/viewport/ViewportNavigator').ViewportPosition; | ||
getNavigationForLastPage: (spineItem: import('./spineItem/SpineItem').SpineItem) => import('./navigation/viewport/ViewportNavigator').ViewportPosition; | ||
getNavigationForSpineIndexOrId: (indexOrId: number | string | import('./spineItem/SpineItem').SpineItem) => import('./navigation/viewport/ViewportNavigator').ViewportPosition; | ||
getNavigationForPosition: (viewportPosition: import('./navigation/viewport/ViewportNavigator').ViewportPosition) => import('./navigation/viewport/ViewportNavigator').ViewportPosition; | ||
@@ -324,5 +90,5 @@ getMostPredominantNavigationForPosition: (viewportPosition: import('./navigation/viewport/ViewportNavigator').ViewportPosition) => import('./navigation/viewport/ViewportNavigator').ViewportPosition; | ||
spineItemNavigator: { | ||
getNavigationForLastPage: (spineItem: import('./spineItem/createSpineItem').SpineItem) => import('./spineItem/types').SafeSpineItemPosition; | ||
getNavigationForPosition: (spineItem: import('./spineItem/createSpineItem').SpineItem, position: import('./spineItem/types').UnsafeSpineItemPosition) => import('./spineItem/types').SafeSpineItemPosition; | ||
getNavigationFromNode: (spineItem: import('./spineItem/createSpineItem').SpineItem, node: Node, offset: number) => import('./spineItem/types').SafeSpineItemPosition; | ||
getNavigationForLastPage: (spineItem: import('./spineItem/SpineItem').SpineItem) => import('./spineItem/types').SafeSpineItemPosition; | ||
getNavigationForPosition: (spineItem: import('./spineItem/SpineItem').SpineItem, position: import('./spineItem/types').UnsafeSpineItemPosition) => import('./spineItem/types').SafeSpineItemPosition; | ||
getNavigationFromNode: (spineItem: import('./spineItem/SpineItem').SpineItem, node: Node, offset: number) => import('./spineItem/types').SafeSpineItemPosition; | ||
}; | ||
@@ -364,7 +130,7 @@ }; | ||
y: number; | ||
}, currentItem: import('./spineItem/createSpineItem').SpineItem) => number; | ||
}, currentItem: import('./spineItem/SpineItem').SpineItem) => number; | ||
getScrollPercentageWithinItem: (context: import('./context/Context').Context, currentPosition: { | ||
x: number; | ||
y: number; | ||
}, currentItem: import('./spineItem/createSpineItem').SpineItem) => number; | ||
}, currentItem: import('./spineItem/SpineItem').SpineItem) => number; | ||
}; | ||
@@ -371,0 +137,0 @@ }, "pagination"> & { |
@@ -0,2 +1,3 @@ | ||
import { Context } from '../../context/Context'; | ||
import { SpineLocator } from '../../spine/locator/SpineLocator'; | ||
export declare const normalizeEventForViewport: <E extends MouseEvent | TouchEvent | PointerEvent>(event: E, iframeOriginalEvent: E, locator: SpineLocator) => E; | ||
export declare const normalizeEventForViewport: <E extends MouseEvent | TouchEvent | PointerEvent>(event: E, iframeOriginalEvent: E, locator: SpineLocator, context: Context) => E; |
@@ -5,3 +5,3 @@ import { Context } from '../../../context/Context'; | ||
import { SpineLocator } from '../../../spine/locator/SpineLocator'; | ||
import { SpineItem } from '../../../spineItem/createSpineItem'; | ||
import { SpineItem } from '../../../spineItem/SpineItem'; | ||
import { SpineItemsManager } from '../../../spine/SpineItemsManager'; | ||
@@ -8,0 +8,0 @@ export declare const getNavigationForLeftOrTopPage: ({ position, spineItem, context, navigationResolver, spineItemsManager, spineLocator, computedPageTurnDirection, }: { |
@@ -5,4 +5,4 @@ import { Context } from '../../../context/Context'; | ||
import { SpineLocator } from '../../../spine/locator/SpineLocator'; | ||
import { SpineItem } from '../../../spineItem/createSpineItem'; | ||
import { SpineItemsManager } from '../../../spine/SpineItemsManager'; | ||
import { SpineItem } from '../../../spineItem/SpineItem'; | ||
export declare const getNavigationForRightOrBottomPage: ({ position, spineItem, context, navigationResolver, spineItemsManager, spineLocator, computedPageTurnDirection, }: { | ||
@@ -9,0 +9,0 @@ position: ViewportPosition; |
@@ -1,3 +0,3 @@ | ||
import { SpineItem } from '../../../spineItem/createSpineItem'; | ||
import { SpineItemLocator } from '../../../spineItem/locationResolver'; | ||
import { SpineItem } from '../../../spineItem/SpineItem'; | ||
import { SafeSpineItemPosition, UnsafeSpineItemPosition } from '../../../spineItem/types'; | ||
@@ -4,0 +4,0 @@ export declare const getSpineItemPositionForLeftPage: ({ position, spineItem, pageHeight, pageWidth, spineItemLocator, }: { |
@@ -1,3 +0,3 @@ | ||
import { SpineItem } from '../../../spineItem/createSpineItem'; | ||
import { SpineItemLocator } from '../../../spineItem/locationResolver'; | ||
import { SpineItem } from '../../../spineItem/SpineItem'; | ||
import { SafeSpineItemPosition, UnsafeSpineItemPosition } from '../../../spineItem/types'; | ||
@@ -4,0 +4,0 @@ export declare const getSpineItemPositionForRightPage: ({ position, spineItem, pageHeight, pageWidth, spineItemLocator, }: { |
import { Context } from '../context/Context'; | ||
import { SpineItem } from '../spineItem/createSpineItem'; | ||
import { Reader } from '../reader'; | ||
import { SpineItem } from '../spineItem/SpineItem'; | ||
export declare const progressionEnhancer: <InheritOptions, InheritOutput extends Reader>(next: (options: InheritOptions) => InheritOutput) => (options: InheritOptions) => InheritOutput & { | ||
@@ -5,0 +5,0 @@ progression: { |
@@ -9,10 +9,27 @@ import { Manifest } from '@prose-reader/shared'; | ||
export type CoreHook = { | ||
name: `item.onLoad`; | ||
name: `item.onDocumentCreated`; | ||
runFn: (params: { | ||
itemId: string; | ||
layers: { | ||
element: HTMLElement; | ||
}[]; | ||
}) => void; | ||
} | { | ||
name: `item.onDocumentLoad`; | ||
runFn: (params: { | ||
destroy$: Observable<void>; | ||
destroy: (fn: UserDestroyFn) => void; | ||
itemId: string; | ||
frame: HTMLIFrameElement; | ||
layers: { | ||
element: HTMLElement; | ||
}[]; | ||
}) => Observable<void> | void; | ||
} | { | ||
name: "item.onBeforeLayout"; | ||
runFn: (params: { | ||
blankPagePosition: "before" | "after" | "none"; | ||
item: Manifest["spineItems"][number]; | ||
minimumWidth: number; | ||
}) => void; | ||
} | { | ||
name: "item.onAfterLayout"; | ||
@@ -30,9 +47,2 @@ runFn: (params: { | ||
} | { | ||
name: "item.onLayoutBeforeMeasurement"; | ||
runFn: (params: { | ||
itemIndex: number; | ||
minimumWidth: number; | ||
isImageType: () => boolean | undefined; | ||
}) => void; | ||
} | { | ||
name: "onViewportOffsetAdjust"; | ||
@@ -39,0 +49,0 @@ runFn: (params: void) => void; |
import { createSelection } from './selection'; | ||
import { createReaderWithEnhancers as createReader } from './createReaderWithEnhancer'; | ||
export type { Manifest } from '@prose-reader/shared'; | ||
export { DocumentRenderer } from './spineItem/DocumentRenderer'; | ||
export { ResourceHandler } from './spineItem/ResourceHandler'; | ||
export { HookManager } from './hooks/HookManager'; | ||
@@ -5,0 +7,0 @@ export { SettingsManager } from './settings/SettingsManager'; |
@@ -34,7 +34,7 @@ import { Context } from '../context/Context'; | ||
spineItemPosition: import('../spineItem/types').UnsafeSpineItemPosition; | ||
spineItem: import('../spineItem/createSpineItem').SpineItem; | ||
spineItem: import('../spineItem/SpineItem').SpineItem; | ||
}) => import('./viewport/ViewportNavigator').ViewportPosition; | ||
getNavigationForCfi: (cfi: string) => import('./viewport/ViewportNavigator').ViewportPosition | undefined; | ||
getNavigationForLastPage: (spineItem: import('../spineItem/createSpineItem').SpineItem) => import('./viewport/ViewportNavigator').ViewportPosition; | ||
getNavigationForSpineIndexOrId: (indexOrId: number | string | import('../spineItem/createSpineItem').SpineItem) => import('./viewport/ViewportNavigator').ViewportPosition; | ||
getNavigationForLastPage: (spineItem: import('../spineItem/SpineItem').SpineItem) => import('./viewport/ViewportNavigator').ViewportPosition; | ||
getNavigationForSpineIndexOrId: (indexOrId: number | string | import('../spineItem/SpineItem').SpineItem) => import('./viewport/ViewportNavigator').ViewportPosition; | ||
getNavigationForPosition: (viewportPosition: import('./viewport/ViewportNavigator').ViewportPosition) => import('./viewport/ViewportNavigator').ViewportPosition; | ||
@@ -57,5 +57,5 @@ getMostPredominantNavigationForPosition: (viewportPosition: import('./viewport/ViewportNavigator').ViewportPosition) => import('./viewport/ViewportNavigator').ViewportPosition; | ||
spineItemNavigator: { | ||
getNavigationForLastPage: (spineItem: import('../spineItem/createSpineItem').SpineItem) => import('../spineItem/types').SafeSpineItemPosition; | ||
getNavigationForPosition: (spineItem: import('../spineItem/createSpineItem').SpineItem, position: import('../spineItem/types').UnsafeSpineItemPosition) => import('../spineItem/types').SafeSpineItemPosition; | ||
getNavigationFromNode: (spineItem: import('../spineItem/createSpineItem').SpineItem, node: Node, offset: number) => import('../spineItem/types').SafeSpineItemPosition; | ||
getNavigationForLastPage: (spineItem: import('../spineItem/SpineItem').SpineItem) => import('../spineItem/types').SafeSpineItemPosition; | ||
getNavigationForPosition: (spineItem: import('../spineItem/SpineItem').SpineItem, position: import('../spineItem/types').UnsafeSpineItemPosition) => import('../spineItem/types').SafeSpineItemPosition; | ||
getNavigationFromNode: (spineItem: import('../spineItem/SpineItem').SpineItem, node: Node, offset: number) => import('../spineItem/types').SafeSpineItemPosition; | ||
}; | ||
@@ -62,0 +62,0 @@ }; |
import { Context } from '../../context/Context'; | ||
import { SpineLocator } from '../../spine/locator/SpineLocator'; | ||
import { SpineItem } from '../../spineItem/createSpineItem'; | ||
import { SpineItem } from '../../spineItem/SpineItem'; | ||
import { SpineItemNavigationResolver } from '../../spineItem/navigationResolver'; | ||
@@ -5,0 +5,0 @@ import { SpineItemsManager } from '../../spine/SpineItemsManager'; |
import { Context } from '../../context/Context'; | ||
import { SpineLocator } from '../../spine/locator/SpineLocator'; | ||
import { SpineItem } from '../../spineItem/createSpineItem'; | ||
import { SpineItem } from '../../spineItem/SpineItem'; | ||
import { SpineItemLocator } from '../../spineItem/locationResolver'; | ||
@@ -5,0 +5,0 @@ import { UnsafeSpineItemPosition } from '../../spineItem/types'; |
import { Context } from '../../context/Context'; | ||
import { SpineItemsManager } from '../../spine/SpineItemsManager'; | ||
import { SpineItem } from '../../spineItem/createSpineItem'; | ||
import { SpineLocator } from '../../spine/locator/SpineLocator'; | ||
@@ -10,2 +9,3 @@ import { ReaderSettingsManager } from '../../settings/ReaderSettingsManager'; | ||
import { SpineLayout } from '../../spine/SpineLayout'; | ||
import { SpineItem } from '../../spineItem/SpineItem'; | ||
export declare const NAMESPACE = "spineNavigator"; | ||
@@ -12,0 +12,0 @@ export type NavigationResolver = ReturnType<typeof createNavigationResolver>; |
@@ -9,3 +9,3 @@ import { Subject } from 'rxjs'; | ||
import { Spine } from './spine/Spine'; | ||
import { SpineItem } from './spineItem/createSpineItem'; | ||
import { SpineItem } from './spineItem/SpineItem'; | ||
export type CreateReaderOptions = Partial<CoreInputSettings>; | ||
@@ -37,240 +37,6 @@ export type CreateReaderParameters = CreateReaderOptions; | ||
spineItemIndex: number; | ||
spineItem: { | ||
layout: ({ blankPagePosition, minimumWidth, spreadPosition, }: { | ||
blankPagePosition: `before` | `after` | `none`; | ||
minimumWidth: number; | ||
spreadPosition: `none` | `left` | `right`; | ||
}) => { | ||
width: number; | ||
height: number; | ||
}; | ||
item: { | ||
id: string; | ||
href: string; | ||
renditionLayout?: `reflowable` | `pre-paginated`; | ||
progressionWeight?: number; | ||
pageSpreadLeft?: true | undefined; | ||
pageSpreadRight?: true | undefined; | ||
mediaType?: string; | ||
}; | ||
overlayElement: HTMLDivElement; | ||
adjustPositionOfElement: ({ right, left, top, }: { | ||
right?: number; | ||
left?: number; | ||
top?: number; | ||
}) => void; | ||
getElementDimensions: () => { | ||
width: number; | ||
height: number; | ||
x: number; | ||
y: number; | ||
bottom: number; | ||
left: number; | ||
right: number; | ||
top: number; | ||
toJSON(): any; | ||
}; | ||
getHtmlFromResource: (response: Response) => Promise<string>; | ||
getResource: () => Promise<Response>; | ||
translateFramePositionIntoPage: (position: { | ||
clientX: number; | ||
clientY: number; | ||
}) => { | ||
clientX: number; | ||
clientY: number; | ||
}; | ||
injectStyle: (cssText: string) => void; | ||
load: () => void; | ||
unload: () => void; | ||
frame: import('./spineItem/frame/FrameItem').FrameItem; | ||
element: HTMLElement; | ||
getBoundingRectOfElementFromSelector: (selector: string) => DOMRect | undefined; | ||
getViewPortInformation: () => { | ||
computedScale: number; | ||
computedWidthScale: number; | ||
viewportDimensions: { | ||
width: number; | ||
height: number; | ||
}; | ||
} | undefined; | ||
isImageType: () => boolean; | ||
isReady: () => boolean; | ||
destroy: () => void; | ||
readingDirection: "ltr" | "rtl" | undefined; | ||
isUsingVerticalWriting: () => boolean | undefined; | ||
executeOnLayoutBeforeMeasurementHook: (options: { | ||
minimumWidth: number; | ||
}) => void[]; | ||
selectionTracker: { | ||
track: (frameToTrack: HTMLIFrameElement) => void; | ||
destroy: () => void; | ||
isSelecting: () => boolean; | ||
getSelection: () => Selection | undefined; | ||
$: import('rxjs').Observable<{ | ||
event: `selectionchange`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectstart`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectend`; | ||
data: Selection | null; | ||
}>; | ||
}; | ||
fingerTracker: { | ||
track: (frame: HTMLIFrameElement) => void; | ||
getFingerPositionInIframe(): { | ||
x: number | undefined; | ||
y: number | undefined; | ||
} | undefined; | ||
destroy: () => void; | ||
$: import('rxjs').Observable<{ | ||
event: `fingermove`; | ||
data: { | ||
x: number; | ||
y: number; | ||
}; | ||
} | { | ||
event: `fingerout`; | ||
data: undefined; | ||
}>; | ||
}; | ||
getDimensionsForReflowableContent: (isUsingVerticalWriting: boolean, minimumWidth: number) => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
width: number; | ||
}; | ||
getDimensionsForPaginatedContent: () => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
}; | ||
$: { | ||
contentLayout$: import('rxjs').Observable<{ | ||
isFirstLayout: boolean; | ||
isReady: boolean; | ||
}>; | ||
loaded$: import('rxjs').Observable<HTMLIFrameElement>; | ||
isReady$: import('rxjs').Observable<boolean>; | ||
}; | ||
}; | ||
spineItem: SpineItem; | ||
} | { | ||
spineItemIndex: number; | ||
spineItem: { | ||
layout: ({ blankPagePosition, minimumWidth, spreadPosition, }: { | ||
blankPagePosition: `before` | `after` | `none`; | ||
minimumWidth: number; | ||
spreadPosition: `none` | `left` | `right`; | ||
}) => { | ||
width: number; | ||
height: number; | ||
}; | ||
item: { | ||
id: string; | ||
href: string; | ||
renditionLayout?: `reflowable` | `pre-paginated`; | ||
progressionWeight?: number; | ||
pageSpreadLeft?: true | undefined; | ||
pageSpreadRight?: true | undefined; | ||
mediaType?: string; | ||
}; | ||
overlayElement: HTMLDivElement; | ||
adjustPositionOfElement: ({ right, left, top, }: { | ||
right?: number; | ||
left?: number; | ||
top?: number; | ||
}) => void; | ||
getElementDimensions: () => { | ||
width: number; | ||
height: number; | ||
x: number; | ||
y: number; | ||
bottom: number; | ||
left: number; | ||
right: number; | ||
top: number; | ||
toJSON(): any; | ||
}; | ||
getHtmlFromResource: (response: Response) => Promise<string>; | ||
getResource: () => Promise<Response>; | ||
translateFramePositionIntoPage: (position: { | ||
clientX: number; | ||
clientY: number; | ||
}) => { | ||
clientX: number; | ||
clientY: number; | ||
}; | ||
injectStyle: (cssText: string) => void; | ||
load: () => void; | ||
unload: () => void; | ||
frame: import('./spineItem/frame/FrameItem').FrameItem; | ||
element: HTMLElement; | ||
getBoundingRectOfElementFromSelector: (selector: string) => DOMRect | undefined; | ||
getViewPortInformation: () => { | ||
computedScale: number; | ||
computedWidthScale: number; | ||
viewportDimensions: { | ||
width: number; | ||
height: number; | ||
}; | ||
} | undefined; | ||
isImageType: () => boolean; | ||
isReady: () => boolean; | ||
destroy: () => void; | ||
readingDirection: "ltr" | "rtl" | undefined; | ||
isUsingVerticalWriting: () => boolean | undefined; | ||
executeOnLayoutBeforeMeasurementHook: (options: { | ||
minimumWidth: number; | ||
}) => void[]; | ||
selectionTracker: { | ||
track: (frameToTrack: HTMLIFrameElement) => void; | ||
destroy: () => void; | ||
isSelecting: () => boolean; | ||
getSelection: () => Selection | undefined; | ||
$: import('rxjs').Observable<{ | ||
event: `selectionchange`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectstart`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectend`; | ||
data: Selection | null; | ||
}>; | ||
}; | ||
fingerTracker: { | ||
track: (frame: HTMLIFrameElement) => void; | ||
getFingerPositionInIframe(): { | ||
x: number | undefined; | ||
y: number | undefined; | ||
} | undefined; | ||
destroy: () => void; | ||
$: import('rxjs').Observable<{ | ||
event: `fingermove`; | ||
data: { | ||
x: number; | ||
y: number; | ||
}; | ||
} | { | ||
event: `fingerout`; | ||
data: undefined; | ||
}>; | ||
}; | ||
getDimensionsForReflowableContent: (isUsingVerticalWriting: boolean, minimumWidth: number) => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
width: number; | ||
}; | ||
getDimensionsForPaginatedContent: () => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
}; | ||
$: { | ||
contentLayout$: import('rxjs').Observable<{ | ||
isFirstLayout: boolean; | ||
isReady: boolean; | ||
}>; | ||
loaded$: import('rxjs').Observable<HTMLIFrameElement>; | ||
isReady$: import('rxjs').Observable<boolean>; | ||
}; | ||
}; | ||
spineItem: SpineItem; | ||
node?: undefined; | ||
@@ -277,0 +43,0 @@ offset?: undefined; |
import { Observable, Subject } from 'rxjs'; | ||
import { SettingsInterface } from './SettingsInterface'; | ||
export declare abstract class SettingsManager<InputSettings, OutputSettings> implements SettingsInterface<InputSettings, OutputSettings> { | ||
import { DestroyableClass } from '../utils/DestroyableClass'; | ||
export declare abstract class SettingsManager<InputSettings, OutputSettings> extends DestroyableClass implements SettingsInterface<InputSettings, OutputSettings> { | ||
protected inputSettings: InputSettings; | ||
@@ -5,0 +6,0 @@ protected outputSettings?: OutputSettings; |
import { Manifest } from '@prose-reader/shared'; | ||
import { DocumentRenderer } from '../spineItem/DocumentRenderer'; | ||
import { Observable } from 'rxjs'; | ||
export type CoreInputSettings = { | ||
@@ -11,3 +13,9 @@ forceSinglePageMode: boolean; | ||
numberOfAdjacentSpineItemToPreLoad: number; | ||
fetchResource?: (item: Manifest[`spineItems`][number]) => Promise<Response>; | ||
getResource?: (item: Manifest["spineItems"][number]) => Observable<URL | Response | { | ||
custom: true; | ||
data: unknown; | ||
} | undefined> | undefined; | ||
getRenderer?: (item: Manifest["spineItems"][number]) => { | ||
new (...args: any[]): DocumentRenderer; | ||
}; | ||
}; | ||
@@ -14,0 +22,0 @@ export type ComputedCoreSettings = { |
import { Context } from '../../context/Context'; | ||
import { ReaderSettingsManager } from '../../settings/ReaderSettingsManager'; | ||
import { SpineItem } from '../../spineItem/createSpineItem'; | ||
import { SpineItem } from '../../spineItem/SpineItem'; | ||
import { SpineItemsManager } from '../SpineItemsManager'; | ||
@@ -5,0 +5,0 @@ import { SpineLayout } from '../SpineLayout'; |
import { Context } from '../../context/Context'; | ||
import { ReaderSettingsManager } from '../../settings/ReaderSettingsManager'; | ||
import { SpineItem } from '../../spineItem/SpineItem'; | ||
import { SpineItemsManager } from '../SpineItemsManager'; | ||
@@ -12,120 +13,3 @@ import { SpineLayout } from '../SpineLayout'; | ||
}) => { | ||
spineItem: { | ||
layout: ({ blankPagePosition, minimumWidth, spreadPosition, }: { | ||
blankPagePosition: `before` | `after` | `none`; | ||
minimumWidth: number; | ||
spreadPosition: `none` | `left` | `right`; | ||
}) => { | ||
width: number; | ||
height: number; | ||
}; | ||
item: { | ||
id: string; | ||
href: string; | ||
renditionLayout?: `reflowable` | `pre-paginated`; | ||
progressionWeight?: number; | ||
pageSpreadLeft?: true | undefined; | ||
pageSpreadRight?: true | undefined; | ||
mediaType?: string; | ||
}; | ||
overlayElement: HTMLDivElement; | ||
adjustPositionOfElement: ({ right, left, top, }: { | ||
right?: number; | ||
left?: number; | ||
top?: number; | ||
}) => void; | ||
getElementDimensions: () => { | ||
width: number; | ||
height: number; | ||
x: number; | ||
y: number; | ||
bottom: number; | ||
left: number; | ||
right: number; | ||
top: number; | ||
toJSON(): any; | ||
}; | ||
getHtmlFromResource: (response: Response) => Promise<string>; | ||
getResource: () => Promise<Response>; | ||
translateFramePositionIntoPage: (position: { | ||
clientX: number; | ||
clientY: number; | ||
}) => { | ||
clientX: number; | ||
clientY: number; | ||
}; | ||
injectStyle: (cssText: string) => void; | ||
load: () => void; | ||
unload: () => void; | ||
frame: import('../../spineItem/frame/FrameItem').FrameItem; | ||
element: HTMLElement; | ||
getBoundingRectOfElementFromSelector: (selector: string) => DOMRect | undefined; | ||
getViewPortInformation: () => { | ||
computedScale: number; | ||
computedWidthScale: number; | ||
viewportDimensions: { | ||
width: number; | ||
height: number; | ||
}; | ||
} | undefined; | ||
isImageType: () => boolean; | ||
isReady: () => boolean; | ||
destroy: () => void; | ||
readingDirection: "ltr" | "rtl" | undefined; | ||
isUsingVerticalWriting: () => boolean | undefined; | ||
executeOnLayoutBeforeMeasurementHook: (options: { | ||
minimumWidth: number; | ||
}) => void[]; | ||
selectionTracker: { | ||
track: (frameToTrack: HTMLIFrameElement) => void; | ||
destroy: () => void; | ||
isSelecting: () => boolean; | ||
getSelection: () => Selection | undefined; | ||
$: import('rxjs').Observable<{ | ||
event: `selectionchange`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectstart`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectend`; | ||
data: Selection | null; | ||
}>; | ||
}; | ||
fingerTracker: { | ||
track: (frame: HTMLIFrameElement) => void; | ||
getFingerPositionInIframe(): { | ||
x: number | undefined; | ||
y: number | undefined; | ||
} | undefined; | ||
destroy: () => void; | ||
$: import('rxjs').Observable<{ | ||
event: `fingermove`; | ||
data: { | ||
x: number; | ||
y: number; | ||
}; | ||
} | { | ||
event: `fingerout`; | ||
data: undefined; | ||
}>; | ||
}; | ||
getDimensionsForReflowableContent: (isUsingVerticalWriting: boolean, minimumWidth: number) => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
width: number; | ||
}; | ||
getDimensionsForPaginatedContent: () => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
}; | ||
$: { | ||
contentLayout$: import('rxjs').Observable<{ | ||
isFirstLayout: boolean; | ||
isReady: boolean; | ||
}>; | ||
loaded$: import('rxjs').Observable<HTMLIFrameElement>; | ||
isReady$: import('rxjs').Observable<boolean>; | ||
}; | ||
}; | ||
spineItem: SpineItem; | ||
pageIndex: number; | ||
@@ -132,0 +16,0 @@ itemIndex: number; |
@@ -10,119 +10,2 @@ import { ViewportPosition } from '../../navigation/viewport/ViewportNavigator'; | ||
settings: ReaderSettingsManager; | ||
}) => { | ||
layout: ({ blankPagePosition, minimumWidth, spreadPosition, }: { | ||
blankPagePosition: `before` | `after` | `none`; | ||
minimumWidth: number; | ||
spreadPosition: `none` | `left` | `right`; | ||
}) => { | ||
width: number; | ||
height: number; | ||
}; | ||
item: { | ||
id: string; | ||
href: string; | ||
renditionLayout?: `reflowable` | `pre-paginated`; | ||
progressionWeight?: number; | ||
pageSpreadLeft?: true | undefined; | ||
pageSpreadRight?: true | undefined; | ||
mediaType?: string; | ||
}; | ||
overlayElement: HTMLDivElement; | ||
adjustPositionOfElement: ({ right, left, top, }: { | ||
right?: number; | ||
left?: number; | ||
top?: number; | ||
}) => void; | ||
getElementDimensions: () => { | ||
width: number; | ||
height: number; | ||
x: number; | ||
y: number; | ||
bottom: number; | ||
left: number; | ||
right: number; | ||
top: number; | ||
toJSON(): any; | ||
}; | ||
getHtmlFromResource: (response: Response) => Promise<string>; | ||
getResource: () => Promise<Response>; | ||
translateFramePositionIntoPage: (position: { | ||
clientX: number; | ||
clientY: number; | ||
}) => { | ||
clientX: number; | ||
clientY: number; | ||
}; | ||
injectStyle: (cssText: string) => void; | ||
load: () => void; | ||
unload: () => void; | ||
frame: import('../../spineItem/frame/FrameItem').FrameItem; | ||
element: HTMLElement; | ||
getBoundingRectOfElementFromSelector: (selector: string) => DOMRect | undefined; | ||
getViewPortInformation: () => { | ||
computedScale: number; | ||
computedWidthScale: number; | ||
viewportDimensions: { | ||
width: number; | ||
height: number; | ||
}; | ||
} | undefined; | ||
isImageType: () => boolean; | ||
isReady: () => boolean; | ||
destroy: () => void; | ||
readingDirection: "ltr" | "rtl" | undefined; | ||
isUsingVerticalWriting: () => boolean | undefined; | ||
executeOnLayoutBeforeMeasurementHook: (options: { | ||
minimumWidth: number; | ||
}) => void[]; | ||
selectionTracker: { | ||
track: (frameToTrack: HTMLIFrameElement) => void; | ||
destroy: () => void; | ||
isSelecting: () => boolean; | ||
getSelection: () => Selection | undefined; | ||
$: import('rxjs').Observable<{ | ||
event: `selectionchange`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectstart`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectend`; | ||
data: Selection | null; | ||
}>; | ||
}; | ||
fingerTracker: { | ||
track: (frame: HTMLIFrameElement) => void; | ||
getFingerPositionInIframe(): { | ||
x: number | undefined; | ||
y: number | undefined; | ||
} | undefined; | ||
destroy: () => void; | ||
$: import('rxjs').Observable<{ | ||
event: `fingermove`; | ||
data: { | ||
x: number; | ||
y: number; | ||
}; | ||
} | { | ||
event: `fingerout`; | ||
data: undefined; | ||
}>; | ||
}; | ||
getDimensionsForReflowableContent: (isUsingVerticalWriting: boolean, minimumWidth: number) => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
width: number; | ||
}; | ||
getDimensionsForPaginatedContent: () => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
}; | ||
$: { | ||
contentLayout$: import('rxjs').Observable<{ | ||
isFirstLayout: boolean; | ||
isReady: boolean; | ||
}>; | ||
loaded$: import('rxjs').Observable<HTMLIFrameElement>; | ||
isReady$: import('rxjs').Observable<boolean>; | ||
}; | ||
} | undefined; | ||
}) => import('../../spineItem/SpineItem').SpineItem | undefined; |
import { Context } from '../../context/Context'; | ||
import { SpineItem } from '../../spineItem/createSpineItem'; | ||
import { SpineItem } from '../../spineItem/SpineItem'; | ||
import { createSpineItemLocator as createSpineItemLocator } from '../../spineItem/locationResolver'; | ||
@@ -26,120 +26,3 @@ import { SpineItemsManager } from '../SpineItemsManager'; | ||
getSpineInfoFromAbsolutePageIndex: (params: Omit<Parameters<typeof getSpineInfoFromAbsolutePageIndex>[0], "context" | "settings" | "spineLayout" | "spineItemsManager">) => { | ||
spineItem: { | ||
layout: ({ blankPagePosition, minimumWidth, spreadPosition, }: { | ||
blankPagePosition: `before` | `after` | `none`; | ||
minimumWidth: number; | ||
spreadPosition: `none` | `left` | `right`; | ||
}) => { | ||
width: number; | ||
height: number; | ||
}; | ||
item: { | ||
id: string; | ||
href: string; | ||
renditionLayout?: `reflowable` | `pre-paginated`; | ||
progressionWeight?: number; | ||
pageSpreadLeft?: true | undefined; | ||
pageSpreadRight?: true | undefined; | ||
mediaType?: string; | ||
}; | ||
overlayElement: HTMLDivElement; | ||
adjustPositionOfElement: ({ right, left, top, }: { | ||
right?: number; | ||
left?: number; | ||
top?: number; | ||
}) => void; | ||
getElementDimensions: () => { | ||
width: number; | ||
height: number; | ||
x: number; | ||
y: number; | ||
bottom: number; | ||
left: number; | ||
right: number; | ||
top: number; | ||
toJSON(): any; | ||
}; | ||
getHtmlFromResource: (response: Response) => Promise<string>; | ||
getResource: () => Promise<Response>; | ||
translateFramePositionIntoPage: (position: { | ||
clientX: number; | ||
clientY: number; | ||
}) => { | ||
clientX: number; | ||
clientY: number; | ||
}; | ||
injectStyle: (cssText: string) => void; | ||
load: () => void; | ||
unload: () => void; | ||
frame: import('../../spineItem/frame/FrameItem').FrameItem; | ||
element: HTMLElement; | ||
getBoundingRectOfElementFromSelector: (selector: string) => DOMRect | undefined; | ||
getViewPortInformation: () => { | ||
computedScale: number; | ||
computedWidthScale: number; | ||
viewportDimensions: { | ||
width: number; | ||
height: number; | ||
}; | ||
} | undefined; | ||
isImageType: () => boolean; | ||
isReady: () => boolean; | ||
destroy: () => void; | ||
readingDirection: "ltr" | "rtl" | undefined; | ||
isUsingVerticalWriting: () => boolean | undefined; | ||
executeOnLayoutBeforeMeasurementHook: (options: { | ||
minimumWidth: number; | ||
}) => void[]; | ||
selectionTracker: { | ||
track: (frameToTrack: HTMLIFrameElement) => void; | ||
destroy: () => void; | ||
isSelecting: () => boolean; | ||
getSelection: () => Selection | undefined; | ||
$: import('rxjs').Observable<{ | ||
event: `selectionchange`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectstart`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectend`; | ||
data: Selection | null; | ||
}>; | ||
}; | ||
fingerTracker: { | ||
track: (frame: HTMLIFrameElement) => void; | ||
getFingerPositionInIframe(): { | ||
x: number | undefined; | ||
y: number | undefined; | ||
} | undefined; | ||
destroy: () => void; | ||
$: import('rxjs').Observable<{ | ||
event: `fingermove`; | ||
data: { | ||
x: number; | ||
y: number; | ||
}; | ||
} | { | ||
event: `fingerout`; | ||
data: undefined; | ||
}>; | ||
}; | ||
getDimensionsForReflowableContent: (isUsingVerticalWriting: boolean, minimumWidth: number) => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
width: number; | ||
}; | ||
getDimensionsForPaginatedContent: () => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
}; | ||
$: { | ||
contentLayout$: import('rxjs').Observable<{ | ||
isFirstLayout: boolean; | ||
isReady: boolean; | ||
}>; | ||
loaded$: import('rxjs').Observable<HTMLIFrameElement>; | ||
isReady$: import('rxjs').Observable<boolean>; | ||
}; | ||
}; | ||
spineItem: SpineItem; | ||
pageIndex: number; | ||
@@ -150,356 +33,5 @@ itemIndex: number; | ||
getSpinePositionFromSpineItem: (spineItem: SpineItem) => ViewportPosition; | ||
getSpineItemPositionFromSpinePosition: ((position: ViewportPosition, spineItem: SpineItem) => UnsafeSpineItemPosition) | ((position: ViewportPosition, spineItem: { | ||
layout: ({ blankPagePosition, minimumWidth, spreadPosition, }: { | ||
blankPagePosition: `before` | `after` | `none`; | ||
minimumWidth: number; | ||
spreadPosition: `none` | `left` | `right`; | ||
}) => { | ||
width: number; | ||
height: number; | ||
}; | ||
item: { | ||
id: string; | ||
href: string; | ||
renditionLayout?: `reflowable` | `pre-paginated`; | ||
progressionWeight?: number; | ||
pageSpreadLeft?: true | undefined; | ||
pageSpreadRight?: true | undefined; | ||
mediaType?: string; | ||
}; | ||
overlayElement: HTMLDivElement; | ||
adjustPositionOfElement: ({ right, left, top, }: { | ||
right?: number; | ||
left?: number; | ||
top?: number; | ||
}) => void; | ||
getElementDimensions: () => { | ||
width: number; | ||
height: number; | ||
x: number; | ||
y: number; | ||
bottom: number; | ||
left: number; | ||
right: number; | ||
top: number; | ||
toJSON(): any; | ||
}; | ||
getHtmlFromResource: (response: Response) => Promise<string>; | ||
getResource: () => Promise<Response>; | ||
translateFramePositionIntoPage: (position: { | ||
clientX: number; | ||
clientY: number; | ||
}) => { | ||
clientX: number; | ||
clientY: number; | ||
}; | ||
injectStyle: (cssText: string) => void; | ||
load: () => void; | ||
unload: () => void; | ||
frame: import('../../spineItem/frame/FrameItem').FrameItem; | ||
element: HTMLElement; | ||
getBoundingRectOfElementFromSelector: (selector: string) => DOMRect | undefined; | ||
getViewPortInformation: () => { | ||
computedScale: number; | ||
computedWidthScale: number; | ||
viewportDimensions: { | ||
width: number; | ||
height: number; | ||
}; | ||
} | undefined; | ||
isImageType: () => boolean; | ||
isReady: () => boolean; | ||
destroy: () => void; | ||
readingDirection: "ltr" | "rtl" | undefined; | ||
isUsingVerticalWriting: () => boolean | undefined; | ||
executeOnLayoutBeforeMeasurementHook: (options: { | ||
minimumWidth: number; | ||
}) => void[]; | ||
selectionTracker: { | ||
track: (frameToTrack: HTMLIFrameElement) => void; | ||
destroy: () => void; | ||
isSelecting: () => boolean; | ||
getSelection: () => Selection | undefined; | ||
$: import('rxjs').Observable<{ | ||
event: `selectionchange`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectstart`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectend`; | ||
data: Selection | null; | ||
}>; | ||
}; | ||
fingerTracker: { | ||
track: (frame: HTMLIFrameElement) => void; | ||
getFingerPositionInIframe(): { | ||
x: number | undefined; | ||
y: number | undefined; | ||
} | undefined; | ||
destroy: () => void; | ||
$: import('rxjs').Observable<{ | ||
event: `fingermove`; | ||
data: { | ||
x: number; | ||
y: number; | ||
}; | ||
} | { | ||
event: `fingerout`; | ||
data: undefined; | ||
}>; | ||
}; | ||
getDimensionsForReflowableContent: (isUsingVerticalWriting: boolean, minimumWidth: number) => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
width: number; | ||
}; | ||
getDimensionsForPaginatedContent: () => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
}; | ||
$: { | ||
contentLayout$: import('rxjs').Observable<{ | ||
isFirstLayout: boolean; | ||
isReady: boolean; | ||
}>; | ||
loaded$: import('rxjs').Observable<HTMLIFrameElement>; | ||
isReady$: import('rxjs').Observable<boolean>; | ||
}; | ||
}) => UnsafeSpineItemPosition); | ||
getSpineItemFromPosition: (position: ViewportPosition) => { | ||
layout: ({ blankPagePosition, minimumWidth, spreadPosition, }: { | ||
blankPagePosition: `before` | `after` | `none`; | ||
minimumWidth: number; | ||
spreadPosition: `none` | `left` | `right`; | ||
}) => { | ||
width: number; | ||
height: number; | ||
}; | ||
item: { | ||
id: string; | ||
href: string; | ||
renditionLayout?: `reflowable` | `pre-paginated`; | ||
progressionWeight?: number; | ||
pageSpreadLeft?: true | undefined; | ||
pageSpreadRight?: true | undefined; | ||
mediaType?: string; | ||
}; | ||
overlayElement: HTMLDivElement; | ||
adjustPositionOfElement: ({ right, left, top, }: { | ||
right?: number; | ||
left?: number; | ||
top?: number; | ||
}) => void; | ||
getElementDimensions: () => { | ||
width: number; | ||
height: number; | ||
x: number; | ||
y: number; | ||
bottom: number; | ||
left: number; | ||
right: number; | ||
top: number; | ||
toJSON(): any; | ||
}; | ||
getHtmlFromResource: (response: Response) => Promise<string>; | ||
getResource: () => Promise<Response>; | ||
translateFramePositionIntoPage: (position: { | ||
clientX: number; | ||
clientY: number; | ||
}) => { | ||
clientX: number; | ||
clientY: number; | ||
}; | ||
injectStyle: (cssText: string) => void; | ||
load: () => void; | ||
unload: () => void; | ||
frame: import('../../spineItem/frame/FrameItem').FrameItem; | ||
element: HTMLElement; | ||
getBoundingRectOfElementFromSelector: (selector: string) => DOMRect | undefined; | ||
getViewPortInformation: () => { | ||
computedScale: number; | ||
computedWidthScale: number; | ||
viewportDimensions: { | ||
width: number; | ||
height: number; | ||
}; | ||
} | undefined; | ||
isImageType: () => boolean; | ||
isReady: () => boolean; | ||
destroy: () => void; | ||
readingDirection: "ltr" | "rtl" | undefined; | ||
isUsingVerticalWriting: () => boolean | undefined; | ||
executeOnLayoutBeforeMeasurementHook: (options: { | ||
minimumWidth: number; | ||
}) => void[]; | ||
selectionTracker: { | ||
track: (frameToTrack: HTMLIFrameElement) => void; | ||
destroy: () => void; | ||
isSelecting: () => boolean; | ||
getSelection: () => Selection | undefined; | ||
$: import('rxjs').Observable<{ | ||
event: `selectionchange`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectstart`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectend`; | ||
data: Selection | null; | ||
}>; | ||
}; | ||
fingerTracker: { | ||
track: (frame: HTMLIFrameElement) => void; | ||
getFingerPositionInIframe(): { | ||
x: number | undefined; | ||
y: number | undefined; | ||
} | undefined; | ||
destroy: () => void; | ||
$: import('rxjs').Observable<{ | ||
event: `fingermove`; | ||
data: { | ||
x: number; | ||
y: number; | ||
}; | ||
} | { | ||
event: `fingerout`; | ||
data: undefined; | ||
}>; | ||
}; | ||
getDimensionsForReflowableContent: (isUsingVerticalWriting: boolean, minimumWidth: number) => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
width: number; | ||
}; | ||
getDimensionsForPaginatedContent: () => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
}; | ||
$: { | ||
contentLayout$: import('rxjs').Observable<{ | ||
isFirstLayout: boolean; | ||
isReady: boolean; | ||
}>; | ||
loaded$: import('rxjs').Observable<HTMLIFrameElement>; | ||
isReady$: import('rxjs').Observable<boolean>; | ||
}; | ||
} | undefined; | ||
getSpineItemFromIframe: (iframe: Element) => { | ||
layout: ({ blankPagePosition, minimumWidth, spreadPosition, }: { | ||
blankPagePosition: `before` | `after` | `none`; | ||
minimumWidth: number; | ||
spreadPosition: `none` | `left` | `right`; | ||
}) => { | ||
width: number; | ||
height: number; | ||
}; | ||
item: { | ||
id: string; | ||
href: string; | ||
renditionLayout?: `reflowable` | `pre-paginated`; | ||
progressionWeight?: number; | ||
pageSpreadLeft?: true | undefined; | ||
pageSpreadRight?: true | undefined; | ||
mediaType?: string; | ||
}; | ||
overlayElement: HTMLDivElement; | ||
adjustPositionOfElement: ({ right, left, top, }: { | ||
right?: number; | ||
left?: number; | ||
top?: number; | ||
}) => void; | ||
getElementDimensions: () => { | ||
width: number; | ||
height: number; | ||
x: number; | ||
y: number; | ||
bottom: number; | ||
left: number; | ||
right: number; | ||
top: number; | ||
toJSON(): any; | ||
}; | ||
getHtmlFromResource: (response: Response) => Promise<string>; | ||
getResource: () => Promise<Response>; | ||
translateFramePositionIntoPage: (position: { | ||
clientX: number; | ||
clientY: number; | ||
}) => { | ||
clientX: number; | ||
clientY: number; | ||
}; | ||
injectStyle: (cssText: string) => void; | ||
load: () => void; | ||
unload: () => void; | ||
frame: import('../../spineItem/frame/FrameItem').FrameItem; | ||
element: HTMLElement; | ||
getBoundingRectOfElementFromSelector: (selector: string) => DOMRect | undefined; | ||
getViewPortInformation: () => { | ||
computedScale: number; | ||
computedWidthScale: number; | ||
viewportDimensions: { | ||
width: number; | ||
height: number; | ||
}; | ||
} | undefined; | ||
isImageType: () => boolean; | ||
isReady: () => boolean; | ||
destroy: () => void; | ||
readingDirection: "ltr" | "rtl" | undefined; | ||
isUsingVerticalWriting: () => boolean | undefined; | ||
executeOnLayoutBeforeMeasurementHook: (options: { | ||
minimumWidth: number; | ||
}) => void[]; | ||
selectionTracker: { | ||
track: (frameToTrack: HTMLIFrameElement) => void; | ||
destroy: () => void; | ||
isSelecting: () => boolean; | ||
getSelection: () => Selection | undefined; | ||
$: import('rxjs').Observable<{ | ||
event: `selectionchange`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectstart`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectend`; | ||
data: Selection | null; | ||
}>; | ||
}; | ||
fingerTracker: { | ||
track: (frame: HTMLIFrameElement) => void; | ||
getFingerPositionInIframe(): { | ||
x: number | undefined; | ||
y: number | undefined; | ||
} | undefined; | ||
destroy: () => void; | ||
$: import('rxjs').Observable<{ | ||
event: `fingermove`; | ||
data: { | ||
x: number; | ||
y: number; | ||
}; | ||
} | { | ||
event: `fingerout`; | ||
data: undefined; | ||
}>; | ||
}; | ||
getDimensionsForReflowableContent: (isUsingVerticalWriting: boolean, minimumWidth: number) => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
width: number; | ||
}; | ||
getDimensionsForPaginatedContent: () => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
}; | ||
$: { | ||
contentLayout$: import('rxjs').Observable<{ | ||
isFirstLayout: boolean; | ||
isReady: boolean; | ||
}>; | ||
loaded$: import('rxjs').Observable<HTMLIFrameElement>; | ||
isReady$: import('rxjs').Observable<boolean>; | ||
}; | ||
} | undefined; | ||
getSpineItemPositionFromSpinePosition: ((position: ViewportPosition, spineItem: SpineItem) => UnsafeSpineItemPosition) | ((position: ViewportPosition, spineItem: SpineItem) => UnsafeSpineItemPosition); | ||
getSpineItemFromPosition: (position: ViewportPosition) => SpineItem | undefined; | ||
getSpineItemFromIframe: (iframe: Element) => SpineItem | undefined; | ||
getSpineItemPageIndexFromNode: (node: Node, offset: number | undefined, spineItemOrIndex: SpineItem | number) => number | undefined; | ||
@@ -506,0 +38,0 @@ getVisibleSpineItemsFromPosition: (params: Omit<Parameters<typeof getVisibleSpineItemsFromPosition>[0], "context" | "spineItemsManager" | "settings" | "spineLayout">) => { |
import { Context } from '../context/Context'; | ||
import { SpineItem } from '../spineItem/createSpineItem'; | ||
import { ReaderSettingsManager } from '../settings/ReaderSettingsManager'; | ||
import { DestroyableClass } from '../utils/DestroyableClass'; | ||
import { BehaviorSubject } from 'rxjs'; | ||
import { SpineItem } from '../spineItem/SpineItem'; | ||
export declare class SpineItemsManager extends DestroyableClass { | ||
@@ -10,596 +10,11 @@ protected context: Context; | ||
constructor(context: Context, settings: ReaderSettingsManager); | ||
protected orderedSpineItemsSubject: BehaviorSubject<{ | ||
layout: ({ blankPagePosition, minimumWidth, spreadPosition, }: { | ||
blankPagePosition: `before` | `after` | `none`; | ||
minimumWidth: number; | ||
spreadPosition: `none` | `left` | `right`; | ||
}) => { | ||
width: number; | ||
height: number; | ||
}; | ||
item: { | ||
id: string; | ||
href: string; | ||
renditionLayout?: `reflowable` | `pre-paginated`; | ||
progressionWeight?: number; | ||
pageSpreadLeft?: true | undefined; | ||
pageSpreadRight?: true | undefined; | ||
mediaType?: string; | ||
}; | ||
overlayElement: HTMLDivElement; | ||
adjustPositionOfElement: ({ right, left, top, }: { | ||
right?: number; | ||
left?: number; | ||
top?: number; | ||
}) => void; | ||
getElementDimensions: () => { | ||
width: number; | ||
height: number; | ||
x: number; | ||
y: number; | ||
bottom: number; | ||
left: number; | ||
right: number; | ||
top: number; | ||
toJSON(): any; | ||
}; | ||
getHtmlFromResource: (response: Response) => Promise<string>; | ||
getResource: () => Promise<Response>; | ||
translateFramePositionIntoPage: (position: { | ||
clientX: number; | ||
clientY: number; | ||
}) => { | ||
clientX: number; | ||
clientY: number; | ||
}; | ||
injectStyle: (cssText: string) => void; | ||
load: () => void; | ||
unload: () => void; | ||
frame: import('../spineItem/frame/FrameItem').FrameItem; | ||
element: HTMLElement; | ||
getBoundingRectOfElementFromSelector: (selector: string) => DOMRect | undefined; | ||
getViewPortInformation: () => { | ||
computedScale: number; | ||
computedWidthScale: number; | ||
viewportDimensions: { | ||
width: number; | ||
height: number; | ||
}; | ||
} | undefined; | ||
isImageType: () => boolean; | ||
isReady: () => boolean; | ||
destroy: () => void; | ||
readingDirection: "ltr" | "rtl" | undefined; | ||
isUsingVerticalWriting: () => boolean | undefined; | ||
executeOnLayoutBeforeMeasurementHook: (options: { | ||
minimumWidth: number; | ||
}) => void[]; | ||
selectionTracker: { | ||
track: (frameToTrack: HTMLIFrameElement) => void; | ||
destroy: () => void; | ||
isSelecting: () => boolean; | ||
getSelection: () => Selection | undefined; | ||
$: import('rxjs').Observable<{ | ||
event: `selectionchange`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectstart`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectend`; | ||
data: Selection | null; | ||
}>; | ||
}; | ||
fingerTracker: { | ||
track: (frame: HTMLIFrameElement) => void; | ||
getFingerPositionInIframe(): { | ||
x: number | undefined; | ||
y: number | undefined; | ||
} | undefined; | ||
destroy: () => void; | ||
$: import('rxjs').Observable<{ | ||
event: `fingermove`; | ||
data: { | ||
x: number; | ||
y: number; | ||
}; | ||
} | { | ||
event: `fingerout`; | ||
data: undefined; | ||
}>; | ||
}; | ||
getDimensionsForReflowableContent: (isUsingVerticalWriting: boolean, minimumWidth: number) => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
width: number; | ||
}; | ||
getDimensionsForPaginatedContent: () => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
}; | ||
$: { | ||
contentLayout$: import('rxjs').Observable<{ | ||
isFirstLayout: boolean; | ||
isReady: boolean; | ||
}>; | ||
loaded$: import('rxjs').Observable<HTMLIFrameElement>; | ||
isReady$: import('rxjs').Observable<boolean>; | ||
}; | ||
}[]>; | ||
items$: import('rxjs').Observable<{ | ||
layout: ({ blankPagePosition, minimumWidth, spreadPosition, }: { | ||
blankPagePosition: `before` | `after` | `none`; | ||
minimumWidth: number; | ||
spreadPosition: `none` | `left` | `right`; | ||
}) => { | ||
width: number; | ||
height: number; | ||
}; | ||
item: { | ||
id: string; | ||
href: string; | ||
renditionLayout?: `reflowable` | `pre-paginated`; | ||
progressionWeight?: number; | ||
pageSpreadLeft?: true | undefined; | ||
pageSpreadRight?: true | undefined; | ||
mediaType?: string; | ||
}; | ||
overlayElement: HTMLDivElement; | ||
adjustPositionOfElement: ({ right, left, top, }: { | ||
right?: number; | ||
left?: number; | ||
top?: number; | ||
}) => void; | ||
getElementDimensions: () => { | ||
width: number; | ||
height: number; | ||
x: number; | ||
y: number; | ||
bottom: number; | ||
left: number; | ||
right: number; | ||
top: number; | ||
toJSON(): any; | ||
}; | ||
getHtmlFromResource: (response: Response) => Promise<string>; | ||
getResource: () => Promise<Response>; | ||
translateFramePositionIntoPage: (position: { | ||
clientX: number; | ||
clientY: number; | ||
}) => { | ||
clientX: number; | ||
clientY: number; | ||
}; | ||
injectStyle: (cssText: string) => void; | ||
load: () => void; | ||
unload: () => void; | ||
frame: import('../spineItem/frame/FrameItem').FrameItem; | ||
element: HTMLElement; | ||
getBoundingRectOfElementFromSelector: (selector: string) => DOMRect | undefined; | ||
getViewPortInformation: () => { | ||
computedScale: number; | ||
computedWidthScale: number; | ||
viewportDimensions: { | ||
width: number; | ||
height: number; | ||
}; | ||
} | undefined; | ||
isImageType: () => boolean; | ||
isReady: () => boolean; | ||
destroy: () => void; | ||
readingDirection: "ltr" | "rtl" | undefined; | ||
isUsingVerticalWriting: () => boolean | undefined; | ||
executeOnLayoutBeforeMeasurementHook: (options: { | ||
minimumWidth: number; | ||
}) => void[]; | ||
selectionTracker: { | ||
track: (frameToTrack: HTMLIFrameElement) => void; | ||
destroy: () => void; | ||
isSelecting: () => boolean; | ||
getSelection: () => Selection | undefined; | ||
$: import('rxjs').Observable<{ | ||
event: `selectionchange`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectstart`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectend`; | ||
data: Selection | null; | ||
}>; | ||
}; | ||
fingerTracker: { | ||
track: (frame: HTMLIFrameElement) => void; | ||
getFingerPositionInIframe(): { | ||
x: number | undefined; | ||
y: number | undefined; | ||
} | undefined; | ||
destroy: () => void; | ||
$: import('rxjs').Observable<{ | ||
event: `fingermove`; | ||
data: { | ||
x: number; | ||
y: number; | ||
}; | ||
} | { | ||
event: `fingerout`; | ||
data: undefined; | ||
}>; | ||
}; | ||
getDimensionsForReflowableContent: (isUsingVerticalWriting: boolean, minimumWidth: number) => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
width: number; | ||
}; | ||
getDimensionsForPaginatedContent: () => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
}; | ||
$: { | ||
contentLayout$: import('rxjs').Observable<{ | ||
isFirstLayout: boolean; | ||
isReady: boolean; | ||
}>; | ||
loaded$: import('rxjs').Observable<HTMLIFrameElement>; | ||
isReady$: import('rxjs').Observable<boolean>; | ||
}; | ||
}[]>; | ||
get(indexOrId: number | string | SpineItem | undefined): { | ||
layout: ({ blankPagePosition, minimumWidth, spreadPosition, }: { | ||
blankPagePosition: `before` | `after` | `none`; | ||
minimumWidth: number; | ||
spreadPosition: `none` | `left` | `right`; | ||
}) => { | ||
width: number; | ||
height: number; | ||
}; | ||
item: { | ||
id: string; | ||
href: string; | ||
renditionLayout?: `reflowable` | `pre-paginated`; | ||
progressionWeight?: number; | ||
pageSpreadLeft?: true | undefined; | ||
pageSpreadRight?: true | undefined; | ||
mediaType?: string; | ||
}; | ||
overlayElement: HTMLDivElement; | ||
adjustPositionOfElement: ({ right, left, top, }: { | ||
right?: number; | ||
left?: number; | ||
top?: number; | ||
}) => void; | ||
getElementDimensions: () => { | ||
width: number; | ||
height: number; | ||
x: number; | ||
y: number; | ||
bottom: number; | ||
left: number; | ||
right: number; | ||
top: number; | ||
toJSON(): any; | ||
}; | ||
getHtmlFromResource: (response: Response) => Promise<string>; | ||
getResource: () => Promise<Response>; | ||
translateFramePositionIntoPage: (position: { | ||
clientX: number; | ||
clientY: number; | ||
}) => { | ||
clientX: number; | ||
clientY: number; | ||
}; | ||
injectStyle: (cssText: string) => void; | ||
load: () => void; | ||
unload: () => void; | ||
frame: import('../spineItem/frame/FrameItem').FrameItem; | ||
element: HTMLElement; | ||
getBoundingRectOfElementFromSelector: (selector: string) => DOMRect | undefined; | ||
getViewPortInformation: () => { | ||
computedScale: number; | ||
computedWidthScale: number; | ||
viewportDimensions: { | ||
width: number; | ||
height: number; | ||
}; | ||
} | undefined; | ||
isImageType: () => boolean; | ||
isReady: () => boolean; | ||
destroy: () => void; | ||
readingDirection: "ltr" | "rtl" | undefined; | ||
isUsingVerticalWriting: () => boolean | undefined; | ||
executeOnLayoutBeforeMeasurementHook: (options: { | ||
minimumWidth: number; | ||
}) => void[]; | ||
selectionTracker: { | ||
track: (frameToTrack: HTMLIFrameElement) => void; | ||
destroy: () => void; | ||
isSelecting: () => boolean; | ||
getSelection: () => Selection | undefined; | ||
$: import('rxjs').Observable<{ | ||
event: `selectionchange`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectstart`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectend`; | ||
data: Selection | null; | ||
}>; | ||
}; | ||
fingerTracker: { | ||
track: (frame: HTMLIFrameElement) => void; | ||
getFingerPositionInIframe(): { | ||
x: number | undefined; | ||
y: number | undefined; | ||
} | undefined; | ||
destroy: () => void; | ||
$: import('rxjs').Observable<{ | ||
event: `fingermove`; | ||
data: { | ||
x: number; | ||
y: number; | ||
}; | ||
} | { | ||
event: `fingerout`; | ||
data: undefined; | ||
}>; | ||
}; | ||
getDimensionsForReflowableContent: (isUsingVerticalWriting: boolean, minimumWidth: number) => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
width: number; | ||
}; | ||
getDimensionsForPaginatedContent: () => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
}; | ||
$: { | ||
contentLayout$: import('rxjs').Observable<{ | ||
isFirstLayout: boolean; | ||
isReady: boolean; | ||
}>; | ||
loaded$: import('rxjs').Observable<HTMLIFrameElement>; | ||
isReady$: import('rxjs').Observable<boolean>; | ||
}; | ||
} | undefined; | ||
protected orderedSpineItemsSubject: BehaviorSubject<SpineItem[]>; | ||
items$: import('rxjs').Observable<SpineItem[]>; | ||
get(indexOrId: number | string | SpineItem | undefined): SpineItem | undefined; | ||
comparePositionOf(toCompare: SpineItem, withItem: SpineItem): "after" | "before" | "same"; | ||
getSpineItemIndex(spineItem: SpineItem | undefined): number | undefined; | ||
addMany(spineItems: SpineItem[]): void; | ||
getSpineItemFromCfi(cfi: string): { | ||
layout: ({ blankPagePosition, minimumWidth, spreadPosition, }: { | ||
blankPagePosition: `before` | `after` | `none`; | ||
minimumWidth: number; | ||
spreadPosition: `none` | `left` | `right`; | ||
}) => { | ||
width: number; | ||
height: number; | ||
}; | ||
item: { | ||
id: string; | ||
href: string; | ||
renditionLayout?: `reflowable` | `pre-paginated`; | ||
progressionWeight?: number; | ||
pageSpreadLeft?: true | undefined; | ||
pageSpreadRight?: true | undefined; | ||
mediaType?: string; | ||
}; | ||
overlayElement: HTMLDivElement; | ||
adjustPositionOfElement: ({ right, left, top, }: { | ||
right?: number; | ||
left?: number; | ||
top?: number; | ||
}) => void; | ||
getElementDimensions: () => { | ||
width: number; | ||
height: number; | ||
x: number; | ||
y: number; | ||
bottom: number; | ||
left: number; | ||
right: number; | ||
top: number; | ||
toJSON(): any; | ||
}; | ||
getHtmlFromResource: (response: Response) => Promise<string>; | ||
getResource: () => Promise<Response>; | ||
translateFramePositionIntoPage: (position: { | ||
clientX: number; | ||
clientY: number; | ||
}) => { | ||
clientX: number; | ||
clientY: number; | ||
}; | ||
injectStyle: (cssText: string) => void; | ||
load: () => void; | ||
unload: () => void; | ||
frame: import('../spineItem/frame/FrameItem').FrameItem; | ||
element: HTMLElement; | ||
getBoundingRectOfElementFromSelector: (selector: string) => DOMRect | undefined; | ||
getViewPortInformation: () => { | ||
computedScale: number; | ||
computedWidthScale: number; | ||
viewportDimensions: { | ||
width: number; | ||
height: number; | ||
}; | ||
} | undefined; | ||
isImageType: () => boolean; | ||
isReady: () => boolean; | ||
destroy: () => void; | ||
readingDirection: "ltr" | "rtl" | undefined; | ||
isUsingVerticalWriting: () => boolean | undefined; | ||
executeOnLayoutBeforeMeasurementHook: (options: { | ||
minimumWidth: number; | ||
}) => void[]; | ||
selectionTracker: { | ||
track: (frameToTrack: HTMLIFrameElement) => void; | ||
destroy: () => void; | ||
isSelecting: () => boolean; | ||
getSelection: () => Selection | undefined; | ||
$: import('rxjs').Observable<{ | ||
event: `selectionchange`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectstart`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectend`; | ||
data: Selection | null; | ||
}>; | ||
}; | ||
fingerTracker: { | ||
track: (frame: HTMLIFrameElement) => void; | ||
getFingerPositionInIframe(): { | ||
x: number | undefined; | ||
y: number | undefined; | ||
} | undefined; | ||
destroy: () => void; | ||
$: import('rxjs').Observable<{ | ||
event: `fingermove`; | ||
data: { | ||
x: number; | ||
y: number; | ||
}; | ||
} | { | ||
event: `fingerout`; | ||
data: undefined; | ||
}>; | ||
}; | ||
getDimensionsForReflowableContent: (isUsingVerticalWriting: boolean, minimumWidth: number) => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
width: number; | ||
}; | ||
getDimensionsForPaginatedContent: () => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
}; | ||
$: { | ||
contentLayout$: import('rxjs').Observable<{ | ||
isFirstLayout: boolean; | ||
isReady: boolean; | ||
}>; | ||
loaded$: import('rxjs').Observable<HTMLIFrameElement>; | ||
isReady$: import('rxjs').Observable<boolean>; | ||
}; | ||
} | undefined; | ||
get items(): { | ||
layout: ({ blankPagePosition, minimumWidth, spreadPosition, }: { | ||
blankPagePosition: `before` | `after` | `none`; | ||
minimumWidth: number; | ||
spreadPosition: `none` | `left` | `right`; | ||
}) => { | ||
width: number; | ||
height: number; | ||
}; | ||
item: { | ||
id: string; | ||
href: string; | ||
renditionLayout?: `reflowable` | `pre-paginated`; | ||
progressionWeight?: number; | ||
pageSpreadLeft?: true | undefined; | ||
pageSpreadRight?: true | undefined; | ||
mediaType?: string; | ||
}; | ||
overlayElement: HTMLDivElement; | ||
adjustPositionOfElement: ({ right, left, top, }: { | ||
right?: number; | ||
left?: number; | ||
top?: number; | ||
}) => void; | ||
getElementDimensions: () => { | ||
width: number; | ||
height: number; | ||
x: number; | ||
y: number; | ||
bottom: number; | ||
left: number; | ||
right: number; | ||
top: number; | ||
toJSON(): any; | ||
}; | ||
getHtmlFromResource: (response: Response) => Promise<string>; | ||
getResource: () => Promise<Response>; | ||
translateFramePositionIntoPage: (position: { | ||
clientX: number; | ||
clientY: number; | ||
}) => { | ||
clientX: number; | ||
clientY: number; | ||
}; | ||
injectStyle: (cssText: string) => void; | ||
load: () => void; | ||
unload: () => void; | ||
frame: import('../spineItem/frame/FrameItem').FrameItem; | ||
element: HTMLElement; | ||
getBoundingRectOfElementFromSelector: (selector: string) => DOMRect | undefined; | ||
getViewPortInformation: () => { | ||
computedScale: number; | ||
computedWidthScale: number; | ||
viewportDimensions: { | ||
width: number; | ||
height: number; | ||
}; | ||
} | undefined; | ||
isImageType: () => boolean; | ||
isReady: () => boolean; | ||
destroy: () => void; | ||
readingDirection: "ltr" | "rtl" | undefined; | ||
isUsingVerticalWriting: () => boolean | undefined; | ||
executeOnLayoutBeforeMeasurementHook: (options: { | ||
minimumWidth: number; | ||
}) => void[]; | ||
selectionTracker: { | ||
track: (frameToTrack: HTMLIFrameElement) => void; | ||
destroy: () => void; | ||
isSelecting: () => boolean; | ||
getSelection: () => Selection | undefined; | ||
$: import('rxjs').Observable<{ | ||
event: `selectionchange`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectstart`; | ||
data: Selection | null; | ||
} | { | ||
event: `selectend`; | ||
data: Selection | null; | ||
}>; | ||
}; | ||
fingerTracker: { | ||
track: (frame: HTMLIFrameElement) => void; | ||
getFingerPositionInIframe(): { | ||
x: number | undefined; | ||
y: number | undefined; | ||
} | undefined; | ||
destroy: () => void; | ||
$: import('rxjs').Observable<{ | ||
event: `fingermove`; | ||
data: { | ||
x: number; | ||
y: number; | ||
}; | ||
} | { | ||
event: `fingerout`; | ||
data: undefined; | ||
}>; | ||
}; | ||
getDimensionsForReflowableContent: (isUsingVerticalWriting: boolean, minimumWidth: number) => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
width: number; | ||
}; | ||
getDimensionsForPaginatedContent: () => { | ||
columnHeight: number; | ||
columnWidth: number; | ||
}; | ||
$: { | ||
contentLayout$: import('rxjs').Observable<{ | ||
isFirstLayout: boolean; | ||
isReady: boolean; | ||
}>; | ||
loaded$: import('rxjs').Observable<HTMLIFrameElement>; | ||
isReady$: import('rxjs').Observable<boolean>; | ||
}; | ||
}[]; | ||
getSpineItemFromCfi(cfi: string): SpineItem | undefined; | ||
get items(): SpineItem[]; | ||
destroyItems(): void; | ||
} |
import { Observable } from 'rxjs'; | ||
import { SpineItemsManager } from './SpineItemsManager'; | ||
import { DestroyableClass } from '../utils/DestroyableClass'; | ||
import { SpineItem } from '../spineItem/createSpineItem'; | ||
import { SpineLocator } from './locator/SpineLocator'; | ||
import { SpineItem } from '../spineItem/SpineItem'; | ||
export declare class SpineItemsObserver extends DestroyableClass { | ||
@@ -13,2 +13,3 @@ protected spineItemsManager: SpineItemsManager; | ||
}>; | ||
itemLoaded$: Observable<SpineItem>; | ||
itemResize$: Observable<{ | ||
@@ -15,0 +16,0 @@ item: SpineItem; |
@@ -6,3 +6,3 @@ import { Observable, Subject } from 'rxjs'; | ||
import { SpineItemsManager } from './SpineItemsManager'; | ||
import { SpineItem } from '../spineItem/createSpineItem'; | ||
import { SpineItem } from '../spineItem/SpineItem'; | ||
export type LayoutPosition = { | ||
@@ -9,0 +9,0 @@ left: number; |
import { Context } from '../context/Context'; | ||
import { SpineItem } from './createSpineItem'; | ||
import { SafeSpineItemPosition, UnsafeSpineItemPosition } from './types'; | ||
import { ReaderSettingsManager } from '../settings/ReaderSettingsManager'; | ||
import { SpineItem } from './SpineItem'; | ||
export type SpineItemLocator = ReturnType<typeof createSpineItemLocator>; | ||
@@ -6,0 +6,0 @@ export declare const createSpineItemLocator: ({ context, settings, }: { |
@@ -1,5 +0,5 @@ | ||
import { SpineItem } from './createSpineItem'; | ||
import { Context } from '../context/Context'; | ||
import { SafeSpineItemPosition, UnsafeSpineItemPosition } from './types'; | ||
import { ReaderSettingsManager } from '../settings/ReaderSettingsManager'; | ||
import { SpineItem } from './SpineItem'; | ||
export type SpineItemNavigationResolver = ReturnType<typeof createNavigationResolver>; | ||
@@ -6,0 +6,0 @@ export declare const createNavigationResolver: ({ context, settings, }: { |
@@ -0,1 +1,16 @@ | ||
import { Observable } from 'rxjs'; | ||
export declare const getAttributeValueFromString: (string: string, key: string) => number; | ||
export declare const injectCSS: (frameElement: HTMLIFrameElement, id: string, style: string, prepend?: boolean) => void; | ||
export declare const removeCSS: (frameElement: HTMLIFrameElement, id: string) => void; | ||
export declare const upsertCSS: (frameElement: HTMLIFrameElement | undefined, id: string, style: string, prepend?: boolean) => void; | ||
export declare const getFrameViewportInfo: (frame: HTMLIFrameElement | undefined) => { | ||
hasViewport: boolean; | ||
width: number; | ||
height: number; | ||
} | { | ||
hasViewport: boolean; | ||
width?: undefined; | ||
height?: undefined; | ||
}; | ||
export declare const waitForFrameLoad: (stream: Observable<HTMLIFrameElement>) => Observable<HTMLIFrameElement>; | ||
export declare const waitForFrameReady: (stream: Observable<HTMLIFrameElement>) => Observable<HTMLIFrameElement>; |
{ | ||
"name": "@prose-reader/core", | ||
"version": "1.117.0", | ||
"version": "1.118.0", | ||
"type": "module", | ||
@@ -28,3 +28,3 @@ "main": "./dist/index.umd.cjs", | ||
"dependencies": { | ||
"@prose-reader/shared": "^1.117.0" | ||
"@prose-reader/shared": "^1.118.0" | ||
}, | ||
@@ -37,3 +37,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "7979b7ba99701920e600a1c3a798d141fa3679f3" | ||
"gitHead": "59295c56689dd28573e727df2e4cb688f5331e66" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2158565
27385