@orangelogic/design-system 2.108.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.
Files changed (227) hide show
  1. package/library/assets/design-system.css +1 -1
  2. package/library/chunks/{asset.BOex8mNF.js → asset.CQrdW8Hz.js} +2 -2
  3. package/library/chunks/{button.BgLgpUch.js → button.i88sSbTZ.js} +1 -1
  4. package/library/chunks/{color-swatch-group.CJR5NTAx.js → color-swatch-group.mIHaCJsh.js} +5 -5
  5. package/library/chunks/{color-swatch.LWXX_hoG.js → color-swatch.D9vkPoV2.js} +1 -1
  6. package/library/chunks/{confirm-popover.BzpCIDBx.js → confirm-popover.UuBhn8GA.js} +3 -3
  7. package/library/chunks/{content-builder.B-bd8FaV.js → content-builder.OsUmm8Wu.js} +15 -15
  8. package/library/chunks/{dialog.BTYaKnFg.js → dialog.Bso6gK-8.js} +2 -2
  9. package/library/chunks/document-viewer.C6eclRvd.js +25232 -0
  10. package/library/chunks/{dot-pagination.Do9tKlWY.js → dot-pagination.CNnUuI-Z.js} +1 -1
  11. package/library/chunks/{file-on-demand.DICkRgvk.js → file-on-demand.Cf2ujTeF.js} +8 -8
  12. package/library/chunks/{folder-select.DLjFwi4I.js → folder-select.ByNUfTia.js} +3 -3
  13. package/library/chunks/{header.CLZWpAF-.js → header.hj2Kw-N7.js} +1 -1
  14. package/library/chunks/{i18n.ju3y72qp.js → i18n.D6AYDPK-.js} +3 -0
  15. package/library/chunks/{icon-button.CLlmo1AF.js → icon-button.ztYU-DHy.js} +1 -1
  16. package/library/chunks/{iframe.CqtDcvOS.js → iframe.uLxZ6LsL.js} +1 -1
  17. package/library/chunks/{image.CfNFiNFB.js → image.DKB6yEQO.js} +187 -187
  18. package/library/chunks/inheritsLoose.BuSn_CvZ.js +27 -0
  19. package/library/chunks/{cropper.CMfBGsNv.js → jsx-runtime.CTpPVMxj.js} +9462 -10423
  20. package/library/chunks/{list-editor.zY8vlbde.js → list-editor.CFPfAJpF.js} +87 -86
  21. package/library/chunks/{option.BOZYPQZH.js → option.BAYtHIvG.js} +1 -1
  22. package/library/chunks/{pagination.BGjp2gVJ.js → pagination.CCJD61IB.js} +4 -4
  23. package/library/chunks/{resizable-component.styles.sAhMVN1H.js → resizable-component.styles.DpK0TTP5.js} +6 -6
  24. package/library/chunks/{responsive.Aigicabj.js → responsive.C8NCkfCG.js} +1 -1
  25. package/library/chunks/{tab-group.hmlZakLy.js → tab-group.BsR8tdVY.js} +3 -3
  26. package/library/chunks/{table.XsBhq1U3.js → table.DL_CEeYh.js} +5 -5
  27. package/library/chunks/{tree.DAhCAxwV.js → tree.KmZRWZ0F.js} +1 -1
  28. package/library/components/alert.js +2 -2
  29. package/library/components/asset-link-format.js +6 -6
  30. package/library/components/atoms.js +147 -145
  31. package/library/components/audio.js +3 -3
  32. package/library/components/border-input-group.js +1 -1
  33. package/library/components/breadcrumb.js +1 -1
  34. package/library/components/button.js +2 -2
  35. package/library/components/color-picker.js +2 -2
  36. package/library/components/color-swatch-group.js +6 -6
  37. package/library/components/color-swatch.js +2 -2
  38. package/library/components/confirm-popover.js +4 -4
  39. package/library/components/copy-button.js +1 -1
  40. package/library/components/corner-position-input-group.js +2 -2
  41. package/library/components/cropper.js +961 -10
  42. package/library/components/details.js +1 -1
  43. package/library/components/dialog.js +3 -3
  44. package/library/components/document-viewer.d.ts +3 -0
  45. package/library/components/document-viewer.js +17 -0
  46. package/library/components/dot-pagination.js +2 -2
  47. package/library/components/drawer.js +2 -2
  48. package/library/components/dropdown.js +1 -1
  49. package/library/components/dynamic-select.js +4 -4
  50. package/library/components/e-chart.js +1 -1
  51. package/library/components/element-clamp.js +2 -2
  52. package/library/components/file-on-demand.js +9 -9
  53. package/library/components/folder-select.js +3 -3
  54. package/library/components/format-bytes.js +1 -1
  55. package/library/components/format-date.js +1 -1
  56. package/library/components/format-number.js +1 -1
  57. package/library/components/format-time.js +1 -1
  58. package/library/components/header.js +2 -2
  59. package/library/components/icon-button.js +2 -2
  60. package/library/components/iframe.js +2 -2
  61. package/library/components/image-comparer.js +1 -1
  62. package/library/components/image.js +3 -3
  63. package/library/components/input.js +1 -1
  64. package/library/components/line-clamp.js +1 -1
  65. package/library/components/list-editor.js +6 -6
  66. package/library/components/masonry.js +2 -2
  67. package/library/components/menu-item.js +1 -1
  68. package/library/components/menu.js +1 -1
  69. package/library/components/molecules.js +7 -7
  70. package/library/components/option.js +2 -2
  71. package/library/components/organisms.js +2 -2
  72. package/library/components/pagination.js +5 -5
  73. package/library/components/popup.js +1 -1
  74. package/library/components/position-picker.js +1 -1
  75. package/library/components/progress-bar.js +1 -1
  76. package/library/components/progress-ring.js +1 -1
  77. package/library/components/range.js +1 -1
  78. package/library/components/rating.js +1 -1
  79. package/library/components/relative-time.js +1 -1
  80. package/library/components/select.js +2 -2
  81. package/library/components/share-option-list.js +1 -1
  82. package/library/components/sidebar.js +1 -1
  83. package/library/components/size-input-group.js +2 -2
  84. package/library/components/spinner.js +1 -1
  85. package/library/components/split-panel.js +1 -1
  86. package/library/components/tab-group.js +4 -4
  87. package/library/components/tab.js +2 -2
  88. package/library/components/table.js +5 -5
  89. package/library/components/tag.js +2 -2
  90. package/library/components/tooltip.js +1 -1
  91. package/library/components/tree-item.js +2 -2
  92. package/library/components/tree.js +2 -2
  93. package/library/components/typeface.js +2 -2
  94. package/library/components/types.js +17110 -17307
  95. package/library/components/video.js +3605 -3625
  96. package/library/package.json +1 -1
  97. package/library/packages/atoms/src/components/document-viewer/document-viewer.d.ts +60 -0
  98. package/library/packages/atoms/src/components/document-viewer/document-viewer.styles.d.ts +2 -0
  99. package/library/packages/atoms/src/index.d.ts +1 -0
  100. package/library/packages/events/src/cx-document-viewer-open-asset.d.ts +8 -0
  101. package/library/packages/events/src/events.d.ts +1 -0
  102. package/library/packages/hybrid/book-reader/src/book-reader/book-reader.d.ts +99 -0
  103. package/library/packages/hybrid/book-reader/src/book-reader/book-reader.styles.d.ts +2 -0
  104. package/library/packages/hybrid/book-reader/src/react/BookReader.d.ts +6 -0
  105. package/library/packages/hybrid/book-reader/src/react/components/Album/Album.d.ts +31 -0
  106. package/library/packages/hybrid/book-reader/src/react/components/Album/AlbumThumbnails.d.ts +17 -0
  107. package/library/packages/hybrid/book-reader/src/react/components/Album/ErrorImage.d.ts +5 -0
  108. package/library/packages/hybrid/book-reader/src/react/components/Album/Page.d.ts +21 -0
  109. package/library/packages/hybrid/book-reader/src/react/components/Album/index.d.ts +1 -0
  110. package/library/packages/hybrid/book-reader/src/react/components/Book/Book.d.ts +20 -0
  111. package/library/packages/hybrid/book-reader/src/react/components/Book/BookThumbnails.d.ts +17 -0
  112. package/library/packages/hybrid/book-reader/src/react/components/Book/Page.d.ts +20 -0
  113. package/library/packages/hybrid/book-reader/src/react/components/Book/PageError.d.ts +5 -0
  114. package/library/packages/hybrid/book-reader/src/react/components/Book/PageRenderer/PageRenderer.d.ts +8 -0
  115. package/library/packages/hybrid/book-reader/src/react/components/Book/PageRenderer/RendererContext.d.ts +5 -0
  116. package/library/packages/hybrid/book-reader/src/react/components/Book/PageRenderer/StructTree.d.ts +1 -0
  117. package/library/packages/hybrid/book-reader/src/react/components/Book/PageRenderer/StructTreeItem.d.ts +9 -0
  118. package/library/packages/hybrid/book-reader/src/react/components/Book/PageRenderer/index.d.ts +2 -0
  119. package/library/packages/hybrid/book-reader/src/react/components/ColdStorageAsset/ColdStorageAsset.d.ts +7 -0
  120. package/library/packages/hybrid/book-reader/src/react/components/ColdStorageAsset/ColdStorageAsset.styles.d.ts +2 -0
  121. package/library/packages/hybrid/book-reader/src/react/components/ColdStorageAsset/index.d.ts +1 -0
  122. package/library/packages/hybrid/book-reader/src/react/components/Container/Container.d.ts +7 -0
  123. package/library/packages/hybrid/book-reader/src/react/components/Container/index.d.ts +1 -0
  124. package/library/packages/hybrid/book-reader/src/react/components/Controller/Controller.d.ts +39 -0
  125. package/library/packages/hybrid/book-reader/src/react/components/Controller/Controller.styles.d.ts +2 -0
  126. package/library/packages/hybrid/book-reader/src/react/components/Controller/PageControl.d.ts +12 -0
  127. package/library/packages/hybrid/book-reader/src/react/components/Controller/ScaleControl.d.ts +10 -0
  128. package/library/packages/hybrid/book-reader/src/react/components/Controller/ToggleFullscreen.d.ts +7 -0
  129. package/library/packages/hybrid/book-reader/src/react/components/Controller/ToggleSearchBox.d.ts +7 -0
  130. package/library/packages/hybrid/book-reader/src/react/components/Controller/ToggleSidebar.d.ts +7 -0
  131. package/library/packages/hybrid/book-reader/src/react/components/Controller/ViewControl.d.ts +7 -0
  132. package/library/packages/hybrid/book-reader/src/react/components/Controller/index.d.ts +1 -0
  133. package/library/packages/hybrid/book-reader/src/react/components/Drawer/Drawer.d.ts +9 -0
  134. package/library/packages/hybrid/book-reader/src/react/components/Drawer/index.d.ts +1 -0
  135. package/library/packages/hybrid/book-reader/src/react/components/EmptyDocument/EmptyDocument.d.ts +2 -0
  136. package/library/packages/hybrid/book-reader/src/react/components/EmptyDocument/EmptyDocument.styles.d.ts +2 -0
  137. package/library/packages/hybrid/book-reader/src/react/components/EmptyDocument/index.d.ts +1 -0
  138. package/library/packages/hybrid/book-reader/src/react/components/Loading/DocumentLoading.d.ts +5 -0
  139. package/library/packages/hybrid/book-reader/src/react/components/Loading/Loading.styles.d.ts +2 -0
  140. package/library/packages/hybrid/book-reader/src/react/components/Loading/PageLoading.d.ts +5 -0
  141. package/library/packages/hybrid/book-reader/src/react/components/Loading/index.d.ts +2 -0
  142. package/library/packages/hybrid/book-reader/src/react/components/PPTProgressBar/PPTProgressBar.d.ts +5 -0
  143. package/library/packages/hybrid/book-reader/src/react/components/PPTProgressBar/index.d.ts +1 -0
  144. package/library/packages/hybrid/book-reader/src/react/components/PasswordInput/PasswordInput.d.ts +7 -0
  145. package/library/packages/hybrid/book-reader/src/react/components/PasswordInput/PasswordInput.styles.d.ts +2 -0
  146. package/library/packages/hybrid/book-reader/src/react/components/PasswordInput/index.d.ts +1 -0
  147. package/library/packages/hybrid/book-reader/src/react/components/ProgressBar/ProgressBar.d.ts +7 -0
  148. package/library/packages/hybrid/book-reader/src/react/components/ProgressBar/index.d.ts +1 -0
  149. package/library/packages/hybrid/book-reader/src/react/components/ScaleBox/ScaleBox.d.ts +21 -0
  150. package/library/packages/hybrid/book-reader/src/react/components/SearchBox/SearchBox.d.ts +18 -0
  151. package/library/packages/hybrid/book-reader/src/react/components/SearchBox/SearchBox.styles.d.ts +2 -0
  152. package/library/packages/hybrid/book-reader/src/react/components/SearchBox/index.d.ts +1 -0
  153. package/library/packages/hybrid/book-reader/src/react/components/TextHighlight/TextHighlight.d.ts +9 -0
  154. package/library/packages/hybrid/book-reader/src/react/components/TextHighlight/index.d.ts +1 -0
  155. package/library/packages/hybrid/book-reader/src/react/components/Thumbnails/Thumbnails.d.ts +32 -0
  156. package/library/packages/hybrid/book-reader/src/react/components/Thumbnails/index.d.ts +1 -0
  157. package/library/packages/hybrid/book-reader/src/react/components/ZoomPanPinchWrapper/ZoomPanPinchWrapper.d.ts +12 -0
  158. package/library/packages/hybrid/book-reader/src/react/components/ZoomPanPinchWrapper/ZoomPanPinchWrapper.styles.d.ts +2 -0
  159. package/library/packages/hybrid/book-reader/src/react/components/ZoomPanPinchWrapper/index.d.ts +1 -0
  160. package/library/packages/hybrid/book-reader/src/react/constant.d.ts +81 -0
  161. package/library/packages/hybrid/book-reader/src/react/contexts/AlbumContext.d.ts +8 -0
  162. package/library/packages/hybrid/book-reader/src/react/contexts/BookContext.d.ts +4 -0
  163. package/library/packages/hybrid/book-reader/src/react/contexts/BreakpointsContext.d.ts +4 -0
  164. package/library/packages/hybrid/book-reader/src/react/contexts/ComponentContext.d.ts +3 -0
  165. package/library/packages/hybrid/book-reader/src/react/contexts/TranslationContext.d.ts +7 -0
  166. package/library/packages/hybrid/book-reader/src/react/hooks/useAlbumContext.d.ts +1 -0
  167. package/library/packages/hybrid/book-reader/src/react/hooks/useBookContext.d.ts +1 -0
  168. package/library/packages/hybrid/book-reader/src/react/hooks/useBookEvents.d.ts +13 -0
  169. package/library/packages/hybrid/book-reader/src/react/hooks/useBreakpoint.d.ts +6 -0
  170. package/library/packages/hybrid/book-reader/src/react/hooks/useDrawer.d.ts +13 -0
  171. package/library/packages/hybrid/book-reader/src/react/hooks/useImageTextSearch.d.ts +4 -0
  172. package/library/packages/hybrid/book-reader/src/react/hooks/useKeyboardShortcuts.d.ts +12 -0
  173. package/library/packages/hybrid/book-reader/src/react/hooks/usePageFlip.d.ts +10 -0
  174. package/library/packages/hybrid/book-reader/src/react/hooks/usePdfTextSearch.d.ts +4 -0
  175. package/library/packages/hybrid/book-reader/src/react/hooks/usePopoverMenu.d.ts +7 -0
  176. package/library/packages/hybrid/book-reader/src/react/hooks/useRendererContext.d.ts +1 -0
  177. package/library/packages/hybrid/book-reader/src/react/hooks/useResolver.d.ts +21 -0
  178. package/library/packages/hybrid/book-reader/src/react/hooks/useScale.d.ts +19 -0
  179. package/library/packages/hybrid/book-reader/src/react/hooks/useSearch.d.ts +19 -0
  180. package/library/packages/hybrid/book-reader/src/react/page-flip/PageFlip.d.ts +215 -0
  181. package/library/packages/hybrid/book-reader/src/react/page-flip/Settings.d.ts +59 -0
  182. package/library/packages/hybrid/book-reader/src/react/page-flip/collection/HTMLPageCollection.d.ts +13 -0
  183. package/library/packages/hybrid/book-reader/src/react/page-flip/collection/ImagePageCollection.d.ts +12 -0
  184. package/library/packages/hybrid/book-reader/src/react/page-flip/collection/PageCollection.d.ts +116 -0
  185. package/library/packages/hybrid/book-reader/src/react/page-flip/event/EventObject.d.ts +34 -0
  186. package/library/packages/hybrid/book-reader/src/react/page-flip/flip/Flip.d.ts +126 -0
  187. package/library/packages/hybrid/book-reader/src/react/page-flip/flip/FlipCalculation.d.ts +99 -0
  188. package/library/packages/hybrid/book-reader/src/react/page-flip/index.d.ts +22 -0
  189. package/library/packages/hybrid/book-reader/src/react/page-flip/page/HTMLPage.d.ts +24 -0
  190. package/library/packages/hybrid/book-reader/src/react/page-flip/page/ImagePage.d.ts +19 -0
  191. package/library/packages/hybrid/book-reader/src/react/page-flip/page/Page.d.ts +123 -0
  192. package/library/packages/hybrid/book-reader/src/react/page-flip/render/CanvasRender.d.ts +19 -0
  193. package/library/packages/hybrid/book-reader/src/react/page-flip/render/HTMLRender.d.ts +58 -0
  194. package/library/packages/hybrid/book-reader/src/react/page-flip/render/Render.d.ts +233 -0
  195. package/library/packages/hybrid/book-reader/src/react/page-flip/ui/CanvasUI.d.ts +17 -0
  196. package/library/packages/hybrid/book-reader/src/react/page-flip/ui/HTMLUI.d.ts +19 -0
  197. package/library/packages/hybrid/book-reader/src/react/page-flip/ui/UI.d.ts +78 -0
  198. package/library/packages/hybrid/book-reader/src/react/types.d.ts +206 -0
  199. package/library/packages/hybrid/book-reader/src/react/utils/CalculateScale.d.ts +1 -0
  200. package/library/packages/hybrid/book-reader/src/react/utils/EscapeRegex.d.ts +2 -0
  201. package/library/packages/hybrid/book-reader/src/react/utils/Fullscreen.d.ts +4 -0
  202. package/library/packages/hybrid/book-reader/src/react/utils/GetActivePage.d.ts +1 -0
  203. package/library/packages/hybrid/book-reader/src/react/utils/GetIIIFImageUrl.d.ts +7 -0
  204. package/library/packages/hybrid/book-reader/src/react/utils/GetVisiblePageNumber.d.ts +1 -0
  205. package/library/packages/hybrid/book-reader/src/react/utils/IsImageBook.d.ts +3 -0
  206. package/library/packages/hybrid/book-reader/src/react/utils/IsPDFBook.d.ts +3 -0
  207. package/library/packages/hybrid/book-reader/src/react/utils/MergeRefs.d.ts +14 -0
  208. package/library/packages/hybrid/book-reader/src/react/utils/NormalizeString.d.ts +1 -0
  209. package/library/packages/hybrid/book-reader/src/react/utils/PageFlipGeometry.d.ts +86 -0
  210. package/library/packages/hybrid/book-reader/src/react/utils/PagePosition.d.ts +2 -0
  211. package/library/packages/hybrid/book-reader/src/react/utils/PageRendererUtil.d.ts +350 -0
  212. package/library/packages/hybrid/book-reader/src/react/utils/PdfWorker.d.ts +17 -0
  213. package/library/packages/hybrid/book-reader/src/react/utils/Random.d.ts +1 -0
  214. package/library/packages/hybrid/book-reader/src/react/utils/RenderingQueue.d.ts +8 -0
  215. package/library/packages/organisms/src/content-builder/configs/document-viewer.d.ts +24 -0
  216. package/library/packages/organisms/src/content-builder/configs/index.d.ts +1 -0
  217. package/library/packages/organisms/src/content-builder/configs-controller.d.ts +50 -24
  218. package/library/packages/organisms/src/content-builder/content-builder-config.d.ts +3 -0
  219. package/library/packages/organisms/src/content-builder/plugins/document-viewer.d.ts +5 -0
  220. package/library/packages/organisms/src/content-builder/plugins/index.d.ts +1 -0
  221. package/library/packages/react-web-component.d.ts +6581 -0
  222. package/library/packages/types/src/book-reader.d.ts +9 -0
  223. package/library/packages/types/src/content-builder.d.ts +3 -1
  224. package/library/packages/utils/src/custom-element/i18n.d.ts +3 -0
  225. package/library/react-web-component.d.ts +110 -4
  226. package/library/utils.js +3 -3
  227. 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,2 @@
1
+ declare const escapeRegex: (str: string) => string;
2
+ export default escapeRegex;
@@ -0,0 +1,4 @@
1
+ export declare const requestFullscreen: (element?: HTMLElement) => void;
2
+ export declare const isFullscreen: () => any;
3
+ export declare const exitFullscreen: () => void;
4
+ export declare const isFullscreenEnabled: () => boolean;
@@ -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,3 @@
1
+ import { BookReaderMode } from '../types';
2
+
3
+ export declare const isImageBook: (bookMode: BookReaderMode) => bookMode is BookReaderMode.IMAGE;
@@ -0,0 +1,3 @@
1
+ import { BookReaderMode } from '../types';
2
+
3
+ export declare const isPDFBook: (bookMode: BookReaderMode) => bookMode is BookReaderMode.PDF;
@@ -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;