@osdk/react-components 0.2.0-beta.19 → 0.2.0-beta.20

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 (316) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/build/browser/action-form/ActionForm.js +5 -1
  3. package/build/browser/action-form/ActionForm.js.map +1 -1
  4. package/build/browser/action-form/BaseForm.js +4 -8
  5. package/build/browser/action-form/BaseForm.js.map +1 -1
  6. package/build/browser/action-form/FormFieldApi.js.map +1 -1
  7. package/build/browser/action-form/fields/DropdownField.js +104 -0
  8. package/build/browser/action-form/fields/DropdownField.js.map +1 -0
  9. package/build/browser/action-form/fields/FormFieldRenderer.js +23 -12
  10. package/build/browser/action-form/fields/FormFieldRenderer.js.map +1 -1
  11. package/build/browser/action-form/fields/TextInputField.js +8 -9
  12. package/build/browser/action-form/fields/TextInputField.js.map +1 -1
  13. package/build/browser/base-components/combobox/Combobox.js +25 -3
  14. package/build/browser/base-components/combobox/Combobox.js.map +1 -1
  15. package/build/browser/base-components/combobox/Combobox.module.css +226 -46
  16. package/build/browser/base-components/combobox/Combobox.module.css.js +1 -0
  17. package/build/browser/base-components/select/Select.js +7 -1
  18. package/build/browser/base-components/select/Select.js.map +1 -1
  19. package/build/browser/base-components/select/Select.module.css +132 -35
  20. package/build/browser/base-components/select/Select.module.css.js +2 -0
  21. package/build/browser/base-components/skeleton/SkeletonBar.js +36 -0
  22. package/build/browser/base-components/skeleton/SkeletonBar.js.map +1 -0
  23. package/build/browser/base-components/skeleton/SkeletonBar.module.css +39 -0
  24. package/build/browser/base-components/skeleton/SkeletonBar.module.css.js +7 -0
  25. package/build/browser/filter-list/FilterList.js +42 -5
  26. package/build/browser/filter-list/FilterList.js.map +1 -1
  27. package/build/browser/filter-list/FilterListApi.js.map +1 -1
  28. package/build/browser/filter-list/base/AddFilterPopover.js +45 -0
  29. package/build/browser/filter-list/base/AddFilterPopover.js.map +1 -0
  30. package/build/browser/filter-list/base/AddFilterPopover.module.css +83 -0
  31. package/build/browser/filter-list/base/AddFilterPopover.module.css.js +9 -0
  32. package/build/browser/filter-list/base/inputs/CheckboxListInput.js +16 -27
  33. package/build/browser/filter-list/base/inputs/CheckboxListInput.js.map +1 -1
  34. package/build/browser/filter-list/base/inputs/CheckboxListInput.module.css +15 -5
  35. package/build/browser/filter-list/base/inputs/CheckboxListSkeleton.js +46 -0
  36. package/build/browser/filter-list/base/inputs/CheckboxListSkeleton.js.map +1 -0
  37. package/build/browser/filter-list/base/inputs/CheckboxListSkeleton.module.css +32 -0
  38. package/build/browser/filter-list/base/inputs/CheckboxListSkeleton.module.css.js +8 -0
  39. package/build/browser/filter-list/base/inputs/ListogramInput.js +21 -12
  40. package/build/browser/filter-list/base/inputs/ListogramInput.js.map +1 -1
  41. package/build/browser/filter-list/base/inputs/ListogramInput.module.css +13 -1
  42. package/build/browser/filter-list/base/inputs/ListogramSkeleton.js +45 -0
  43. package/build/browser/filter-list/base/inputs/ListogramSkeleton.js.map +1 -0
  44. package/build/browser/filter-list/base/inputs/ListogramSkeleton.module.css +32 -0
  45. package/build/browser/filter-list/base/inputs/ListogramSkeleton.module.css.js +8 -0
  46. package/build/browser/filter-list/base/inputs/MultiSelectInput.js +1 -1
  47. package/build/browser/filter-list/base/inputs/MultiSelectInput.js.map +1 -1
  48. package/build/browser/filter-list/base/inputs/RangeInput.js +13 -13
  49. package/build/browser/filter-list/base/inputs/RangeInput.js.map +1 -1
  50. package/build/browser/filter-list/base/inputs/RangeInput.module.css +23 -0
  51. package/build/browser/filter-list/base/inputs/TextTagsInput.js +1 -1
  52. package/build/browser/filter-list/base/inputs/TextTagsInput.js.map +1 -1
  53. package/build/browser/filter-list/base/inputs/useStaleData.js +29 -0
  54. package/build/browser/filter-list/base/inputs/useStaleData.js.map +1 -0
  55. package/build/browser/filter-list/hooks/useFilterVisibility.js +68 -0
  56. package/build/browser/filter-list/hooks/useFilterVisibility.js.map +1 -0
  57. package/build/browser/object-table/DefaultCellRenderer.js +13 -3
  58. package/build/browser/object-table/DefaultCellRenderer.js.map +1 -1
  59. package/build/browser/object-table/EditableCell.js +7 -6
  60. package/build/browser/object-table/EditableCell.js.map +1 -1
  61. package/build/browser/object-table/LoadingCell.js +6 -3
  62. package/build/browser/object-table/LoadingCell.js.map +1 -1
  63. package/build/browser/object-table/LoadingRow.js +2 -1
  64. package/build/browser/object-table/LoadingRow.js.map +1 -1
  65. package/build/browser/object-table/ObjectTableApi.js.map +1 -1
  66. package/build/browser/object-table/Table.js.map +1 -1
  67. package/build/browser/object-table/TableCell.module.css +1 -0
  68. package/build/browser/object-table/components/AsyncValueCell.js +35 -0
  69. package/build/browser/object-table/components/AsyncValueCell.js.map +1 -0
  70. package/build/browser/object-table/hooks/useColumnDefs.js +3 -1
  71. package/build/browser/object-table/hooks/useColumnDefs.js.map +1 -1
  72. package/build/browser/object-table/hooks/useFunctionColumnsData.js +270 -0
  73. package/build/browser/object-table/hooks/useFunctionColumnsData.js.map +1 -0
  74. package/build/browser/object-table/hooks/useObjectTableData.js +34 -13
  75. package/build/browser/object-table/hooks/useObjectTableData.js.map +1 -1
  76. package/build/browser/object-table/utils/AsyncCellData.js +30 -0
  77. package/build/browser/object-table/utils/AsyncCellData.js.map +1 -0
  78. package/build/browser/object-table/utils/constants.js +1 -0
  79. package/build/browser/object-table/utils/constants.js.map +1 -1
  80. package/build/browser/pdf-viewer/PdfRenderer.js +88 -0
  81. package/build/browser/pdf-viewer/PdfRenderer.js.map +1 -0
  82. package/build/browser/pdf-viewer/PdfViewer.js +197 -0
  83. package/build/browser/pdf-viewer/PdfViewer.js.map +1 -0
  84. package/build/browser/pdf-viewer/PdfViewer.module.css +95 -0
  85. package/build/browser/pdf-viewer/PdfViewer.module.css.js +16 -0
  86. package/build/browser/pdf-viewer/PdfViewerAnnotationLayer.js +74 -0
  87. package/build/browser/pdf-viewer/PdfViewerAnnotationLayer.js.map +1 -0
  88. package/build/browser/pdf-viewer/PdfViewerAnnotationLayer.module.css +65 -0
  89. package/build/browser/pdf-viewer/PdfViewerAnnotationLayer.module.css.js +11 -0
  90. package/build/browser/pdf-viewer/PdfViewerSearchBar.js +84 -0
  91. package/build/browser/pdf-viewer/PdfViewerSearchBar.js.map +1 -0
  92. package/build/browser/pdf-viewer/PdfViewerSearchBar.module.css +65 -0
  93. package/build/browser/pdf-viewer/PdfViewerSearchBar.module.css.js +10 -0
  94. package/build/browser/pdf-viewer/PdfViewerSidebar.js +74 -0
  95. package/build/browser/pdf-viewer/PdfViewerSidebar.js.map +1 -0
  96. package/build/browser/pdf-viewer/PdfViewerSidebar.module.css +46 -0
  97. package/build/browser/pdf-viewer/PdfViewerSidebar.module.css.js +11 -0
  98. package/build/browser/pdf-viewer/PdfViewerThumbnail.js +100 -0
  99. package/build/browser/pdf-viewer/PdfViewerThumbnail.js.map +1 -0
  100. package/build/browser/pdf-viewer/PdfViewerThumbnail.module.css +26 -0
  101. package/build/browser/pdf-viewer/PdfViewerThumbnail.module.css.js +8 -0
  102. package/build/browser/pdf-viewer/PdfViewerToolbar.js +167 -0
  103. package/build/browser/pdf-viewer/PdfViewerToolbar.js.map +1 -0
  104. package/build/browser/pdf-viewer/PdfViewerToolbar.module.css +86 -0
  105. package/build/browser/pdf-viewer/PdfViewerToolbar.module.css.js +12 -0
  106. package/build/browser/pdf-viewer/constants.js +43 -0
  107. package/build/browser/pdf-viewer/constants.js.map +1 -0
  108. package/build/browser/pdf-viewer/hooks/usePdfAnnotationPortals.js +54 -0
  109. package/build/browser/pdf-viewer/hooks/usePdfAnnotationPortals.js.map +1 -0
  110. package/build/browser/pdf-viewer/hooks/usePdfDocument.js +67 -0
  111. package/build/browser/pdf-viewer/hooks/usePdfDocument.js.map +1 -0
  112. package/build/browser/pdf-viewer/hooks/usePdfViewer.js +69 -0
  113. package/build/browser/pdf-viewer/hooks/usePdfViewer.js.map +1 -0
  114. package/build/browser/pdf-viewer/hooks/usePdfViewerSearch.js +106 -0
  115. package/build/browser/pdf-viewer/hooks/usePdfViewerSearch.js.map +1 -0
  116. package/build/browser/pdf-viewer/hooks/usePdfViewerSync.js +71 -0
  117. package/build/browser/pdf-viewer/hooks/usePdfViewerSync.js.map +1 -0
  118. package/build/browser/pdf-viewer/types.js +2 -0
  119. package/build/browser/pdf-viewer/types.js.map +1 -0
  120. package/build/browser/public/experimental.js +4 -0
  121. package/build/browser/public/experimental.js.map +1 -1
  122. package/build/browser/styles.css +1008 -87
  123. package/build/cjs/public/experimental.cjs +2311 -895
  124. package/build/cjs/public/experimental.cjs.map +1 -1
  125. package/build/cjs/public/experimental.css +678 -153
  126. package/build/cjs/public/experimental.css.map +1 -1
  127. package/build/cjs/public/experimental.d.cts +114 -13
  128. package/build/esm/action-form/ActionForm.js +5 -1
  129. package/build/esm/action-form/ActionForm.js.map +1 -1
  130. package/build/esm/action-form/BaseForm.js +4 -8
  131. package/build/esm/action-form/BaseForm.js.map +1 -1
  132. package/build/esm/action-form/FormFieldApi.js.map +1 -1
  133. package/build/esm/action-form/fields/DropdownField.js +104 -0
  134. package/build/esm/action-form/fields/DropdownField.js.map +1 -0
  135. package/build/esm/action-form/fields/FormFieldRenderer.js +23 -12
  136. package/build/esm/action-form/fields/FormFieldRenderer.js.map +1 -1
  137. package/build/esm/action-form/fields/TextInputField.js +8 -9
  138. package/build/esm/action-form/fields/TextInputField.js.map +1 -1
  139. package/build/esm/base-components/combobox/Combobox.js +25 -3
  140. package/build/esm/base-components/combobox/Combobox.js.map +1 -1
  141. package/build/esm/base-components/combobox/Combobox.module.css +226 -46
  142. package/build/esm/base-components/select/Select.js +7 -1
  143. package/build/esm/base-components/select/Select.js.map +1 -1
  144. package/build/esm/base-components/select/Select.module.css +132 -35
  145. package/build/esm/base-components/skeleton/SkeletonBar.js +36 -0
  146. package/build/esm/base-components/skeleton/SkeletonBar.js.map +1 -0
  147. package/build/esm/base-components/skeleton/SkeletonBar.module.css +39 -0
  148. package/build/esm/filter-list/FilterList.js +42 -5
  149. package/build/esm/filter-list/FilterList.js.map +1 -1
  150. package/build/esm/filter-list/FilterListApi.js.map +1 -1
  151. package/build/esm/filter-list/base/AddFilterPopover.js +45 -0
  152. package/build/esm/filter-list/base/AddFilterPopover.js.map +1 -0
  153. package/build/esm/filter-list/base/AddFilterPopover.module.css +83 -0
  154. package/build/esm/filter-list/base/inputs/CheckboxListInput.js +16 -27
  155. package/build/esm/filter-list/base/inputs/CheckboxListInput.js.map +1 -1
  156. package/build/esm/filter-list/base/inputs/CheckboxListInput.module.css +15 -5
  157. package/build/esm/filter-list/base/inputs/CheckboxListSkeleton.js +46 -0
  158. package/build/esm/filter-list/base/inputs/CheckboxListSkeleton.js.map +1 -0
  159. package/build/esm/filter-list/base/inputs/CheckboxListSkeleton.module.css +32 -0
  160. package/build/esm/filter-list/base/inputs/ListogramInput.js +21 -12
  161. package/build/esm/filter-list/base/inputs/ListogramInput.js.map +1 -1
  162. package/build/esm/filter-list/base/inputs/ListogramInput.module.css +13 -1
  163. package/build/esm/filter-list/base/inputs/ListogramSkeleton.js +45 -0
  164. package/build/esm/filter-list/base/inputs/ListogramSkeleton.js.map +1 -0
  165. package/build/esm/filter-list/base/inputs/ListogramSkeleton.module.css +32 -0
  166. package/build/esm/filter-list/base/inputs/MultiSelectInput.js +1 -1
  167. package/build/esm/filter-list/base/inputs/MultiSelectInput.js.map +1 -1
  168. package/build/esm/filter-list/base/inputs/RangeInput.js +13 -13
  169. package/build/esm/filter-list/base/inputs/RangeInput.js.map +1 -1
  170. package/build/esm/filter-list/base/inputs/RangeInput.module.css +23 -0
  171. package/build/esm/filter-list/base/inputs/TextTagsInput.js +1 -1
  172. package/build/esm/filter-list/base/inputs/TextTagsInput.js.map +1 -1
  173. package/build/esm/filter-list/base/inputs/useStaleData.js +29 -0
  174. package/build/esm/filter-list/base/inputs/useStaleData.js.map +1 -0
  175. package/build/esm/filter-list/hooks/useFilterVisibility.js +68 -0
  176. package/build/esm/filter-list/hooks/useFilterVisibility.js.map +1 -0
  177. package/build/esm/object-table/DefaultCellRenderer.js +13 -3
  178. package/build/esm/object-table/DefaultCellRenderer.js.map +1 -1
  179. package/build/esm/object-table/EditableCell.js +7 -6
  180. package/build/esm/object-table/EditableCell.js.map +1 -1
  181. package/build/esm/object-table/LoadingCell.js +6 -3
  182. package/build/esm/object-table/LoadingCell.js.map +1 -1
  183. package/build/esm/object-table/LoadingRow.js +2 -1
  184. package/build/esm/object-table/LoadingRow.js.map +1 -1
  185. package/build/esm/object-table/ObjectTableApi.js.map +1 -1
  186. package/build/esm/object-table/Table.js.map +1 -1
  187. package/build/esm/object-table/TableCell.module.css +1 -0
  188. package/build/esm/object-table/components/AsyncValueCell.js +35 -0
  189. package/build/esm/object-table/components/AsyncValueCell.js.map +1 -0
  190. package/build/esm/object-table/hooks/useColumnDefs.js +3 -1
  191. package/build/esm/object-table/hooks/useColumnDefs.js.map +1 -1
  192. package/build/esm/object-table/hooks/useFunctionColumnsData.js +270 -0
  193. package/build/esm/object-table/hooks/useFunctionColumnsData.js.map +1 -0
  194. package/build/esm/object-table/hooks/useObjectTableData.js +34 -13
  195. package/build/esm/object-table/hooks/useObjectTableData.js.map +1 -1
  196. package/build/esm/object-table/utils/AsyncCellData.js +30 -0
  197. package/build/esm/object-table/utils/AsyncCellData.js.map +1 -0
  198. package/build/esm/object-table/utils/constants.js +1 -0
  199. package/build/esm/object-table/utils/constants.js.map +1 -1
  200. package/build/esm/pdf-viewer/PdfRenderer.js +88 -0
  201. package/build/esm/pdf-viewer/PdfRenderer.js.map +1 -0
  202. package/build/esm/pdf-viewer/PdfViewer.js +197 -0
  203. package/build/esm/pdf-viewer/PdfViewer.js.map +1 -0
  204. package/build/esm/pdf-viewer/PdfViewer.module.css +95 -0
  205. package/build/esm/pdf-viewer/PdfViewerAnnotationLayer.js +74 -0
  206. package/build/esm/pdf-viewer/PdfViewerAnnotationLayer.js.map +1 -0
  207. package/build/esm/pdf-viewer/PdfViewerAnnotationLayer.module.css +65 -0
  208. package/build/esm/pdf-viewer/PdfViewerSearchBar.js +84 -0
  209. package/build/esm/pdf-viewer/PdfViewerSearchBar.js.map +1 -0
  210. package/build/esm/pdf-viewer/PdfViewerSearchBar.module.css +65 -0
  211. package/build/esm/pdf-viewer/PdfViewerSidebar.js +74 -0
  212. package/build/esm/pdf-viewer/PdfViewerSidebar.js.map +1 -0
  213. package/build/esm/pdf-viewer/PdfViewerSidebar.module.css +46 -0
  214. package/build/esm/pdf-viewer/PdfViewerThumbnail.js +100 -0
  215. package/build/esm/pdf-viewer/PdfViewerThumbnail.js.map +1 -0
  216. package/build/esm/pdf-viewer/PdfViewerThumbnail.module.css +26 -0
  217. package/build/esm/pdf-viewer/PdfViewerToolbar.js +167 -0
  218. package/build/esm/pdf-viewer/PdfViewerToolbar.js.map +1 -0
  219. package/build/esm/pdf-viewer/PdfViewerToolbar.module.css +86 -0
  220. package/build/esm/pdf-viewer/constants.js +43 -0
  221. package/build/esm/pdf-viewer/constants.js.map +1 -0
  222. package/build/esm/pdf-viewer/hooks/usePdfAnnotationPortals.js +54 -0
  223. package/build/esm/pdf-viewer/hooks/usePdfAnnotationPortals.js.map +1 -0
  224. package/build/esm/pdf-viewer/hooks/usePdfDocument.js +67 -0
  225. package/build/esm/pdf-viewer/hooks/usePdfDocument.js.map +1 -0
  226. package/build/esm/pdf-viewer/hooks/usePdfViewer.js +69 -0
  227. package/build/esm/pdf-viewer/hooks/usePdfViewer.js.map +1 -0
  228. package/build/esm/pdf-viewer/hooks/usePdfViewerSearch.js +106 -0
  229. package/build/esm/pdf-viewer/hooks/usePdfViewerSearch.js.map +1 -0
  230. package/build/esm/pdf-viewer/hooks/usePdfViewerSync.js +71 -0
  231. package/build/esm/pdf-viewer/hooks/usePdfViewerSync.js.map +1 -0
  232. package/build/esm/pdf-viewer/types.js +2 -0
  233. package/build/esm/pdf-viewer/types.js.map +1 -0
  234. package/build/esm/public/experimental.js +4 -0
  235. package/build/esm/public/experimental.js.map +1 -1
  236. package/build/types/action-form/FormFieldApi.d.ts +48 -37
  237. package/build/types/action-form/FormFieldApi.d.ts.map +1 -1
  238. package/build/types/action-form/fields/DropdownField.d.ts +6 -0
  239. package/build/types/action-form/fields/DropdownField.d.ts.map +1 -0
  240. package/build/types/action-form/fields/FormFieldRenderer.d.ts.map +1 -1
  241. package/build/types/action-form/fields/TextInputField.d.ts +3 -1
  242. package/build/types/action-form/fields/TextInputField.d.ts.map +1 -1
  243. package/build/types/base-components/combobox/Combobox.d.ts +9 -1
  244. package/build/types/base-components/combobox/Combobox.d.ts.map +1 -1
  245. package/build/types/base-components/select/Select.d.ts +8 -2
  246. package/build/types/base-components/select/Select.d.ts.map +1 -1
  247. package/build/types/base-components/skeleton/SkeletonBar.d.ts +9 -0
  248. package/build/types/base-components/skeleton/SkeletonBar.d.ts.map +1 -0
  249. package/build/types/filter-list/FilterList.d.ts.map +1 -1
  250. package/build/types/filter-list/FilterListApi.d.ts +24 -6
  251. package/build/types/filter-list/FilterListApi.d.ts.map +1 -1
  252. package/build/types/filter-list/base/AddFilterPopover.d.ts +12 -0
  253. package/build/types/filter-list/base/AddFilterPopover.d.ts.map +1 -0
  254. package/build/types/filter-list/base/inputs/CheckboxListInput.d.ts +2 -1
  255. package/build/types/filter-list/base/inputs/CheckboxListInput.d.ts.map +1 -1
  256. package/build/types/filter-list/base/inputs/CheckboxListSkeleton.d.ts +2 -0
  257. package/build/types/filter-list/base/inputs/CheckboxListSkeleton.d.ts.map +1 -0
  258. package/build/types/filter-list/base/inputs/ListogramInput.d.ts +2 -1
  259. package/build/types/filter-list/base/inputs/ListogramInput.d.ts.map +1 -1
  260. package/build/types/filter-list/base/inputs/ListogramSkeleton.d.ts +2 -0
  261. package/build/types/filter-list/base/inputs/ListogramSkeleton.d.ts.map +1 -0
  262. package/build/types/filter-list/base/inputs/RangeInput.d.ts.map +1 -1
  263. package/build/types/filter-list/base/inputs/useStaleData.d.ts +1 -0
  264. package/build/types/filter-list/base/inputs/useStaleData.d.ts.map +1 -0
  265. package/build/types/filter-list/hooks/useFilterVisibility.d.ts +8 -0
  266. package/build/types/filter-list/hooks/useFilterVisibility.d.ts.map +1 -0
  267. package/build/types/object-table/DefaultCellRenderer.d.ts.map +1 -1
  268. package/build/types/object-table/EditableCell.d.ts.map +1 -1
  269. package/build/types/object-table/LoadingCell.d.ts +1 -0
  270. package/build/types/object-table/LoadingCell.d.ts.map +1 -1
  271. package/build/types/object-table/LoadingRow.d.ts.map +1 -1
  272. package/build/types/object-table/ObjectTableApi.d.ts +51 -15
  273. package/build/types/object-table/ObjectTableApi.d.ts.map +1 -1
  274. package/build/types/object-table/Table.d.ts +1 -0
  275. package/build/types/object-table/Table.d.ts.map +1 -1
  276. package/build/types/object-table/components/AsyncValueCell.d.ts +5 -0
  277. package/build/types/object-table/components/AsyncValueCell.d.ts.map +1 -0
  278. package/build/types/object-table/hooks/useFunctionColumnsData.d.ts +13 -0
  279. package/build/types/object-table/hooks/useFunctionColumnsData.d.ts.map +1 -0
  280. package/build/types/object-table/hooks/useObjectTableData.d.ts +8 -1
  281. package/build/types/object-table/hooks/useObjectTableData.d.ts.map +1 -1
  282. package/build/types/object-table/utils/AsyncCellData.d.ts +8 -0
  283. package/build/types/object-table/utils/AsyncCellData.d.ts.map +1 -0
  284. package/build/types/object-table/utils/constants.d.ts +1 -0
  285. package/build/types/object-table/utils/constants.d.ts.map +1 -1
  286. package/build/types/pdf-viewer/PdfRenderer.d.ts +8 -0
  287. package/build/types/pdf-viewer/PdfRenderer.d.ts.map +1 -0
  288. package/build/types/pdf-viewer/PdfViewer.d.ts +4 -0
  289. package/build/types/pdf-viewer/PdfViewer.d.ts.map +1 -0
  290. package/build/types/pdf-viewer/PdfViewerAnnotationLayer.d.ts +10 -0
  291. package/build/types/pdf-viewer/PdfViewerAnnotationLayer.d.ts.map +1 -0
  292. package/build/types/pdf-viewer/PdfViewerSearchBar.d.ts +12 -0
  293. package/build/types/pdf-viewer/PdfViewerSearchBar.d.ts.map +1 -0
  294. package/build/types/pdf-viewer/PdfViewerSidebar.d.ts +10 -0
  295. package/build/types/pdf-viewer/PdfViewerSidebar.d.ts.map +1 -0
  296. package/build/types/pdf-viewer/PdfViewerThumbnail.d.ts +10 -0
  297. package/build/types/pdf-viewer/PdfViewerThumbnail.d.ts.map +1 -0
  298. package/build/types/pdf-viewer/PdfViewerToolbar.d.ts +14 -0
  299. package/build/types/pdf-viewer/PdfViewerToolbar.d.ts.map +1 -0
  300. package/build/types/pdf-viewer/constants.d.ts +17 -0
  301. package/build/types/pdf-viewer/constants.d.ts.map +1 -0
  302. package/build/types/pdf-viewer/hooks/usePdfAnnotationPortals.d.ts +10 -0
  303. package/build/types/pdf-viewer/hooks/usePdfAnnotationPortals.d.ts.map +1 -0
  304. package/build/types/pdf-viewer/hooks/usePdfDocument.d.ts +9 -0
  305. package/build/types/pdf-viewer/hooks/usePdfDocument.d.ts.map +1 -0
  306. package/build/types/pdf-viewer/hooks/usePdfViewer.d.ts +9 -0
  307. package/build/types/pdf-viewer/hooks/usePdfViewer.d.ts.map +1 -0
  308. package/build/types/pdf-viewer/hooks/usePdfViewerSearch.d.ts +15 -0
  309. package/build/types/pdf-viewer/hooks/usePdfViewerSearch.d.ts.map +1 -0
  310. package/build/types/pdf-viewer/hooks/usePdfViewerSync.d.ts +15 -0
  311. package/build/types/pdf-viewer/hooks/usePdfViewerSync.d.ts.map +1 -0
  312. package/build/types/pdf-viewer/types.d.ts +44 -0
  313. package/build/types/pdf-viewer/types.d.ts.map +1 -0
  314. package/build/types/public/experimental.d.ts +4 -1
  315. package/build/types/public/experimental.d.ts.map +1 -1
  316. package/package.json +5 -4
@@ -0,0 +1,74 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import classnames from "classnames";
18
+ import React, { useCallback, useMemo } from "react";
19
+ import styles from "./PdfViewerAnnotationLayer.module.css";
20
+ function AnnotationItem({
21
+ annotation,
22
+ pageHeight,
23
+ scale,
24
+ onClick
25
+ }) {
26
+ const handleClick = useCallback(() => {
27
+ onClick?.(annotation);
28
+ }, [onClick, annotation]);
29
+ const handleKeyDown = useCallback(e => {
30
+ if (e.key === "Enter") {
31
+ e.preventDefault();
32
+ onClick?.(annotation);
33
+ }
34
+ }, [onClick, annotation]);
35
+
36
+ // Convert PDF coordinates (bottom-left origin) to CSS (top-left origin)
37
+ const style = useMemo(() => ({
38
+ left: annotation.rect.x * scale,
39
+ top: (pageHeight - annotation.rect.y - annotation.rect.height) * scale,
40
+ width: annotation.rect.width * scale,
41
+ height: annotation.rect.height * scale,
42
+ ...(annotation.color != null ? {
43
+ "--osdk-pdf-annotation-color": annotation.color
44
+ } : {})
45
+ }), [annotation, pageHeight, scale]);
46
+ const className = classnames(styles.annotation, styles[annotation.type]);
47
+ return /*#__PURE__*/React.createElement("div", {
48
+ className: className,
49
+ style: style,
50
+ onClick: handleClick,
51
+ onKeyDown: handleKeyDown,
52
+ role: "button",
53
+ tabIndex: 0,
54
+ title: annotation.label,
55
+ "data-annotation-id": annotation.id
56
+ });
57
+ }
58
+ export function PdfViewerAnnotationLayer({
59
+ annotations,
60
+ pageHeight,
61
+ scale,
62
+ onAnnotationClick
63
+ }) {
64
+ return /*#__PURE__*/React.createElement("div", {
65
+ className: styles.annotationLayer
66
+ }, annotations.map(annotation => /*#__PURE__*/React.createElement(AnnotationItem, {
67
+ key: annotation.id,
68
+ annotation: annotation,
69
+ pageHeight: pageHeight,
70
+ scale: scale,
71
+ onClick: onAnnotationClick
72
+ })));
73
+ }
74
+ //# sourceMappingURL=PdfViewerAnnotationLayer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PdfViewerAnnotationLayer.js","names":["classnames","React","useCallback","useMemo","styles","AnnotationItem","annotation","pageHeight","scale","onClick","handleClick","handleKeyDown","e","key","preventDefault","style","left","rect","x","top","y","height","width","color","className","type","createElement","onKeyDown","role","tabIndex","title","label","id","PdfViewerAnnotationLayer","annotations","onAnnotationClick","annotationLayer","map"],"sources":["PdfViewerAnnotationLayer.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport classnames from \"classnames\";\nimport React, { useCallback, useMemo } from \"react\";\nimport styles from \"./PdfViewerAnnotationLayer.module.css\";\nimport type { PdfAnnotation } from \"./types.js\";\n\ninterface PdfViewerAnnotationLayerProps {\n annotations: PdfAnnotation[];\n pageHeight: number;\n scale: number;\n onAnnotationClick?: (annotation: PdfAnnotation) => void;\n}\n\ninterface AnnotationItemProps {\n annotation: PdfAnnotation;\n pageHeight: number;\n scale: number;\n onClick?: (annotation: PdfAnnotation) => void;\n}\n\nfunction AnnotationItem({\n annotation,\n pageHeight,\n scale,\n onClick,\n}: AnnotationItemProps): React.ReactElement {\n const handleClick = useCallback(() => {\n onClick?.(annotation);\n }, [onClick, annotation]);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n onClick?.(annotation);\n }\n },\n [onClick, annotation],\n );\n\n // Convert PDF coordinates (bottom-left origin) to CSS (top-left origin)\n const style = useMemo(\n () => ({\n left: annotation.rect.x * scale,\n top: (pageHeight - annotation.rect.y - annotation.rect.height) * scale,\n width: annotation.rect.width * scale,\n height: annotation.rect.height * scale,\n ...(annotation.color != null\n ? {\n \"--osdk-pdf-annotation-color\": annotation.color,\n } as React.CSSProperties\n : {}),\n }),\n [annotation, pageHeight, scale],\n );\n\n const className = classnames(\n styles.annotation,\n styles[annotation.type],\n );\n\n return (\n <div\n className={className}\n style={style}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n role=\"button\"\n tabIndex={0}\n title={annotation.label}\n data-annotation-id={annotation.id}\n />\n );\n}\n\nexport function PdfViewerAnnotationLayer({\n annotations,\n pageHeight,\n scale,\n onAnnotationClick,\n}: PdfViewerAnnotationLayerProps): React.ReactElement {\n return (\n <div className={styles.annotationLayer}>\n {annotations.map((annotation) => (\n <AnnotationItem\n key={annotation.id}\n annotation={annotation}\n pageHeight={pageHeight}\n scale={scale}\n onClick={onAnnotationClick}\n />\n ))}\n </div>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,IAAIC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACnD,OAAOC,MAAM,MAAM,uCAAuC;AAiB1D,SAASC,cAAcA,CAAC;EACtBC,UAAU;EACVC,UAAU;EACVC,KAAK;EACLC;AACmB,CAAC,EAAsB;EAC1C,MAAMC,WAAW,GAAGR,WAAW,CAAC,MAAM;IACpCO,OAAO,GAAGH,UAAU,CAAC;EACvB,CAAC,EAAE,CAACG,OAAO,EAAEH,UAAU,CAAC,CAAC;EAEzB,MAAMK,aAAa,GAAGT,WAAW,CAC9BU,CAAsB,IAAK;IAC1B,IAAIA,CAAC,CAACC,GAAG,KAAK,OAAO,EAAE;MACrBD,CAAC,CAACE,cAAc,CAAC,CAAC;MAClBL,OAAO,GAAGH,UAAU,CAAC;IACvB;EACF,CAAC,EACD,CAACG,OAAO,EA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bQ,GAAG,EAAEP,UAAU,CAAC0B,EAAG;IACnB1B,UAAU,EAAEA,UAAW;IACvBC,UAAU,EAAEA,UAAW;IACvBC,KAAK,EAAEA,KAAM;IACbC,OAAO,EAAE0B;EAAkB,CAC5B,CACF,CACE,CAAC;AAEV","ignoreList":[]}
@@ -0,0 +1,65 @@
1
+ .annotationLayer {
2
+ position: absolute;
3
+ top: 0;
4
+ left: 0;
5
+ width: 100%;
6
+ height: 100%;
7
+ pointer-events: none;
8
+ z-index: 3;
9
+ }
10
+
11
+ .annotation {
12
+ position: absolute;
13
+ pointer-events: auto;
14
+ cursor: pointer;
15
+ box-sizing: border-box;
16
+ transition: opacity var(--osdk-emphasis-transition-duration)
17
+ var(--osdk-emphasis-ease-default);
18
+ }
19
+
20
+ .annotation:hover {
21
+ opacity: 0.8;
22
+ }
23
+
24
+ .annotation:focus-visible {
25
+ outline: var(--osdk-focus-outline);
26
+ outline-offset: var(--osdk-focus-visible-outline-offset);
27
+ }
28
+
29
+ .highlight {
30
+ background-color: var(
31
+ --osdk-pdf-annotation-color,
32
+ var(--osdk-pdf-viewer-annotation-highlight)
33
+ );
34
+ border-radius: 2px;
35
+ }
36
+
37
+ .underline {
38
+ background-color: transparent;
39
+ border-bottom: 2px solid
40
+ var(
41
+ --osdk-pdf-annotation-color,
42
+ var(--osdk-pdf-viewer-annotation-underline)
43
+ );
44
+ }
45
+
46
+ .comment {
47
+ background-color: var(
48
+ --osdk-pdf-annotation-color,
49
+ var(--osdk-pdf-viewer-annotation-comment)
50
+ );
51
+ border-radius: 50%;
52
+ width: 16px !important;
53
+ height: 16px !important;
54
+ }
55
+
56
+ .pin {
57
+ background-color: var(
58
+ --osdk-pdf-annotation-color,
59
+ var(--osdk-pdf-viewer-annotation-pin)
60
+ );
61
+ border-radius: 50% 50% 50% 0;
62
+ width: 16px !important;
63
+ height: 16px !important;
64
+ transform: rotate(-45deg);
65
+ }
@@ -0,0 +1,84 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { ChevronDown, ChevronUp, Cross } from "@blueprintjs/icons";
18
+ import React, { useCallback } from "react";
19
+ import styles from "./PdfViewerSearchBar.module.css";
20
+ export function PdfViewerSearchBar({
21
+ query,
22
+ totalMatches,
23
+ currentMatchIndex,
24
+ onQueryChange,
25
+ onNext,
26
+ onPrev,
27
+ onClose
28
+ }) {
29
+ const handleInputChange = useCallback(e => {
30
+ onQueryChange(e.target.value);
31
+ }, [onQueryChange]);
32
+ const handleKeyDown = useCallback(e => {
33
+ if (e.key === "Enter") {
34
+ e.preventDefault();
35
+ if (e.shiftKey) {
36
+ onPrev();
37
+ } else {
38
+ onNext();
39
+ }
40
+ } else if (e.key === "Escape") {
41
+ e.preventDefault();
42
+ onClose();
43
+ }
44
+ }, [onNext, onPrev, onClose]);
45
+ const matchDisplay = totalMatches > 0 ? `${currentMatchIndex + 1} of ${totalMatches}` : query.length > 0 ? "No results" : "";
46
+ return /*#__PURE__*/React.createElement("div", {
47
+ className: styles.searchBar
48
+ }, /*#__PURE__*/React.createElement("input", {
49
+ autoFocus: true,
50
+ className: styles.searchInput,
51
+ type: "text",
52
+ value: query,
53
+ onChange: handleInputChange,
54
+ onKeyDown: handleKeyDown,
55
+ placeholder: "Find in document...",
56
+ "aria-label": "Search in PDF"
57
+ }), matchDisplay.length > 0 && /*#__PURE__*/React.createElement("span", {
58
+ className: styles.matchCount
59
+ }, matchDisplay), /*#__PURE__*/React.createElement("button", {
60
+ className: styles.navButton,
61
+ onClick: onPrev,
62
+ disabled: totalMatches === 0,
63
+ "aria-label": "Previous match",
64
+ type: "button"
65
+ }, /*#__PURE__*/React.createElement(ChevronUp, {
66
+ size: 16
67
+ })), /*#__PURE__*/React.createElement("button", {
68
+ className: styles.navButton,
69
+ onClick: onNext,
70
+ disabled: totalMatches === 0,
71
+ "aria-label": "Next match",
72
+ type: "button"
73
+ }, /*#__PURE__*/React.createElement(ChevronDown, {
74
+ size: 16
75
+ })), /*#__PURE__*/React.createElement("button", {
76
+ className: styles.closeButton,
77
+ onClick: onClose,
78
+ "aria-label": "Close search",
79
+ type: "button"
80
+ }, /*#__PURE__*/React.createElement(Cross, {
81
+ size: 16
82
+ })));
83
+ }
84
+ //# sourceMappingURL=PdfViewerSearchBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PdfViewerSearchBar.js","names":["ChevronDown","ChevronUp","Cross","React","useCallback","styles","PdfViewerSearchBar","query","totalMatches","currentMatchIndex","onQueryChange","onNext","onPrev","onClose","handleInputChange","e","target","value","handleKeyDown","key","preventDefault","shiftKey","matchDisplay","length","createElement","className","searchBar","autoFocus","searchInput","type","onChange","onKeyDown","placeholder","matchCount","navButton","onClick","disabled","size","closeButton"],"sources":["PdfViewerSearchBar.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ChevronDown, ChevronUp, Cross } from \"@blueprintjs/icons\";\nimport React, { useCallback } from \"react\";\nimport styles from \"./PdfViewerSearchBar.module.css\";\n\ninterface PdfViewerSearchBarProps {\n query: string;\n totalMatches: number;\n currentMatchIndex: number;\n onQueryChange: (query: string) => void;\n onNext: () => void;\n onPrev: () => void;\n onClose: () => void;\n}\n\nexport function PdfViewerSearchBar({\n query,\n totalMatches,\n currentMatchIndex,\n onQueryChange,\n onNext,\n onPrev,\n onClose,\n}: PdfViewerSearchBarProps): React.ReactElement {\n const handleInputChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n onQueryChange(e.target.value);\n },\n [onQueryChange],\n );\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n if (e.shiftKey) {\n onPrev();\n } else {\n onNext();\n }\n } else if (e.key === \"Escape\") {\n e.preventDefault();\n onClose();\n }\n },\n [onNext, onPrev, onClose],\n );\n\n const matchDisplay = totalMatches > 0\n ? `${currentMatchIndex + 1} of ${totalMatches}`\n : query.length > 0\n ? \"No results\"\n : \"\";\n\n return (\n <div className={styles.searchBar}>\n <input\n autoFocus\n className={styles.searchInput}\n type=\"text\"\n value={query}\n onChange={handleInputChange}\n onKeyDown={handleKeyDown}\n placeholder=\"Find in document...\"\n aria-label=\"Search in PDF\"\n />\n {matchDisplay.length > 0 && (\n <span className={styles.matchCount}>{matchDisplay}</span>\n )}\n <button\n className={styles.navButton}\n onClick={onPrev}\n disabled={totalMatches === 0}\n aria-label=\"Previous match\"\n type=\"button\"\n >\n <ChevronUp size={16} />\n </button>\n <button\n className={styles.navButton}\n onClick={onNext}\n disabled={totalMatches === 0}\n aria-label=\"Next match\"\n type=\"button\"\n >\n <ChevronDown size={16} />\n </button>\n <button\n className={styles.closeButton}\n onClick={onClose}\n aria-label=\"Close search\"\n type=\"button\"\n >\n <Cross size={16} />\n </button>\n </div>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,EAAEC,SAAS,EAAEC,KAAK,QAAQ,oBAAoB;AAClE,OAAO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AEb,aAAc;IACzBc,WAAW,EAAC,qBAAqB;IACjC,cAAW;EAAe,CAC3B,CAAC,EACDV,YAAY,CAACC,MAAM,GAAG,CAAC,iBACtBpB,KAAA,CAAAqB,aAAA;IAAMC,SAAS,EAAEpB,MAAM,CAAC4B;EAAW,GAAEX,YAAmB,CACzD,eACDnB,KAAA,CAAAqB,aAAA;IACEC,SAAS,EAAEpB,MAAM,CAAC6B,SAAU;IAC5BC,OAAO,EAAEvB,MAAO;IAChBwB,QAAQ,EAAE5B,YAAY,KAAK,CAAE;IAC7B,cAAW,gBAAgB;IAC3BqB,IAAI,EAAC;EAAQ,gBAEb1B,KAAA,CAAAqB,aAAA,CAACvB,SAAS;IAACoC,IAAI,EAAE;EAAG,CAAE,CAChB,CAAC,eACTlC,KAAA,CAAAqB,aAAA;IACEC,SAAS,EAAEpB,MAAM,CAAC6B,SAAU;IAC5BC,OAAO,EAAExB,MAAO;IAChByB,QAAQ,EAAE5B,YAAY,KAAK,CAAE;IAC7B,cAAW,YAAY;IACvBqB,IAAI,EAAC;EAAQ,gBAEb1B,KAAA,CAAAqB,aAAA,CAACxB,WAAW;IAACqC,IAAI,EAAE;EAAG,CAAE,CAClB,CAAC,eACTlC,KAAA,CAAAqB,aAAA;IACEC,SAAS,EAAEpB,MAAM,CAACiC,WAAY;IAC9BH,OAAO,EAAEtB,OAAQ;IACjB,cAAW,cAAc;IACzBgB,IAAI,EAAC;EAAQ,gBAEb1B,KAAA,CAAAqB,aAAA,CAACtB,KAAK;IAACmC,IAAI,EAAE;EAAG,CAAE,CACZ,CACL,CAAC;AAEV","ignoreList":[]}
@@ -0,0 +1,65 @@
1
+ .searchBar {
2
+ position: absolute;
3
+ top: 0;
4
+ right: 0;
5
+ z-index: var(--osdk-surface-z-index-3);
6
+ display: flex;
7
+ align-items: center;
8
+ gap: var(--osdk-pdf-viewer-toolbar-gap);
9
+ padding: var(--osdk-surface-spacing);
10
+ background-color: var(--osdk-pdf-viewer-search-bar-bg);
11
+ border: var(--osdk-surface-border);
12
+ border-radius: var(--osdk-surface-border-radius);
13
+ box-shadow: var(--osdk-surface-shadow-2);
14
+ margin: var(--osdk-surface-spacing);
15
+ }
16
+
17
+ .searchInput {
18
+ border: var(--osdk-surface-border);
19
+ border-radius: var(--osdk-surface-border-radius);
20
+ padding: var(--osdk-surface-spacing) calc(var(--osdk-surface-spacing) * 2);
21
+ font-family: var(--osdk-typography-family-default);
22
+ font-size: var(--osdk-typography-size-body-small);
23
+ color: var(--osdk-typography-color-default-rest);
24
+ background-color: var(--osdk-background-primary);
25
+ outline: none;
26
+ min-width: 200px;
27
+ }
28
+
29
+ .searchInput:focus {
30
+ outline: var(--osdk-focus-outline);
31
+ outline-offset: var(--osdk-focus-visible-outline-offset);
32
+ }
33
+
34
+ .matchCount {
35
+ font-size: var(--osdk-typography-size-body-x-small);
36
+ color: var(--osdk-typography-color-muted);
37
+ white-space: nowrap;
38
+ }
39
+
40
+ .navButton {
41
+ display: flex;
42
+ align-items: center;
43
+ justify-content: center;
44
+ width: 24px;
45
+ height: 24px;
46
+ border: none;
47
+ background: none;
48
+ color: var(--osdk-typography-color-default-rest);
49
+ cursor: pointer;
50
+ border-radius: var(--osdk-surface-border-radius);
51
+ padding: 0;
52
+ }
53
+
54
+ .navButton:hover {
55
+ background-color: var(--osdk-surface-background-color-default-hover);
56
+ }
57
+
58
+ .navButton:focus-visible {
59
+ outline: var(--osdk-focus-outline);
60
+ outline-offset: var(--osdk-focus-visible-outline-offset);
61
+ }
62
+
63
+ .closeButton {
64
+ composes: navButton;
65
+ }
@@ -0,0 +1,74 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { useVirtualizer } from "@tanstack/react-virtual";
18
+ import React, { useEffect, useRef } from "react";
19
+ import { DEFAULT_PAGE_HEIGHT, THUMBNAIL_GAP, THUMBNAIL_SCALE } from "./constants.js";
20
+ import styles from "./PdfViewerSidebar.module.css";
21
+ import { PdfViewerThumbnail } from "./PdfViewerThumbnail.js";
22
+ export function PdfViewerSidebar({
23
+ document,
24
+ numPages,
25
+ currentPage,
26
+ onPageClick
27
+ }) {
28
+ const scrollContainerRef = useRef(null);
29
+ const estimatedItemHeight = Math.floor(DEFAULT_PAGE_HEIGHT * THUMBNAIL_SCALE) + THUMBNAIL_GAP + 20;
30
+ const virtualizer = useVirtualizer({
31
+ count: numPages,
32
+ getScrollElement: () => scrollContainerRef.current,
33
+ estimateSize: () => estimatedItemHeight,
34
+ overscan: 2
35
+ });
36
+
37
+ // Auto-scroll to keep the active thumbnail visible
38
+ useEffect(function () {
39
+ virtualizer.scrollToIndex(currentPage - 1, {
40
+ align: "auto"
41
+ });
42
+ }, [currentPage, virtualizer]);
43
+ return /*#__PURE__*/React.createElement("div", {
44
+ className: styles.sidebar
45
+ }, /*#__PURE__*/React.createElement("div", {
46
+ className: styles.sidebarHeader
47
+ }, "Pages"), /*#__PURE__*/React.createElement("div", {
48
+ ref: scrollContainerRef,
49
+ className: styles.scrollContainer
50
+ }, /*#__PURE__*/React.createElement("div", {
51
+ className: styles.thumbnailsContainer,
52
+ style: {
53
+ height: virtualizer.getTotalSize()
54
+ }
55
+ }, virtualizer.getVirtualItems().map(virtualItem => {
56
+ const pageNumber = virtualItem.index + 1;
57
+ return /*#__PURE__*/React.createElement("div", {
58
+ key: virtualItem.key,
59
+ className: styles.thumbnailWrapper,
60
+ style: {
61
+ top: virtualItem.start,
62
+ height: virtualItem.size
63
+ }
64
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(PdfViewerThumbnail, {
65
+ document: document,
66
+ pageNumber: pageNumber,
67
+ isActive: pageNumber === currentPage,
68
+ onClick: () => onPageClick(pageNumber)
69
+ }), /*#__PURE__*/React.createElement("div", {
70
+ className: styles.pageNumber
71
+ }, pageNumber)));
72
+ }))));
73
+ }
74
+ //# sourceMappingURL=PdfViewerSidebar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PdfViewerSidebar.js","names":["useVirtualizer","React","useEffect","useRef","DEFAULT_PAGE_HEIGHT","THUMBNAIL_GAP","THUMBNAIL_SCALE","styles","PdfViewerThumbnail","PdfViewerSidebar","document","numPages","currentPage","onPageClick","scrollContainerRef","estimatedItemHeight","Math","floor","virtualizer","count","getScrollElement","current","estimateSize","overscan","scrollToIndex","align","createElement","className","sidebar","sidebarHeader","ref","scrollContainer","thumbnailsContainer","style","height","getTotalSize","getVirtualItems","map","virtualItem","pageNumber","index","key","thumbnailWrapper","top","start","size","isActive","onClick"],"sources":["PdfViewerSidebar.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\nimport type { PDFDocumentProxy } from \"pdfjs-dist\";\nimport React, { useEffect, useRef } from \"react\";\nimport {\n DEFAULT_PAGE_HEIGHT,\n THUMBNAIL_GAP,\n THUMBNAIL_SCALE,\n} from \"./constants.js\";\nimport styles from \"./PdfViewerSidebar.module.css\";\nimport { PdfViewerThumbnail } from \"./PdfViewerThumbnail.js\";\n\ninterface PdfViewerSidebarProps {\n document: PDFDocumentProxy;\n numPages: number;\n currentPage: number;\n onPageClick: (page: number) => void;\n}\n\nexport function PdfViewerSidebar({\n document,\n numPages,\n currentPage,\n onPageClick,\n}: PdfViewerSidebarProps): React.ReactElement {\n const scrollContainerRef = useRef<HTMLDivElement>(null);\n const estimatedItemHeight = Math.floor(DEFAULT_PAGE_HEIGHT * THUMBNAIL_SCALE)\n + THUMBNAIL_GAP + 20;\n\n const virtualizer = useVirtualizer({\n count: numPages,\n getScrollElement: () => scrollContainerRef.current,\n estimateSize: () => estimatedItemHeight,\n overscan: 2,\n });\n\n // Auto-scroll to keep the active thumbnail visible\n useEffect(function syncActiveThumbnail() {\n virtualizer.scrollToIndex(currentPage - 1, { align: \"auto\" });\n }, [currentPage, virtualizer]);\n\n return (\n <div className={styles.sidebar}>\n <div className={styles.sidebarHeader}>Pages</div>\n <div ref={scrollContainerRef} className={styles.scrollContainer}>\n <div\n className={styles.thumbnailsContainer}\n style={{ height: virtualizer.getTotalSize() }}\n >\n {virtualizer.getVirtualItems().map((virtualItem) => {\n const pageNumber = virtualItem.index + 1;\n return (\n <div\n key={virtualItem.key}\n className={styles.thumbnailWrapper}\n style={{\n top: virtualItem.start,\n height: virtualItem.size,\n }}\n >\n <div>\n <PdfViewerThumbnail\n document={document}\n pageNumber={pageNumber}\n isActive={pageNumber === currentPage}\n onClick={() => onPageClick(pageNumber)}\n />\n <div className={styles.pageNumber}>{pageNumber}</div>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,cAAc,QAAQ,yBAAyB;AAExD,OAAOC,KAAK,IAAIC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAChD,SACEC,mBAAmB,EACnBC,aAAa,EACbC,eAAe,QACV,gBAAgB;AACvB,OAAOC,MAAM,MAAM,+BAA+B;AAClD,SAASC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BACEvC,KAAA,CAAAyB,aAAA;MACEe,GAAG,EAAEH,WAAW,CAACG,GAAI;MACrBd,SAAS,EAAEpB,MAAM,CAACmC,gBAAiB;MACnCT,KAAK,EAAE;QACLU,GAAG,EAAEL,WAAW,CAACM,KAAK;QACtBV,MAAM,EAAEI,WAAW,CAACO;MACtB;IAAE,gBAEF5C,KAAA,CAAAyB,aAAA,2BACEzB,KAAA,CAAAyB,aAAA,CAAClB,kBAAkB;MACjBE,QAAQ,EAAEA,QAAS;MACnB6B,UAAU,EAAEA,UAAW;MACvBO,QAAQ,EAAEP,UAAU,KAAK3B,WAAY;MACrCmC,OAAO,EAAEA,CAAA,KAAMlC,WAAW,CAAC0B,UAAU;IAAE,CACxC,CAAC,eACFtC,KAAA,CAAAyB,aAAA;MAAKC,SAAS,EAAEpB,MAAM,CAACgC;IAAW,GAAEA,UAAgB,CACjD,CACF,CAAC;EAEV,CAAC,CACE,CACF,CACF,CAAC;AAEV","ignoreList":[]}
@@ -0,0 +1,46 @@
1
+ .sidebar {
2
+ width: var(--osdk-pdf-viewer-sidebar-width);
3
+ flex-shrink: 0;
4
+ display: flex;
5
+ flex-direction: column;
6
+ background-color: var(--osdk-pdf-viewer-sidebar-bg);
7
+ border-right: 1px solid var(--osdk-pdf-viewer-sidebar-border);
8
+ overflow: hidden;
9
+ }
10
+
11
+ .sidebarHeader {
12
+ padding: var(--osdk-pdf-viewer-sidebar-thumbnail-gap);
13
+ font-family: var(--osdk-typography-family-default);
14
+ font-size: var(--osdk-typography-size-body-small);
15
+ font-weight: var(--osdk-typography-weight-semibold);
16
+ color: var(--osdk-typography-color-muted);
17
+ border-bottom: 1px solid var(--osdk-pdf-viewer-sidebar-border);
18
+ flex-shrink: 0;
19
+ }
20
+
21
+ .scrollContainer {
22
+ flex: 1;
23
+ overflow-y: auto;
24
+ }
25
+
26
+ .thumbnailsContainer {
27
+ position: relative;
28
+ }
29
+
30
+ .thumbnailWrapper {
31
+ position: absolute;
32
+ left: 0;
33
+ width: 100%;
34
+ display: flex;
35
+ justify-content: center;
36
+ padding: var(--osdk-pdf-viewer-sidebar-thumbnail-gap)
37
+ var(--osdk-pdf-viewer-sidebar-thumbnail-gap) 0;
38
+ }
39
+
40
+ .pageNumber {
41
+ text-align: center;
42
+ font-family: var(--osdk-typography-family-default);
43
+ font-size: var(--osdk-typography-size-body-small);
44
+ color: var(--osdk-typography-color-muted);
45
+ margin-top: 4px;
46
+ }
@@ -0,0 +1,100 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import classnames from "classnames";
18
+ import React, { useCallback, useEffect, useRef, useState } from "react";
19
+ import { DEVICE_PIXEL_RATIO, THUMBNAIL_SCALE } from "./constants.js";
20
+ import styles from "./PdfViewerThumbnail.module.css";
21
+ export function PdfViewerThumbnail({
22
+ document,
23
+ pageNumber,
24
+ isActive,
25
+ onClick
26
+ }) {
27
+ const canvasRef = useRef(null);
28
+ const renderTaskRef = useRef(null);
29
+ const [dimensions, setDimensions] = useState(undefined);
30
+ useEffect(() => {
31
+ let cancelled = false;
32
+ void document.getPage(pageNumber).then(page => {
33
+ if (cancelled || canvasRef.current == null) {
34
+ return;
35
+ }
36
+ const viewport = page.getViewport({
37
+ scale: THUMBNAIL_SCALE
38
+ });
39
+ const canvas = canvasRef.current;
40
+ const context = canvas.getContext("2d");
41
+ if (context == null) {
42
+ return;
43
+ }
44
+ canvas.width = Math.floor(viewport.width * DEVICE_PIXEL_RATIO);
45
+ canvas.height = Math.floor(viewport.height * DEVICE_PIXEL_RATIO);
46
+ canvas.style.width = `${Math.floor(viewport.width)}px`;
47
+ canvas.style.height = `${Math.floor(viewport.height)}px`;
48
+ setDimensions({
49
+ width: Math.floor(viewport.width),
50
+ height: Math.floor(viewport.height)
51
+ });
52
+ if (renderTaskRef.current != null) {
53
+ renderTaskRef.current.cancel();
54
+ }
55
+ context.setTransform(DEVICE_PIXEL_RATIO, 0, 0, DEVICE_PIXEL_RATIO, 0, 0);
56
+ const renderTask = page.render({
57
+ canvasContext: context,
58
+ viewport
59
+ });
60
+ renderTaskRef.current = renderTask;
61
+ void renderTask.promise.catch(err => {
62
+ if (err instanceof Error && err.message.includes("cancelled")) {
63
+ return;
64
+ }
65
+ throw err;
66
+ });
67
+ });
68
+ return () => {
69
+ cancelled = true;
70
+ if (renderTaskRef.current != null) {
71
+ renderTaskRef.current.cancel();
72
+ renderTaskRef.current = null;
73
+ }
74
+ };
75
+ }, [document, pageNumber]);
76
+ const handleKeyDown = useCallback(e => {
77
+ if (e.key === "Enter" || e.key === " ") {
78
+ e.preventDefault();
79
+ onClick();
80
+ }
81
+ }, [onClick]);
82
+ const containerClassName = classnames(styles.thumbnailContainer, isActive && styles.active);
83
+ return /*#__PURE__*/React.createElement("div", {
84
+ className: containerClassName,
85
+ onClick: onClick,
86
+ onKeyDown: handleKeyDown,
87
+ role: "button",
88
+ tabIndex: 0,
89
+ "aria-label": `Page ${pageNumber}`,
90
+ "aria-current": isActive ? "page" : undefined,
91
+ style: dimensions != null ? {
92
+ width: dimensions.width,
93
+ height: dimensions.height
94
+ } : undefined
95
+ }, /*#__PURE__*/React.createElement("canvas", {
96
+ ref: canvasRef,
97
+ className: styles.canvas
98
+ }));
99
+ }
100
+ //# sourceMappingURL=PdfViewerThumbnail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PdfViewerThumbnail.js","names":["classnames","React","useCallback","useEffect","useRef","useState","DEVICE_PIXEL_RATIO","THUMBNAIL_SCALE","styles","PdfViewerThumbnail","document","pageNumber","isActive","onClick","canvasRef","renderTaskRef","dimensions","setDimensions","undefined","cancelled","getPage","then","page","current","viewport","getViewport","scale","canvas","context","getContext","width","Math","floor","height","style","cancel","setTransform","renderTask","render","canvasContext","promise","catch","err","Error","message","includes","handleKeyDown","e","key","preventDefault","containerClassName","thumbnailContainer","active","createElement","className","onKeyDown","role","tabIndex","ref"],"sources":["PdfViewerThumbnail.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport classnames from \"classnames\";\nimport type { PDFDocumentProxy, PDFPageProxy } from \"pdfjs-dist\";\nimport React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport { DEVICE_PIXEL_RATIO, THUMBNAIL_SCALE } from \"./constants.js\";\nimport styles from \"./PdfViewerThumbnail.module.css\";\n\ninterface PdfViewerThumbnailProps {\n document: PDFDocumentProxy;\n pageNumber: number;\n isActive: boolean;\n onClick: () => void;\n}\n\nexport function PdfViewerThumbnail({\n document,\n pageNumber,\n isActive,\n onClick,\n}: PdfViewerThumbnailProps): React.ReactElement {\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const renderTaskRef = useRef<ReturnType<PDFPageProxy[\"render\"]> | null>(null);\n const [dimensions, setDimensions] = useState<\n { width: number; height: number } | undefined\n >(undefined);\n\n useEffect(() => {\n let cancelled = false;\n\n void document.getPage(pageNumber).then((page) => {\n if (cancelled || canvasRef.current == null) {\n return;\n }\n\n const viewport = page.getViewport({ scale: THUMBNAIL_SCALE });\n const canvas = canvasRef.current;\n const context = canvas.getContext(\"2d\");\n if (context == null) {\n return;\n }\n\n canvas.width = Math.floor(viewport.width * DEVICE_PIXEL_RATIO);\n canvas.height = Math.floor(viewport.height * DEVICE_PIXEL_RATIO);\n canvas.style.width = `${Math.floor(viewport.width)}px`;\n canvas.style.height = `${Math.floor(viewport.height)}px`;\n\n setDimensions({\n width: Math.floor(viewport.width),\n height: Math.floor(viewport.height),\n });\n\n if (renderTaskRef.current != null) {\n renderTaskRef.current.cancel();\n }\n\n context.setTransform(\n DEVICE_PIXEL_RATIO,\n 0,\n 0,\n DEVICE_PIXEL_RATIO,\n 0,\n 0,\n );\n\n const renderTask = page.render({\n canvasContext: context,\n viewport,\n });\n renderTaskRef.current = renderTask;\n\n void renderTask.promise.catch((err: unknown) => {\n if (err instanceof Error && err.message.includes(\"cancelled\")) {\n return;\n }\n throw err;\n });\n });\n\n return () => {\n cancelled = true;\n if (renderTaskRef.current != null) {\n renderTaskRef.current.cancel();\n renderTaskRef.current = null;\n }\n };\n }, [document, pageNumber]);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n onClick();\n }\n },\n [onClick],\n );\n\n const containerClassName = classnames(\n styles.thumbnailContainer,\n isActive && styles.active,\n );\n\n return (\n <div\n className={containerClassName}\n onClick={onClick}\n onKeyDown={handleKeyDown}\n role=\"button\"\n tabIndex={0}\n aria-label={`Page ${pageNumber}`}\n aria-current={isActive ? \"page\" : undefined}\n style={dimensions != null\n ? { width: dimensions.width, height: dimensions.height }\n : undefined}\n >\n <canvas ref={canvasRef} className={styles.canvas} />\n </div>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,UAAU,MAAM,YAAY;AAEnC,OAAOC,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACvE,SAASC,kBAAk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,EACD,CAACA,OAAO,CACV,CAAC;EAED,MAAMqC,kBAAkB,GAAGlD,UAAU,CACnCQ,MAAM,CAAC2C,kBAAkB,EACzBvC,QAAQ,IAAIJ,MAAM,CAAC4C,MACrB,CAAC;EAED,oBACEnD,KAAA,CAAAoD,aAAA;IACEC,SAAS,EAAEJ,kBAAmB;IAC9BrC,OAAO,EAAEA,OAAQ;IACjB0C,SAAS,EAAET,aAAc;IACzBU,IAAI,EAAC,QAAQ;IACbC,QAAQ,EAAE,CAAE;IACZ,cAAY,QAAQ9C,UAAU,EAAG;IACjC,gBAAcC,QAAQ,GAAG,MAAM,GAAGM,SAAU;IAC5CgB,KAAK,EAAElB,UAAU,IAAI,IAAI,GACrB;MAAEc,KAAK,EAAEd,UAAU,CAACc,KAAK;MAAEG,MAAM,EAAEjB,UAAU,CAACiB;IAAO,CAAC,GACtDf;EAAU,gBAEdjB,KAAA,CAAAoD,aAAA;IAAQK,GAAG,EAAE5C,SAAU;IAACwC,SAAS,EAAE9C,MAAM,CAACmB;EAAO,CAAE,CAChD,CAAC;AAEV","ignoreList":[]}
@@ -0,0 +1,26 @@
1
+ .thumbnailContainer {
2
+ position: relative;
3
+ cursor: pointer;
4
+ border: 2px solid transparent;
5
+ border-radius: var(--osdk-surface-border-radius);
6
+ box-shadow: var(--osdk-pdf-viewer-page-shadow);
7
+ overflow: hidden;
8
+ transition: border-color var(--osdk-emphasis-transition-duration)
9
+ var(--osdk-emphasis-ease-default);
10
+ }
11
+
12
+ .thumbnailContainer:hover {
13
+ border-color: var(--osdk-pdf-viewer-sidebar-border);
14
+ }
15
+
16
+ .active {
17
+ border-color: var(--osdk-pdf-viewer-sidebar-active-border);
18
+ }
19
+
20
+ .active:hover {
21
+ border-color: var(--osdk-pdf-viewer-sidebar-active-border);
22
+ }
23
+
24
+ .canvas {
25
+ display: block;
26
+ }