@orangelogic/design-system 2.107.0 → 2.109.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/library/assets/design-system.css +1 -1
- package/library/chunks/{asset.BKBJqVqY.js → asset.CQrdW8Hz.js} +2 -2
- package/library/chunks/{button.CZ-e_TGN.js → button.i88sSbTZ.js} +1 -1
- package/library/chunks/{color-swatch-group.BTwy546N.js → color-swatch-group.mIHaCJsh.js} +5 -5
- package/library/chunks/{color-swatch.DHxppzoQ.js → color-swatch.D9vkPoV2.js} +1 -1
- package/library/chunks/{confirm-popover.DknitT29.js → confirm-popover.UuBhn8GA.js} +3 -3
- package/library/chunks/{content-builder.B-bd8FaV.js → content-builder.OsUmm8Wu.js} +15 -15
- package/library/chunks/{dialog.BOWFhWcd.js → dialog.Bso6gK-8.js} +2 -2
- package/library/chunks/document-viewer.C6eclRvd.js +25232 -0
- package/library/chunks/{dot-pagination.CBRkADz0.js → dot-pagination.CNnUuI-Z.js} +1 -1
- package/library/chunks/{file-on-demand.BVA_s4TR.js → file-on-demand.Cf2ujTeF.js} +8 -8
- package/library/chunks/{folder-select.EVuyDx55.js → folder-select.ByNUfTia.js} +3 -3
- package/library/chunks/{header.inh-TC_q.js → header.hj2Kw-N7.js} +1 -1
- package/library/chunks/{i18n.DmmFsjwP.js → i18n.D6AYDPK-.js} +34 -14
- package/library/chunks/{icon-button.CHh2iNJJ.js → icon-button.ztYU-DHy.js} +1 -1
- package/library/chunks/{iframe.duVt7WWc.js → iframe.uLxZ6LsL.js} +1 -1
- package/library/chunks/{image.DdtDzup6.js → image.DKB6yEQO.js} +194 -191
- package/library/chunks/inheritsLoose.BuSn_CvZ.js +27 -0
- package/library/chunks/{cropper.CMfBGsNv.js → jsx-runtime.CTpPVMxj.js} +9462 -10423
- package/library/chunks/{list-editor.31MoHk3A.js → list-editor.CFPfAJpF.js} +87 -86
- package/library/chunks/{option.B6cSZiX6.js → option.BAYtHIvG.js} +1 -1
- package/library/chunks/{pagination.RXrwBaR8.js → pagination.CCJD61IB.js} +4 -4
- package/library/chunks/{resizable-component.styles.sAhMVN1H.js → resizable-component.styles.DpK0TTP5.js} +6 -6
- package/library/chunks/{responsive.Aigicabj.js → responsive.C8NCkfCG.js} +1 -1
- package/library/chunks/{tab-group.BA4PlJhR.js → tab-group.BsR8tdVY.js} +3 -3
- package/library/chunks/{table.Dh2C2f1c.js → table.DL_CEeYh.js} +5 -5
- package/library/chunks/{tree.BO4oLcdB.js → tree.KmZRWZ0F.js} +1 -1
- package/library/components/alert.js +2 -2
- package/library/components/asset-link-format.js +6 -6
- package/library/components/atoms.js +147 -145
- package/library/components/audio.js +3 -3
- package/library/components/border-input-group.js +1 -1
- package/library/components/breadcrumb.js +1 -1
- package/library/components/button.js +2 -2
- package/library/components/color-picker.js +2 -2
- package/library/components/color-swatch-group.js +6 -6
- package/library/components/color-swatch.js +2 -2
- package/library/components/confirm-popover.js +4 -4
- package/library/components/copy-button.js +1 -1
- package/library/components/corner-position-input-group.js +2 -2
- package/library/components/cropper.js +961 -10
- package/library/components/details.js +1 -1
- package/library/components/dialog.js +3 -3
- package/library/components/document-viewer.d.ts +3 -0
- package/library/components/document-viewer.js +17 -0
- package/library/components/dot-pagination.js +2 -2
- package/library/components/drawer.js +2 -2
- package/library/components/dropdown.js +1 -1
- package/library/components/dynamic-select.js +4 -4
- package/library/components/e-chart.js +1 -1
- package/library/components/element-clamp.js +2 -2
- package/library/components/file-on-demand.js +9 -9
- package/library/components/folder-select.js +3 -3
- package/library/components/format-bytes.js +1 -1
- package/library/components/format-date.js +1 -1
- package/library/components/format-number.js +1 -1
- package/library/components/format-time.js +1 -1
- package/library/components/header.js +2 -2
- package/library/components/icon-button.js +2 -2
- package/library/components/iframe.js +2 -2
- package/library/components/image-comparer.js +1 -1
- package/library/components/image.js +3 -3
- package/library/components/input.js +1 -1
- package/library/components/line-clamp.js +1 -1
- package/library/components/list-editor.js +6 -6
- package/library/components/masonry.js +2 -2
- package/library/components/menu-item.js +2 -2
- package/library/components/menu.js +1 -1
- package/library/components/molecules.js +7 -7
- package/library/components/option.js +2 -2
- package/library/components/organisms.js +2 -2
- package/library/components/pagination.js +5 -5
- package/library/components/popup.js +1 -1
- package/library/components/position-picker.js +1 -1
- package/library/components/progress-bar.js +1 -1
- package/library/components/progress-ring.js +1 -1
- package/library/components/range.js +1 -1
- package/library/components/rating.js +1 -1
- package/library/components/relative-time.js +1 -1
- package/library/components/select.js +2 -2
- package/library/components/share-option-list.js +1 -1
- package/library/components/sidebar.js +1 -1
- package/library/components/size-input-group.js +2 -2
- package/library/components/spinner.js +1 -1
- package/library/components/split-panel.js +1 -1
- package/library/components/tab-group.js +4 -4
- package/library/components/tab.js +2 -2
- package/library/components/table.js +5 -5
- package/library/components/tag.js +2 -2
- package/library/components/tooltip.js +1 -1
- package/library/components/tree-item.js +2 -2
- package/library/components/tree.js +2 -2
- package/library/components/typeface.js +2 -2
- package/library/components/types.js +18621 -18774
- package/library/components/video.js +3605 -3625
- package/library/package.json +1 -1
- package/library/packages/atoms/src/components/document-viewer/document-viewer.d.ts +60 -0
- package/library/packages/atoms/src/components/document-viewer/document-viewer.styles.d.ts +2 -0
- package/library/packages/atoms/src/components/image/image.d.ts +1 -0
- package/library/packages/atoms/src/index.d.ts +1 -0
- package/library/packages/events/src/cx-document-viewer-open-asset.d.ts +8 -0
- package/library/packages/events/src/events.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/book-reader/book-reader.d.ts +99 -0
- package/library/packages/hybrid/book-reader/src/book-reader/book-reader.styles.d.ts +2 -0
- package/library/packages/hybrid/book-reader/src/react/BookReader.d.ts +6 -0
- package/library/packages/hybrid/book-reader/src/react/components/Album/Album.d.ts +31 -0
- package/library/packages/hybrid/book-reader/src/react/components/Album/AlbumThumbnails.d.ts +17 -0
- package/library/packages/hybrid/book-reader/src/react/components/Album/ErrorImage.d.ts +5 -0
- package/library/packages/hybrid/book-reader/src/react/components/Album/Page.d.ts +21 -0
- package/library/packages/hybrid/book-reader/src/react/components/Album/index.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/react/components/Book/Book.d.ts +20 -0
- package/library/packages/hybrid/book-reader/src/react/components/Book/BookThumbnails.d.ts +17 -0
- package/library/packages/hybrid/book-reader/src/react/components/Book/Page.d.ts +20 -0
- package/library/packages/hybrid/book-reader/src/react/components/Book/PageError.d.ts +5 -0
- package/library/packages/hybrid/book-reader/src/react/components/Book/PageRenderer/PageRenderer.d.ts +8 -0
- package/library/packages/hybrid/book-reader/src/react/components/Book/PageRenderer/RendererContext.d.ts +5 -0
- package/library/packages/hybrid/book-reader/src/react/components/Book/PageRenderer/StructTree.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/react/components/Book/PageRenderer/StructTreeItem.d.ts +9 -0
- package/library/packages/hybrid/book-reader/src/react/components/Book/PageRenderer/index.d.ts +2 -0
- package/library/packages/hybrid/book-reader/src/react/components/ColdStorageAsset/ColdStorageAsset.d.ts +7 -0
- package/library/packages/hybrid/book-reader/src/react/components/ColdStorageAsset/ColdStorageAsset.styles.d.ts +2 -0
- package/library/packages/hybrid/book-reader/src/react/components/ColdStorageAsset/index.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/react/components/Container/Container.d.ts +7 -0
- package/library/packages/hybrid/book-reader/src/react/components/Container/index.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/react/components/Controller/Controller.d.ts +39 -0
- package/library/packages/hybrid/book-reader/src/react/components/Controller/Controller.styles.d.ts +2 -0
- package/library/packages/hybrid/book-reader/src/react/components/Controller/PageControl.d.ts +12 -0
- package/library/packages/hybrid/book-reader/src/react/components/Controller/ScaleControl.d.ts +10 -0
- package/library/packages/hybrid/book-reader/src/react/components/Controller/ToggleFullscreen.d.ts +7 -0
- package/library/packages/hybrid/book-reader/src/react/components/Controller/ToggleSearchBox.d.ts +7 -0
- package/library/packages/hybrid/book-reader/src/react/components/Controller/ToggleSidebar.d.ts +7 -0
- package/library/packages/hybrid/book-reader/src/react/components/Controller/ViewControl.d.ts +7 -0
- package/library/packages/hybrid/book-reader/src/react/components/Controller/index.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/react/components/Drawer/Drawer.d.ts +9 -0
- package/library/packages/hybrid/book-reader/src/react/components/Drawer/index.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/react/components/EmptyDocument/EmptyDocument.d.ts +2 -0
- package/library/packages/hybrid/book-reader/src/react/components/EmptyDocument/EmptyDocument.styles.d.ts +2 -0
- package/library/packages/hybrid/book-reader/src/react/components/EmptyDocument/index.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/react/components/Loading/DocumentLoading.d.ts +5 -0
- package/library/packages/hybrid/book-reader/src/react/components/Loading/Loading.styles.d.ts +2 -0
- package/library/packages/hybrid/book-reader/src/react/components/Loading/PageLoading.d.ts +5 -0
- package/library/packages/hybrid/book-reader/src/react/components/Loading/index.d.ts +2 -0
- package/library/packages/hybrid/book-reader/src/react/components/PPTProgressBar/PPTProgressBar.d.ts +5 -0
- package/library/packages/hybrid/book-reader/src/react/components/PPTProgressBar/index.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/react/components/PasswordInput/PasswordInput.d.ts +7 -0
- package/library/packages/hybrid/book-reader/src/react/components/PasswordInput/PasswordInput.styles.d.ts +2 -0
- package/library/packages/hybrid/book-reader/src/react/components/PasswordInput/index.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/react/components/ProgressBar/ProgressBar.d.ts +7 -0
- package/library/packages/hybrid/book-reader/src/react/components/ProgressBar/index.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/react/components/ScaleBox/ScaleBox.d.ts +21 -0
- package/library/packages/hybrid/book-reader/src/react/components/SearchBox/SearchBox.d.ts +18 -0
- package/library/packages/hybrid/book-reader/src/react/components/SearchBox/SearchBox.styles.d.ts +2 -0
- package/library/packages/hybrid/book-reader/src/react/components/SearchBox/index.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/react/components/TextHighlight/TextHighlight.d.ts +9 -0
- package/library/packages/hybrid/book-reader/src/react/components/TextHighlight/index.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/react/components/Thumbnails/Thumbnails.d.ts +32 -0
- package/library/packages/hybrid/book-reader/src/react/components/Thumbnails/index.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/react/components/ZoomPanPinchWrapper/ZoomPanPinchWrapper.d.ts +12 -0
- package/library/packages/hybrid/book-reader/src/react/components/ZoomPanPinchWrapper/ZoomPanPinchWrapper.styles.d.ts +2 -0
- package/library/packages/hybrid/book-reader/src/react/components/ZoomPanPinchWrapper/index.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/react/constant.d.ts +81 -0
- package/library/packages/hybrid/book-reader/src/react/contexts/AlbumContext.d.ts +8 -0
- package/library/packages/hybrid/book-reader/src/react/contexts/BookContext.d.ts +4 -0
- package/library/packages/hybrid/book-reader/src/react/contexts/BreakpointsContext.d.ts +4 -0
- package/library/packages/hybrid/book-reader/src/react/contexts/ComponentContext.d.ts +3 -0
- package/library/packages/hybrid/book-reader/src/react/contexts/TranslationContext.d.ts +7 -0
- package/library/packages/hybrid/book-reader/src/react/hooks/useAlbumContext.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/react/hooks/useBookContext.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/react/hooks/useBookEvents.d.ts +13 -0
- package/library/packages/hybrid/book-reader/src/react/hooks/useBreakpoint.d.ts +6 -0
- package/library/packages/hybrid/book-reader/src/react/hooks/useDrawer.d.ts +13 -0
- package/library/packages/hybrid/book-reader/src/react/hooks/useImageTextSearch.d.ts +4 -0
- package/library/packages/hybrid/book-reader/src/react/hooks/useKeyboardShortcuts.d.ts +12 -0
- package/library/packages/hybrid/book-reader/src/react/hooks/usePageFlip.d.ts +10 -0
- package/library/packages/hybrid/book-reader/src/react/hooks/usePdfTextSearch.d.ts +4 -0
- package/library/packages/hybrid/book-reader/src/react/hooks/usePopoverMenu.d.ts +7 -0
- package/library/packages/hybrid/book-reader/src/react/hooks/useRendererContext.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/react/hooks/useResolver.d.ts +21 -0
- package/library/packages/hybrid/book-reader/src/react/hooks/useScale.d.ts +19 -0
- package/library/packages/hybrid/book-reader/src/react/hooks/useSearch.d.ts +19 -0
- package/library/packages/hybrid/book-reader/src/react/page-flip/PageFlip.d.ts +215 -0
- package/library/packages/hybrid/book-reader/src/react/page-flip/Settings.d.ts +59 -0
- package/library/packages/hybrid/book-reader/src/react/page-flip/collection/HTMLPageCollection.d.ts +13 -0
- package/library/packages/hybrid/book-reader/src/react/page-flip/collection/ImagePageCollection.d.ts +12 -0
- package/library/packages/hybrid/book-reader/src/react/page-flip/collection/PageCollection.d.ts +116 -0
- package/library/packages/hybrid/book-reader/src/react/page-flip/event/EventObject.d.ts +34 -0
- package/library/packages/hybrid/book-reader/src/react/page-flip/flip/Flip.d.ts +126 -0
- package/library/packages/hybrid/book-reader/src/react/page-flip/flip/FlipCalculation.d.ts +99 -0
- package/library/packages/hybrid/book-reader/src/react/page-flip/index.d.ts +22 -0
- package/library/packages/hybrid/book-reader/src/react/page-flip/page/HTMLPage.d.ts +24 -0
- package/library/packages/hybrid/book-reader/src/react/page-flip/page/ImagePage.d.ts +19 -0
- package/library/packages/hybrid/book-reader/src/react/page-flip/page/Page.d.ts +123 -0
- package/library/packages/hybrid/book-reader/src/react/page-flip/render/CanvasRender.d.ts +19 -0
- package/library/packages/hybrid/book-reader/src/react/page-flip/render/HTMLRender.d.ts +58 -0
- package/library/packages/hybrid/book-reader/src/react/page-flip/render/Render.d.ts +233 -0
- package/library/packages/hybrid/book-reader/src/react/page-flip/ui/CanvasUI.d.ts +17 -0
- package/library/packages/hybrid/book-reader/src/react/page-flip/ui/HTMLUI.d.ts +19 -0
- package/library/packages/hybrid/book-reader/src/react/page-flip/ui/UI.d.ts +78 -0
- package/library/packages/hybrid/book-reader/src/react/types.d.ts +206 -0
- package/library/packages/hybrid/book-reader/src/react/utils/CalculateScale.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/react/utils/EscapeRegex.d.ts +2 -0
- package/library/packages/hybrid/book-reader/src/react/utils/Fullscreen.d.ts +4 -0
- package/library/packages/hybrid/book-reader/src/react/utils/GetActivePage.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/react/utils/GetIIIFImageUrl.d.ts +7 -0
- package/library/packages/hybrid/book-reader/src/react/utils/GetVisiblePageNumber.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/react/utils/IsImageBook.d.ts +3 -0
- package/library/packages/hybrid/book-reader/src/react/utils/IsPDFBook.d.ts +3 -0
- package/library/packages/hybrid/book-reader/src/react/utils/MergeRefs.d.ts +14 -0
- package/library/packages/hybrid/book-reader/src/react/utils/NormalizeString.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/react/utils/PageFlipGeometry.d.ts +86 -0
- package/library/packages/hybrid/book-reader/src/react/utils/PagePosition.d.ts +2 -0
- package/library/packages/hybrid/book-reader/src/react/utils/PageRendererUtil.d.ts +350 -0
- package/library/packages/hybrid/book-reader/src/react/utils/PdfWorker.d.ts +17 -0
- package/library/packages/hybrid/book-reader/src/react/utils/Random.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/react/utils/RenderingQueue.d.ts +8 -0
- package/library/packages/organisms/src/content-builder/configs/document-viewer.d.ts +24 -0
- package/library/packages/organisms/src/content-builder/configs/index.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs-controller.d.ts +50 -24
- package/library/packages/organisms/src/content-builder/content-builder-config.d.ts +3 -0
- package/library/packages/organisms/src/content-builder/content-builder.d.ts +2 -0
- package/library/packages/organisms/src/content-builder/plugins/document-viewer.d.ts +5 -0
- package/library/packages/organisms/src/content-builder/plugins/index.d.ts +1 -0
- package/library/packages/react-web-component.d.ts +6581 -0
- package/library/packages/types/src/book-reader.d.ts +9 -0
- package/library/packages/types/src/content-builder.d.ts +3 -1
- package/library/packages/utils/src/custom-element/i18n.d.ts +20 -0
- package/library/react-web-component.d.ts +115 -5
- package/library/utils.js +3 -3
- package/package.json +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { PageFlip } from '../PageFlip';
|
|
2
|
+
import { FlipSetting } from '../Settings';
|
|
3
|
+
import { Render } from './Render';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Class responsible for rendering the HTML book
|
|
7
|
+
*/
|
|
8
|
+
export declare class HTMLRender extends Render {
|
|
9
|
+
/** Parent HTML Element */
|
|
10
|
+
private readonly element;
|
|
11
|
+
/** Pages List as HTMLElements */
|
|
12
|
+
private outerShadow;
|
|
13
|
+
private innerShadow;
|
|
14
|
+
private hardShadow;
|
|
15
|
+
private hardInnerShadow;
|
|
16
|
+
/**
|
|
17
|
+
* @constructor
|
|
18
|
+
*
|
|
19
|
+
* @param {PageFlip} app - PageFlip object
|
|
20
|
+
* @param {FlipSetting} setting - Configuration object
|
|
21
|
+
* @param {HTMLElement} element - Parent HTML Element
|
|
22
|
+
*/
|
|
23
|
+
constructor(app: PageFlip, setting: FlipSetting, element: HTMLElement);
|
|
24
|
+
private createShadows;
|
|
25
|
+
clearShadow(): void;
|
|
26
|
+
reload(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Draw inner shadow to the hard page
|
|
29
|
+
*/
|
|
30
|
+
private drawHardInnerShadow;
|
|
31
|
+
/**
|
|
32
|
+
* Draw outer shadow to the hard page
|
|
33
|
+
*/
|
|
34
|
+
private drawHardOuterShadow;
|
|
35
|
+
/**
|
|
36
|
+
* Draw inner shadow to the soft page
|
|
37
|
+
*/
|
|
38
|
+
private drawInnerShadow;
|
|
39
|
+
/**
|
|
40
|
+
* Draw outer shadow to the soft page
|
|
41
|
+
*/
|
|
42
|
+
private drawOuterShadow;
|
|
43
|
+
/**
|
|
44
|
+
* Draw left static page
|
|
45
|
+
*/
|
|
46
|
+
private drawLeftPage;
|
|
47
|
+
/**
|
|
48
|
+
* Draw right static page
|
|
49
|
+
*/
|
|
50
|
+
private drawRightPage;
|
|
51
|
+
/**
|
|
52
|
+
* Draw the next page at the time of flipping
|
|
53
|
+
*/
|
|
54
|
+
private drawBottomPage;
|
|
55
|
+
protected drawFrame(): void;
|
|
56
|
+
private clear;
|
|
57
|
+
update(): void;
|
|
58
|
+
}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { PageRect, Point, RectPoints } from '../BasicTypes';
|
|
2
|
+
import { FlipDirection } from '../flip/Flip';
|
|
3
|
+
import { Page } from '../page/Page';
|
|
4
|
+
import { PageFlip } from '../PageFlip';
|
|
5
|
+
import { FlipSetting } from '../Settings';
|
|
6
|
+
|
|
7
|
+
export type FrameAction = () => void;
|
|
8
|
+
type AnimationSuccessAction = () => void;
|
|
9
|
+
/**
|
|
10
|
+
* Type describing calculated values for drop shadows
|
|
11
|
+
*/
|
|
12
|
+
export type Shadow = {
|
|
13
|
+
/** The angle of the shadows relative to the book */
|
|
14
|
+
angle: number;
|
|
15
|
+
/** Flipping Direction, the direction of the shadow gradients */
|
|
16
|
+
direction: FlipDirection;
|
|
17
|
+
/** Base shadow opacity */
|
|
18
|
+
opacity: number;
|
|
19
|
+
/** Shadow Position Start Point */
|
|
20
|
+
pos: Point;
|
|
21
|
+
/** Flipping progress in percent (0 - 100) */
|
|
22
|
+
progress: number;
|
|
23
|
+
/** Base width shadow */
|
|
24
|
+
width: number;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Type describing the animation process
|
|
28
|
+
* Only one animation process can be started at a same time
|
|
29
|
+
*/
|
|
30
|
+
type AnimationProcess = {
|
|
31
|
+
/** Total animation duration */
|
|
32
|
+
duration: number;
|
|
33
|
+
/** Animation duration of one frame */
|
|
34
|
+
durationFrame: number;
|
|
35
|
+
/** List of frames in playback order. Each frame is a function. */
|
|
36
|
+
frames: FrameAction[];
|
|
37
|
+
/** Сallback at the end of the animation */
|
|
38
|
+
onAnimateEnd: AnimationSuccessAction;
|
|
39
|
+
/** Animation start time (Global Timer) */
|
|
40
|
+
startedAt: number;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Book orientation
|
|
44
|
+
*/
|
|
45
|
+
export declare const enum Orientation {
|
|
46
|
+
LANDSCAPE = "landscape",
|
|
47
|
+
PORTRAIT = "portrait"
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Class responsible for rendering the book
|
|
51
|
+
*/
|
|
52
|
+
export declare abstract class Render {
|
|
53
|
+
protected setting: FlipSetting;
|
|
54
|
+
protected readonly app: PageFlip;
|
|
55
|
+
/** Left static book page */
|
|
56
|
+
protected leftPage: Page | null;
|
|
57
|
+
/** Right static book page */
|
|
58
|
+
protected rightPage: Page | null;
|
|
59
|
+
/** Page currently flipping */
|
|
60
|
+
protected flippingPage: Page | null;
|
|
61
|
+
/** Next page at the time of flipping */
|
|
62
|
+
protected bottomPage: Page | null;
|
|
63
|
+
/** Current flipping direction */
|
|
64
|
+
protected direction: FlipDirection | null;
|
|
65
|
+
/** Current book orientation */
|
|
66
|
+
protected orientation: Orientation | null;
|
|
67
|
+
/** Сurrent state of the shadows */
|
|
68
|
+
protected shadow: Shadow | null;
|
|
69
|
+
/** Сurrent animation process */
|
|
70
|
+
protected animation: AnimationProcess | null;
|
|
71
|
+
/** Page borders while flipping */
|
|
72
|
+
protected pageRect: RectPoints | null;
|
|
73
|
+
/** Current book area */
|
|
74
|
+
private boundsRect;
|
|
75
|
+
private isStop;
|
|
76
|
+
/** Timer started from start of rendering */
|
|
77
|
+
protected timer: number;
|
|
78
|
+
/**
|
|
79
|
+
* Safari browser definitions for resolving a bug with a css property clip-area
|
|
80
|
+
*
|
|
81
|
+
* https://bugs.webkit.org/show_bug.cgi?id=126207
|
|
82
|
+
*/
|
|
83
|
+
private safari;
|
|
84
|
+
protected constructor(app: PageFlip, setting: FlipSetting);
|
|
85
|
+
/**
|
|
86
|
+
* Rendering action on each requestAnimationFrame call. The entire rendering process is performed only in this method
|
|
87
|
+
*/
|
|
88
|
+
protected abstract drawFrame(): void;
|
|
89
|
+
/**
|
|
90
|
+
* Reload the render area, after update pages
|
|
91
|
+
*/
|
|
92
|
+
abstract reload(): void;
|
|
93
|
+
/**
|
|
94
|
+
* Executed when requestAnimationFrame is called. Performs the current animation process and call drawFrame()
|
|
95
|
+
*
|
|
96
|
+
* @param timer
|
|
97
|
+
*/
|
|
98
|
+
render(timer: number): void;
|
|
99
|
+
/**
|
|
100
|
+
* Running requestAnimationFrame, and rendering process
|
|
101
|
+
*/
|
|
102
|
+
start(): void;
|
|
103
|
+
/**
|
|
104
|
+
* Start a new animation process
|
|
105
|
+
*
|
|
106
|
+
* @param {FrameAction[]} frames - Frame list
|
|
107
|
+
* @param {number} duration - total animation duration
|
|
108
|
+
* @param {AnimationSuccessAction} onAnimateEnd - Animation callback function
|
|
109
|
+
*/
|
|
110
|
+
startAnimation(frames: FrameAction[], duration: number, onAnimateEnd: AnimationSuccessAction): void;
|
|
111
|
+
/**
|
|
112
|
+
* End the current animation process and call the callback
|
|
113
|
+
*/
|
|
114
|
+
finishAnimation(): void;
|
|
115
|
+
/**
|
|
116
|
+
* Recalculate the size of the displayed area, and update the page orientation
|
|
117
|
+
*/
|
|
118
|
+
update(): void;
|
|
119
|
+
/**
|
|
120
|
+
* Calculate the size and position of the book depending on the parent element and configuration parameters
|
|
121
|
+
*/
|
|
122
|
+
private calculateBoundsRect;
|
|
123
|
+
/**
|
|
124
|
+
* Set the current parameters of the drop shadow
|
|
125
|
+
*
|
|
126
|
+
* @param {Point} pos - Shadow Position Start Point
|
|
127
|
+
* @param {number} angle - The angle of the shadows relative to the book
|
|
128
|
+
* @param {number} progress - Flipping progress in percent (0 - 100)
|
|
129
|
+
* @param {FlipDirection} direction - Flipping Direction, the direction of the shadow gradients
|
|
130
|
+
*/
|
|
131
|
+
setShadowData(pos: Point, angle: number, progress: number, direction: FlipDirection): void;
|
|
132
|
+
/**
|
|
133
|
+
* Clear shadow
|
|
134
|
+
*/
|
|
135
|
+
clearShadow(): void;
|
|
136
|
+
/**
|
|
137
|
+
* Get parent block offset width
|
|
138
|
+
*/
|
|
139
|
+
getBlockWidth(): number;
|
|
140
|
+
/**
|
|
141
|
+
* Get parent block offset height
|
|
142
|
+
*/
|
|
143
|
+
getBlockHeight(): number;
|
|
144
|
+
/**
|
|
145
|
+
* Get current flipping direction
|
|
146
|
+
*/
|
|
147
|
+
getDirection(): FlipDirection | null;
|
|
148
|
+
/**
|
|
149
|
+
* Сurrent size and position of the book
|
|
150
|
+
*/
|
|
151
|
+
getRect(): PageRect | null;
|
|
152
|
+
/**
|
|
153
|
+
* Get configuration object
|
|
154
|
+
*/
|
|
155
|
+
getSettings(): FlipSetting;
|
|
156
|
+
/**
|
|
157
|
+
* Get current book orientation
|
|
158
|
+
*/
|
|
159
|
+
getOrientation(): Orientation | null;
|
|
160
|
+
/**
|
|
161
|
+
* Set page area while flipping
|
|
162
|
+
*
|
|
163
|
+
* @param direction
|
|
164
|
+
*/
|
|
165
|
+
setPageRect(pageRect: RectPoints): void;
|
|
166
|
+
/**
|
|
167
|
+
* Set flipping direction
|
|
168
|
+
*
|
|
169
|
+
* @param direction
|
|
170
|
+
*/
|
|
171
|
+
setDirection(direction: FlipDirection): void;
|
|
172
|
+
/**
|
|
173
|
+
* Set right static book page
|
|
174
|
+
*
|
|
175
|
+
* @param page
|
|
176
|
+
*/
|
|
177
|
+
setRightPage(page: Page | null): void;
|
|
178
|
+
/**
|
|
179
|
+
* Set left static book page
|
|
180
|
+
* @param page
|
|
181
|
+
*/
|
|
182
|
+
setLeftPage(page: Page | null): void;
|
|
183
|
+
/**
|
|
184
|
+
* Set next page at the time of flipping
|
|
185
|
+
* @param page
|
|
186
|
+
*/
|
|
187
|
+
setBottomPage(page: Page | null): void;
|
|
188
|
+
/**
|
|
189
|
+
* Set currently flipping page
|
|
190
|
+
*
|
|
191
|
+
* @param page
|
|
192
|
+
*/
|
|
193
|
+
setFlippingPage(page: Page | null): void;
|
|
194
|
+
/**
|
|
195
|
+
* Coordinate conversion function. Window coordinates -> to book coordinates
|
|
196
|
+
*
|
|
197
|
+
* @param {Point} pos - Global coordinates relative to the window
|
|
198
|
+
* @returns {Point} Coordinates relative to the book
|
|
199
|
+
*/
|
|
200
|
+
convertToBook(pos: Point): Point;
|
|
201
|
+
isSafari(): boolean;
|
|
202
|
+
/**
|
|
203
|
+
* Coordinate conversion function. Window coordinates -> to current coordinates of the working page
|
|
204
|
+
*
|
|
205
|
+
* @param {Point} pos - Global coordinates relative to the window
|
|
206
|
+
* @param {FlipDirection} direction - Current flipping direction
|
|
207
|
+
*
|
|
208
|
+
* @returns {Point} Coordinates relative to the work page
|
|
209
|
+
*/
|
|
210
|
+
convertToPage(pos: Point, direction?: FlipDirection): Point;
|
|
211
|
+
/**
|
|
212
|
+
* Coordinate conversion function. Coordinates relative to the work page -> Window coordinates
|
|
213
|
+
*
|
|
214
|
+
* @param {Point} pos - Coordinates relative to the work page
|
|
215
|
+
* @param {FlipDirection} direction - Current flipping direction
|
|
216
|
+
*
|
|
217
|
+
* @returns {Point} Global coordinates relative to the window
|
|
218
|
+
*/
|
|
219
|
+
convertToGlobal(pos: Point, direction?: FlipDirection): Point | null;
|
|
220
|
+
/**
|
|
221
|
+
* Casting the coordinates of the corners of the rectangle in the coordinates relative to the window
|
|
222
|
+
*
|
|
223
|
+
* @param {RectPoints} rect - Coordinates of the corners of the rectangle relative to the work page
|
|
224
|
+
* @param {FlipDirection} direction - Current flipping direction
|
|
225
|
+
*
|
|
226
|
+
* @returns {RectPoints} Coordinates of the corners of the rectangle relative to the window
|
|
227
|
+
*/
|
|
228
|
+
convertRectToGlobal(rect: RectPoints, direction?: FlipDirection): RectPoints;
|
|
229
|
+
updateSetting(setting: FlipSetting): void;
|
|
230
|
+
getFlippingPage(): Page | null;
|
|
231
|
+
stop(): void;
|
|
232
|
+
}
|
|
233
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PageFlip } from '../PageFlip';
|
|
2
|
+
import { FlipSetting } from '../Settings';
|
|
3
|
+
import { UI } from './UI';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* UI for canvas mode
|
|
7
|
+
*/
|
|
8
|
+
export declare class CanvasUI extends UI {
|
|
9
|
+
private readonly canvas;
|
|
10
|
+
constructor(inBlock: HTMLElement, app: PageFlip, setting: FlipSetting);
|
|
11
|
+
private resizeCanvas;
|
|
12
|
+
/**
|
|
13
|
+
* Get canvas element
|
|
14
|
+
*/
|
|
15
|
+
getCanvas(): HTMLCanvasElement;
|
|
16
|
+
update(): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PageFlip } from '../PageFlip';
|
|
2
|
+
import { FlipSetting } from '../Settings';
|
|
3
|
+
import { UI } from './UI';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* UI for HTML mode
|
|
7
|
+
*/
|
|
8
|
+
export declare class HTMLUI extends UI {
|
|
9
|
+
private items;
|
|
10
|
+
constructor(inBlock: HTMLElement, app: PageFlip, setting: FlipSetting, items: NodeListOf<HTMLElement> | HTMLElement[]);
|
|
11
|
+
clear(): void;
|
|
12
|
+
/**
|
|
13
|
+
* Update page list from HTMLElements
|
|
14
|
+
*
|
|
15
|
+
* @param {(NodeListOf<HTMLElement>|HTMLElement[])} items - List of pages as HTML Element
|
|
16
|
+
*/
|
|
17
|
+
updateItems(items: NodeListOf<HTMLElement> | HTMLElement[]): void;
|
|
18
|
+
update(): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Point } from '../BasicTypes';
|
|
2
|
+
import { PageFlip } from '../PageFlip';
|
|
3
|
+
import { Orientation } from '../render/Render';
|
|
4
|
+
import { FlipSetting } from '../Settings';
|
|
5
|
+
|
|
6
|
+
export type SwipeData = {
|
|
7
|
+
point: Point;
|
|
8
|
+
time: number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* UI Class, represents work with DOM
|
|
12
|
+
*/
|
|
13
|
+
export declare abstract class UI {
|
|
14
|
+
protected readonly parentElement: HTMLElement;
|
|
15
|
+
protected readonly app: PageFlip;
|
|
16
|
+
protected readonly wrapper: HTMLElement;
|
|
17
|
+
protected distElement: HTMLElement;
|
|
18
|
+
private touchPoint;
|
|
19
|
+
private readonly swipeTimeout;
|
|
20
|
+
private readonly swipeDistance;
|
|
21
|
+
protected inBlock: HTMLElement;
|
|
22
|
+
private onResize;
|
|
23
|
+
/**
|
|
24
|
+
* @constructor
|
|
25
|
+
*
|
|
26
|
+
* @param {HTMLElement} inBlock - Root HTML Element
|
|
27
|
+
* @param {PageFlip} app - PageFlip instanse
|
|
28
|
+
* @param {FlipSetting} setting - Configuration object
|
|
29
|
+
*/
|
|
30
|
+
protected constructor(inBlock: HTMLElement, app: PageFlip, setting: FlipSetting);
|
|
31
|
+
/**
|
|
32
|
+
* Destructor. Remove all HTML elements and all event handlers
|
|
33
|
+
*/
|
|
34
|
+
destroy(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Updating child components when resizing
|
|
37
|
+
*/
|
|
38
|
+
abstract update(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Get parent element for book
|
|
41
|
+
*
|
|
42
|
+
* @returns {HTMLElement}
|
|
43
|
+
*/
|
|
44
|
+
getDistElement(): HTMLElement;
|
|
45
|
+
/**
|
|
46
|
+
* Get wrapper element
|
|
47
|
+
*
|
|
48
|
+
* @returns {HTMLElement}
|
|
49
|
+
*/
|
|
50
|
+
getWrapper(): HTMLElement;
|
|
51
|
+
/**
|
|
52
|
+
* Updates styles and sizes based on book orientation
|
|
53
|
+
*
|
|
54
|
+
* @param {Orientation} orientation - New book orientation
|
|
55
|
+
*/
|
|
56
|
+
setOrientationStyle(orientation: Orientation): void;
|
|
57
|
+
protected removeHandlers(): void;
|
|
58
|
+
protected setHandlers(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Convert global coordinates to relative book coordinates
|
|
61
|
+
*
|
|
62
|
+
* @param x
|
|
63
|
+
* @param y
|
|
64
|
+
*/
|
|
65
|
+
private getMousePos;
|
|
66
|
+
private checkTarget;
|
|
67
|
+
private onMouseDown;
|
|
68
|
+
private onTouchStart;
|
|
69
|
+
private onMouseUp;
|
|
70
|
+
private onMouseMove;
|
|
71
|
+
private onTouchMove;
|
|
72
|
+
private onTouchEnd;
|
|
73
|
+
updateSize(width: number, height: number): void;
|
|
74
|
+
/**
|
|
75
|
+
* Destructor. Remove all HTML elements and all event handlers
|
|
76
|
+
*/
|
|
77
|
+
clear(): void;
|
|
78
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { RenderTask } from 'pdfjs-dist/types/src/display/api.js';
|
|
2
|
+
import { DocumentProps, PageProps } from 'react-pdf';
|
|
3
|
+
import { Localize } from './contexts/TranslationContext';
|
|
4
|
+
|
|
5
|
+
export type Context = {
|
|
6
|
+
bookContext: {
|
|
7
|
+
bookBackground: {
|
|
8
|
+
value: string;
|
|
9
|
+
};
|
|
10
|
+
bookID: {
|
|
11
|
+
value: string;
|
|
12
|
+
};
|
|
13
|
+
bookName: {
|
|
14
|
+
value: string;
|
|
15
|
+
};
|
|
16
|
+
bookReaderMode: {
|
|
17
|
+
value: string;
|
|
18
|
+
};
|
|
19
|
+
isInColdStorage: {
|
|
20
|
+
value: boolean;
|
|
21
|
+
};
|
|
22
|
+
pageNumber: {
|
|
23
|
+
value: number;
|
|
24
|
+
};
|
|
25
|
+
showCover: {
|
|
26
|
+
value: boolean;
|
|
27
|
+
};
|
|
28
|
+
sourceUrl: {
|
|
29
|
+
value: string;
|
|
30
|
+
};
|
|
31
|
+
totalPages: {
|
|
32
|
+
value: number;
|
|
33
|
+
};
|
|
34
|
+
viewMode: {
|
|
35
|
+
value: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
configurationData: {
|
|
39
|
+
darkMode: boolean;
|
|
40
|
+
enableContextMenuGetLink: boolean;
|
|
41
|
+
rangeChunkSize: number;
|
|
42
|
+
};
|
|
43
|
+
fetchCortexApi: (relativeUrl: string, init: any, params?: any) => any;
|
|
44
|
+
fireEvent: (event: string, data: any) => void;
|
|
45
|
+
localize: Localize;
|
|
46
|
+
onClosed: (callback: () => void) => void;
|
|
47
|
+
pdfWorkerUrl?: string;
|
|
48
|
+
sessionID: {
|
|
49
|
+
getEntityId: () => string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export type ParsedContext = {
|
|
53
|
+
bookBackground: string;
|
|
54
|
+
bookID: string;
|
|
55
|
+
bookName: string;
|
|
56
|
+
bookReaderMode: BookReaderMode;
|
|
57
|
+
darkMode: boolean;
|
|
58
|
+
enableContextMenuGetLink: boolean;
|
|
59
|
+
isInColdStorage: boolean;
|
|
60
|
+
localize: Localize;
|
|
61
|
+
pageNumber: number;
|
|
62
|
+
rangeChunkSize: number;
|
|
63
|
+
showCover: boolean;
|
|
64
|
+
sourceUrl: string;
|
|
65
|
+
totalPages: number;
|
|
66
|
+
viewMode: string;
|
|
67
|
+
};
|
|
68
|
+
export type PDFTextMatch = Record<number | string, Array<{
|
|
69
|
+
begin: {
|
|
70
|
+
divIdx: number;
|
|
71
|
+
offset: number;
|
|
72
|
+
};
|
|
73
|
+
end: {
|
|
74
|
+
divIdx: number;
|
|
75
|
+
offset: number;
|
|
76
|
+
};
|
|
77
|
+
matchOrder: number;
|
|
78
|
+
}>>;
|
|
79
|
+
export type TextSearch = {
|
|
80
|
+
caseSensitive: boolean;
|
|
81
|
+
keyword: string;
|
|
82
|
+
matchWord: boolean;
|
|
83
|
+
};
|
|
84
|
+
export type MatchedPosition = {
|
|
85
|
+
index: number;
|
|
86
|
+
length: number;
|
|
87
|
+
matchOrder: number;
|
|
88
|
+
textItemIndex: number;
|
|
89
|
+
};
|
|
90
|
+
export type ResultPage = {
|
|
91
|
+
matchedPositions: MatchedPosition[];
|
|
92
|
+
pageNumber: number;
|
|
93
|
+
};
|
|
94
|
+
export type TextSearchResult = {
|
|
95
|
+
matchesCount: number;
|
|
96
|
+
pages: ResultPage[];
|
|
97
|
+
textSearch: TextSearch;
|
|
98
|
+
};
|
|
99
|
+
type LoadCallback = Required<DocumentProps>['onLoadSuccess'];
|
|
100
|
+
type PageLoadCallback = Required<PageProps>['onLoadSuccess'];
|
|
101
|
+
export type PDFDocumentProxy = Parameters<LoadCallback>[0];
|
|
102
|
+
export type PDFPageProxy = Parameters<PageLoadCallback>[0];
|
|
103
|
+
export type TextItem = {
|
|
104
|
+
dir: string;
|
|
105
|
+
fontName: string;
|
|
106
|
+
hasEOL: boolean;
|
|
107
|
+
height: number;
|
|
108
|
+
itemIndex: number;
|
|
109
|
+
pageIndex: number;
|
|
110
|
+
pageNumber: number;
|
|
111
|
+
str: string;
|
|
112
|
+
transform: number[];
|
|
113
|
+
width: number;
|
|
114
|
+
};
|
|
115
|
+
export type PageView = {
|
|
116
|
+
imageData?: ImageData | null;
|
|
117
|
+
isRendering?: boolean;
|
|
118
|
+
loading: boolean;
|
|
119
|
+
page: PDFPageProxy | null;
|
|
120
|
+
pageID: string;
|
|
121
|
+
pageNumber: number;
|
|
122
|
+
renderTask?: RenderTask | null;
|
|
123
|
+
renderedAt?: number;
|
|
124
|
+
representativeID?: string;
|
|
125
|
+
scale: number;
|
|
126
|
+
visitedAt?: number;
|
|
127
|
+
};
|
|
128
|
+
export type BookContext = {
|
|
129
|
+
onLoadedPDFPageProxy: (page: PDFPageProxy) => void;
|
|
130
|
+
pageViews: {
|
|
131
|
+
[key: number]: PageView;
|
|
132
|
+
};
|
|
133
|
+
requestPDFPageProxy: (pageNumbers: number[]) => void;
|
|
134
|
+
requestRenderPDFPage: (pageNumber: number) => Promise<null | ImageData | undefined>;
|
|
135
|
+
} | null;
|
|
136
|
+
export declare enum BookReaderMode {
|
|
137
|
+
IMAGE = "Image",
|
|
138
|
+
PDF = "Pdf"
|
|
139
|
+
}
|
|
140
|
+
export type SearchQuery = string;
|
|
141
|
+
export type ImageTextPosition = {
|
|
142
|
+
matchOrder: number;
|
|
143
|
+
x1: number;
|
|
144
|
+
x2: number;
|
|
145
|
+
y1: number;
|
|
146
|
+
y2: number;
|
|
147
|
+
};
|
|
148
|
+
export type ImageTextSearchResultPage = {
|
|
149
|
+
matchedPositions: ImageTextPosition[];
|
|
150
|
+
pageNumber: number;
|
|
151
|
+
};
|
|
152
|
+
export type ImageTextSearchResult = {
|
|
153
|
+
matchesCount: number;
|
|
154
|
+
pages: ImageTextSearchResultPage[];
|
|
155
|
+
q: string;
|
|
156
|
+
};
|
|
157
|
+
export type PageCallback = PDFPageProxy & {
|
|
158
|
+
height: number;
|
|
159
|
+
originalHeight: number;
|
|
160
|
+
originalWidth: number;
|
|
161
|
+
width: number;
|
|
162
|
+
};
|
|
163
|
+
export type Asset = {
|
|
164
|
+
hasFormatInColdStorage: boolean;
|
|
165
|
+
height: number;
|
|
166
|
+
imageUrl: string;
|
|
167
|
+
originalUrl: string;
|
|
168
|
+
pageID: string;
|
|
169
|
+
pageName: string;
|
|
170
|
+
pageNumber: number;
|
|
171
|
+
representativeID?: string;
|
|
172
|
+
rotation?: number;
|
|
173
|
+
version?: string;
|
|
174
|
+
width: number;
|
|
175
|
+
};
|
|
176
|
+
export type AssetView = {
|
|
177
|
+
asset: Asset;
|
|
178
|
+
loading: boolean;
|
|
179
|
+
};
|
|
180
|
+
export interface BookHandle {
|
|
181
|
+
changePage: (pageNumber: number) => void;
|
|
182
|
+
}
|
|
183
|
+
export type ImageSearchResponsePar = {
|
|
184
|
+
boxes: Array<{
|
|
185
|
+
b: number;
|
|
186
|
+
l: number;
|
|
187
|
+
page: number;
|
|
188
|
+
r: number;
|
|
189
|
+
t: number;
|
|
190
|
+
}>;
|
|
191
|
+
page: number;
|
|
192
|
+
};
|
|
193
|
+
export type ImageSearchResponse = {
|
|
194
|
+
ia: string;
|
|
195
|
+
indexed: boolean;
|
|
196
|
+
matches: Array<{
|
|
197
|
+
par: ImageSearchResponsePar[];
|
|
198
|
+
text: string;
|
|
199
|
+
}>;
|
|
200
|
+
page_count: number;
|
|
201
|
+
q: string;
|
|
202
|
+
};
|
|
203
|
+
export type BreakpointsContext = {
|
|
204
|
+
containerWidth: number;
|
|
205
|
+
} | null;
|
|
206
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const calculateScale: (parentRect: DOMRect, pageWidth: number, pageHeight: number, viewMode: number, scaleOption: string) => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getActivePage: (page: number, viewMode: number, showCover: boolean) => number[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const getIIIFImageUrl: (urlTemplate: string, width?: number, height?: number, version?: string) => string;
|
|
2
|
+
/**
|
|
3
|
+
* Get IIIF url but specific for GIFs
|
|
4
|
+
* @param urlTemplate
|
|
5
|
+
* @param version
|
|
6
|
+
*/
|
|
7
|
+
export declare const getIIIFImageUrlGif: (urlTemplate: string, version?: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getVisiblePageNumber: (root?: ParentNode | null) => number[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A function that merges React refs into one.
|
|
3
|
+
* Supports both functions and ref objects created using createRef() and useRef().
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* ```tsx
|
|
7
|
+
* <div ref={mergeRefs(ref1, ref2, ref3)} />
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* @param {(React.Ref<T> | undefined)[]} inputRefs Array of refs
|
|
11
|
+
* @returns {React.Ref<T> | React.RefCallback<T>} Merged refs
|
|
12
|
+
*/
|
|
13
|
+
declare function mergeRefs<T>(...inputRefs: Array<React.Ref<T> | undefined>): React.Ref<T> | React.RefCallback<T>;
|
|
14
|
+
export default mergeRefs;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const normalizeString: (str: string) => string;
|