@osdk/react-components 0.2.0-beta.21 → 0.2.0-beta.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +14 -97
- package/CHANGELOG.md +35 -0
- package/README.md +23 -7
- package/build/browser/action-form/ActionFormApi.js.map +1 -1
- package/build/browser/action-form/BaseForm.js +18 -5
- package/build/browser/action-form/BaseForm.js.map +1 -1
- package/build/browser/action-form/BaseForm.module.css +38 -0
- package/build/browser/action-form/BaseForm.module.css.js +8 -0
- package/build/browser/action-form/FormField.js +42 -0
- package/build/browser/action-form/FormField.js.map +1 -0
- package/build/browser/action-form/FormField.module.css +41 -0
- package/build/browser/action-form/FormField.module.css.js +10 -0
- package/build/browser/action-form/FormFieldApi.js.map +1 -1
- package/build/browser/action-form/FormHeader.js +26 -0
- package/build/browser/action-form/FormHeader.js.map +1 -0
- package/build/browser/action-form/FormHeader.module.css +26 -0
- package/build/browser/action-form/FormHeader.module.css.js +6 -0
- package/build/browser/action-form/fields/DateCalendar.js +70 -0
- package/build/browser/action-form/fields/DateCalendar.js.map +1 -0
- package/build/browser/action-form/fields/DateCalendar.module.css +136 -0
- package/build/browser/action-form/fields/DateCalendar.module.css.js +22 -0
- package/build/browser/action-form/fields/DatetimePickerField.js +98 -0
- package/build/browser/action-form/fields/DatetimePickerField.js.map +1 -0
- package/build/browser/action-form/fields/DatetimePickerField.module.css +66 -0
- package/build/browser/action-form/fields/DatetimePickerField.module.css.js +10 -0
- package/build/browser/action-form/fields/FormFieldRenderer.js +17 -6
- package/build/browser/action-form/fields/FormFieldRenderer.js.map +1 -1
- package/build/browser/action-form/fields/LazyDateCalendar.js +27 -0
- package/build/browser/action-form/fields/LazyDateCalendar.js.map +1 -0
- package/build/browser/action-form/fields/TextInputField.js +2 -0
- package/build/browser/action-form/fields/TextInputField.js.map +1 -1
- package/build/browser/action-form/fields/TextInputField.module.css +56 -0
- package/build/browser/action-form/fields/TextInputField.module.css.js +6 -0
- package/build/browser/base-components/checkbox/Checkbox.js +2 -2
- package/build/browser/base-components/checkbox/Checkbox.js.map +1 -1
- package/build/browser/base-components/checkbox/Checkbox.module.css +0 -4
- package/build/browser/base-components/combobox/Combobox.js +3 -8
- package/build/browser/base-components/combobox/Combobox.js.map +1 -1
- package/build/browser/base-components/combobox/Combobox.module.css +0 -3
- package/build/browser/base-components/draggable-list/DraggableList.js +2 -4
- package/build/browser/base-components/draggable-list/DraggableList.js.map +1 -1
- package/build/browser/base-components/search-bar/SearchBar.module.css +2 -2
- package/build/browser/base-components/select/Select.js +1 -3
- package/build/browser/base-components/select/Select.js.map +1 -1
- package/build/browser/base-components/select/Select.module.css +0 -2
- package/build/browser/base-components/switch/Switch.module.css +0 -1
- package/build/browser/filter-list/FilterInput.js +14 -5
- package/build/browser/filter-list/FilterInput.js.map +1 -1
- package/build/browser/filter-list/FilterList.js +22 -10
- package/build/browser/filter-list/FilterList.js.map +1 -1
- package/build/browser/filter-list/FilterListApi.js.map +1 -1
- package/build/browser/filter-list/base/AddFilterPopover.js +4 -3
- package/build/browser/filter-list/base/AddFilterPopover.js.map +1 -1
- package/build/browser/filter-list/base/BaseFilterList.js +3 -1
- package/build/browser/filter-list/base/BaseFilterList.js.map +1 -1
- package/build/browser/filter-list/base/BaseFilterListApi.js.map +1 -1
- package/build/browser/filter-list/base/ExcludeDropdown.js +61 -0
- package/build/browser/filter-list/base/ExcludeDropdown.js.map +1 -0
- package/build/browser/filter-list/base/ExcludeDropdown.module.css +94 -0
- package/build/browser/filter-list/base/ExcludeDropdown.module.css.js +12 -0
- package/build/browser/filter-list/base/FilterIcons.js +0 -39
- package/build/browser/filter-list/base/FilterIcons.js.map +1 -1
- package/build/browser/filter-list/base/FilterInputExcludeRow.js +55 -0
- package/build/browser/filter-list/base/FilterInputExcludeRow.js.map +1 -0
- package/build/browser/filter-list/base/FilterListHeader.js +3 -2
- package/build/browser/filter-list/base/FilterListHeader.js.map +1 -1
- package/build/browser/filter-list/base/FilterListItem.js +72 -23
- package/build/browser/filter-list/base/FilterListItem.js.map +1 -1
- package/build/browser/filter-list/base/FilterListItem.module.css +96 -20
- package/build/browser/filter-list/base/FilterListItem.module.css.js +7 -2
- package/build/browser/filter-list/base/inputs/CheckboxListInput.js +2 -2
- package/build/browser/filter-list/base/inputs/CheckboxListInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/ContainsTextInput.js +2 -6
- package/build/browser/filter-list/base/inputs/ContainsTextInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/DateRangeInput.js +1 -1
- package/build/browser/filter-list/base/inputs/DateRangeInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/ListogramInput.js +2 -2
- package/build/browser/filter-list/base/inputs/ListogramInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/MultiDateInput.js +1 -1
- package/build/browser/filter-list/base/inputs/MultiDateInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/RangeInput.js +2 -2
- package/build/browser/filter-list/base/inputs/RangeInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/SingleDateInput.js +1 -1
- package/build/browser/filter-list/base/inputs/SingleDateInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/SingleSelectInput.js +1 -3
- package/build/browser/filter-list/base/inputs/SingleSelectInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/TimelineInput.js +1 -1
- package/build/browser/filter-list/base/inputs/TimelineInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/index.js +1 -1
- package/build/browser/filter-list/base/inputs/index.js.map +1 -1
- package/build/{esm/filter-list/base/inputs/useStaleData.js → browser/filter-list/base/inputs/useStableData.js} +5 -5
- package/build/browser/filter-list/base/inputs/useStableData.js.map +1 -0
- package/build/browser/filter-list/hooks/useFilterListState.js +3 -0
- package/build/browser/filter-list/hooks/useFilterListState.js.map +1 -1
- package/build/browser/filter-list/hooks/useFilterVisibility.js +7 -1
- package/build/browser/filter-list/hooks/useFilterVisibility.js.map +1 -1
- package/build/browser/filter-list/hooks/usePropertyAggregation.js +3 -2
- package/build/browser/filter-list/hooks/usePropertyAggregation.js.map +1 -1
- package/build/browser/filter-list/inputs/CheckboxListFilterInput.js +15 -5
- package/build/browser/filter-list/inputs/CheckboxListFilterInput.js.map +1 -1
- package/build/browser/filter-list/inputs/DateRangeFilterInput.js +10 -6
- package/build/browser/filter-list/inputs/DateRangeFilterInput.js.map +1 -1
- package/build/browser/filter-list/inputs/LinkedPropertyInput.js +41 -18
- package/build/browser/filter-list/inputs/LinkedPropertyInput.js.map +1 -1
- package/build/browser/filter-list/inputs/ListogramFilterInput.js +15 -5
- package/build/browser/filter-list/inputs/ListogramFilterInput.js.map +1 -1
- package/build/browser/filter-list/inputs/MultiSelectFilterInput.js +12 -4
- package/build/browser/filter-list/inputs/MultiSelectFilterInput.js.map +1 -1
- package/build/browser/filter-list/inputs/NumberRangeFilterInput.js +10 -6
- package/build/browser/filter-list/inputs/NumberRangeFilterInput.js.map +1 -1
- package/build/browser/filter-list/inputs/PropertyFilterInput.js +36 -10
- package/build/browser/filter-list/inputs/PropertyFilterInput.js.map +1 -1
- package/build/browser/filter-list/inputs/SingleSelectFilterInput.js +12 -4
- package/build/browser/filter-list/inputs/SingleSelectFilterInput.js.map +1 -1
- package/build/browser/filter-list/inputs/TextTagsFilterInput.js +12 -4
- package/build/browser/filter-list/inputs/TextTagsFilterInput.js.map +1 -1
- package/build/browser/filter-list/utils/filterStateToWhereClause.js +1 -1
- package/build/browser/filter-list/utils/filterStateToWhereClause.js.map +1 -1
- package/build/browser/filter-list/utils/filterValues.js +29 -1
- package/build/browser/filter-list/utils/filterValues.js.map +1 -1
- package/build/browser/object-table/LoadingCell.js +2 -1
- package/build/browser/object-table/LoadingCell.js.map +1 -1
- package/build/browser/object-table/LoadingCell.module.css +3 -21
- package/build/browser/object-table/LoadingCell.module.css.js +1 -2
- package/build/browser/object-table/LoadingStateTable.js +2 -1
- package/build/browser/object-table/LoadingStateTable.js.map +1 -1
- package/build/browser/object-table/MultiColumnSortDialog.js +1 -3
- package/build/browser/object-table/MultiColumnSortDialog.js.map +1 -1
- package/build/browser/object-table/MultiColumnSortDialog.module.css +0 -1
- package/build/browser/object-table/TableCell.module.css +1 -1
- package/build/browser/object-table/TableHeader.module.css +2 -2
- package/build/browser/object-table/TableHeaderWithPopover.js +2 -4
- package/build/browser/object-table/TableHeaderWithPopover.js.map +1 -1
- package/build/browser/object-table/TableHeaderWithPopover.module.css +1 -0
- package/build/browser/pdf-viewer/PdfRenderer.js +1 -1
- package/build/browser/pdf-viewer/PdfRenderer.js.map +1 -1
- package/build/browser/pdf-viewer/PdfViewer.js +59 -118
- package/build/browser/pdf-viewer/PdfViewer.js.map +1 -1
- package/build/browser/pdf-viewer/components/PdfViewerAnnotationLayer.js.map +1 -0
- package/build/{esm/pdf-viewer → browser/pdf-viewer/components}/PdfViewerAnnotationLayer.module.css +0 -1
- package/build/browser/pdf-viewer/components/PdfViewerAnnotationLayer.module.css.js +11 -0
- package/build/browser/pdf-viewer/components/PdfViewerContent.js +113 -0
- package/build/browser/pdf-viewer/components/PdfViewerContent.js.map +1 -0
- package/build/browser/pdf-viewer/components/PdfViewerOutlineSidebar.js +98 -0
- package/build/browser/pdf-viewer/components/PdfViewerOutlineSidebar.js.map +1 -0
- package/build/browser/pdf-viewer/components/PdfViewerOutlineSidebar.module.css +89 -0
- package/build/browser/pdf-viewer/components/PdfViewerOutlineSidebar.module.css.js +15 -0
- package/build/browser/pdf-viewer/components/PdfViewerSearchBar.js.map +1 -0
- package/build/browser/pdf-viewer/components/PdfViewerSearchBar.module.css.js +10 -0
- package/build/browser/pdf-viewer/{PdfViewerSidebar.js → components/PdfViewerSidebar.js} +9 -5
- package/build/browser/pdf-viewer/components/PdfViewerSidebar.js.map +1 -0
- package/build/{esm/pdf-viewer → browser/pdf-viewer/components}/PdfViewerSidebar.module.css +0 -9
- package/build/browser/pdf-viewer/{PdfViewerSidebar.module.css.js → components/PdfViewerSidebar.module.css.js} +5 -6
- package/build/browser/pdf-viewer/components/PdfViewerSidebarHeader.js +54 -0
- package/build/browser/pdf-viewer/components/PdfViewerSidebarHeader.js.map +1 -0
- package/build/browser/pdf-viewer/components/PdfViewerSidebarHeader.module.css +70 -0
- package/build/browser/pdf-viewer/components/PdfViewerSidebarHeader.module.css.js +8 -0
- package/build/browser/pdf-viewer/{PdfViewerThumbnail.js → components/PdfViewerThumbnail.js} +1 -1
- package/build/browser/pdf-viewer/components/PdfViewerThumbnail.js.map +1 -0
- package/build/browser/pdf-viewer/{PdfViewerThumbnail.module.css.js → components/PdfViewerThumbnail.module.css.js} +3 -3
- package/build/browser/pdf-viewer/{PdfViewerToolbar.js → components/PdfViewerToolbar.js} +39 -12
- package/build/browser/pdf-viewer/components/PdfViewerToolbar.js.map +1 -0
- package/build/browser/pdf-viewer/{PdfViewerToolbar.module.css → components/PdfViewerToolbar.module.css} +2 -2
- package/build/browser/pdf-viewer/components/PdfViewerToolbar.module.css.js +12 -0
- package/build/browser/pdf-viewer/constants.js +7 -5
- package/build/browser/pdf-viewer/constants.js.map +1 -1
- package/build/browser/pdf-viewer/hooks/usePdfDocument.js +2 -3
- package/build/browser/pdf-viewer/hooks/usePdfDocument.js.map +1 -1
- package/build/browser/pdf-viewer/hooks/usePdfOutline.js +268 -0
- package/build/browser/pdf-viewer/hooks/usePdfOutline.js.map +1 -0
- package/build/browser/pdf-viewer/hooks/usePdfViewer.js +12 -1
- package/build/browser/pdf-viewer/hooks/usePdfViewer.js.map +1 -1
- package/build/browser/pdf-viewer/hooks/usePdfViewerCore.js +80 -0
- package/build/browser/pdf-viewer/hooks/usePdfViewerCore.js.map +1 -0
- package/build/browser/pdf-viewer/hooks/usePdfViewerState.js +135 -0
- package/build/browser/pdf-viewer/hooks/usePdfViewerState.js.map +1 -0
- package/build/browser/pdf-viewer/types.js.map +1 -1
- package/build/browser/public/experimental.js +23 -2
- package/build/browser/public/experimental.js.map +1 -1
- package/build/browser/public/primitives.js +20 -0
- package/build/browser/public/primitives.js.map +1 -0
- package/build/browser/{filter-list/base/inputs → shared}/dateUtils.js +38 -2
- package/build/browser/shared/dateUtils.js.map +1 -0
- package/build/browser/styles.css +817 -136
- package/build/cjs/DateCalendar-QWGFKD6J.css +113 -0
- package/build/cjs/DateCalendar-QWGFKD6J.css.map +1 -0
- package/build/cjs/DateCalendar-R44GMN3O.cjs +67 -0
- package/build/cjs/DateCalendar-R44GMN3O.cjs.map +1 -0
- package/build/cjs/chunk-GT6IV6LV.cjs +163 -0
- package/build/cjs/chunk-GT6IV6LV.cjs.map +1 -0
- package/build/cjs/chunk-HMQTYQEX.cjs +9 -0
- package/build/cjs/chunk-HMQTYQEX.cjs.map +1 -0
- package/build/cjs/chunk-UZ2E5NRX.cjs +8 -0
- package/build/cjs/chunk-UZ2E5NRX.cjs.map +1 -0
- package/build/cjs/index.cjs +2 -0
- package/build/cjs/public/experimental.cjs +3227 -1848
- package/build/cjs/public/experimental.cjs.map +1 -1
- package/build/cjs/public/experimental.css +650 -172
- package/build/cjs/public/experimental.css.map +1 -1
- package/build/cjs/public/experimental.d.cts +685 -17
- package/build/cjs/public/primitives.cjs +25 -0
- package/build/cjs/public/primitives.cjs.map +1 -0
- package/build/cjs/public/primitives.css +154 -0
- package/build/cjs/public/primitives.css.map +1 -0
- package/build/cjs/public/primitives.d.cts +49 -0
- package/build/esm/action-form/ActionFormApi.js.map +1 -1
- package/build/esm/action-form/BaseForm.js +18 -5
- package/build/esm/action-form/BaseForm.js.map +1 -1
- package/build/esm/action-form/BaseForm.module.css +38 -0
- package/build/esm/action-form/FormField.js +42 -0
- package/build/esm/action-form/FormField.js.map +1 -0
- package/build/esm/action-form/FormField.module.css +41 -0
- package/build/esm/action-form/FormFieldApi.js.map +1 -1
- package/build/esm/action-form/FormHeader.js +26 -0
- package/build/esm/action-form/FormHeader.js.map +1 -0
- package/build/esm/action-form/FormHeader.module.css +26 -0
- package/build/esm/action-form/fields/DateCalendar.js +70 -0
- package/build/esm/action-form/fields/DateCalendar.js.map +1 -0
- package/build/esm/action-form/fields/DateCalendar.module.css +136 -0
- package/build/esm/action-form/fields/DatetimePickerField.js +98 -0
- package/build/esm/action-form/fields/DatetimePickerField.js.map +1 -0
- package/build/esm/action-form/fields/DatetimePickerField.module.css +66 -0
- package/build/esm/action-form/fields/FormFieldRenderer.js +17 -6
- package/build/esm/action-form/fields/FormFieldRenderer.js.map +1 -1
- package/build/esm/action-form/fields/LazyDateCalendar.js +27 -0
- package/build/esm/action-form/fields/LazyDateCalendar.js.map +1 -0
- package/build/esm/action-form/fields/TextInputField.js +2 -0
- package/build/esm/action-form/fields/TextInputField.js.map +1 -1
- package/build/esm/action-form/fields/TextInputField.module.css +56 -0
- package/build/esm/base-components/checkbox/Checkbox.js +2 -2
- package/build/esm/base-components/checkbox/Checkbox.js.map +1 -1
- package/build/esm/base-components/checkbox/Checkbox.module.css +0 -4
- package/build/esm/base-components/combobox/Combobox.js +3 -8
- package/build/esm/base-components/combobox/Combobox.js.map +1 -1
- package/build/esm/base-components/combobox/Combobox.module.css +0 -3
- package/build/esm/base-components/draggable-list/DraggableList.js +2 -4
- package/build/esm/base-components/draggable-list/DraggableList.js.map +1 -1
- package/build/esm/base-components/search-bar/SearchBar.module.css +2 -2
- package/build/esm/base-components/select/Select.js +1 -3
- package/build/esm/base-components/select/Select.js.map +1 -1
- package/build/esm/base-components/select/Select.module.css +0 -2
- package/build/esm/base-components/switch/Switch.module.css +0 -1
- package/build/esm/filter-list/FilterInput.js +14 -5
- package/build/esm/filter-list/FilterInput.js.map +1 -1
- package/build/esm/filter-list/FilterList.js +22 -10
- package/build/esm/filter-list/FilterList.js.map +1 -1
- package/build/esm/filter-list/FilterListApi.js.map +1 -1
- package/build/esm/filter-list/base/AddFilterPopover.js +4 -3
- package/build/esm/filter-list/base/AddFilterPopover.js.map +1 -1
- package/build/esm/filter-list/base/BaseFilterList.js +3 -1
- package/build/esm/filter-list/base/BaseFilterList.js.map +1 -1
- package/build/esm/filter-list/base/BaseFilterListApi.js.map +1 -1
- package/build/esm/filter-list/base/ExcludeDropdown.js +61 -0
- package/build/esm/filter-list/base/ExcludeDropdown.js.map +1 -0
- package/build/esm/filter-list/base/ExcludeDropdown.module.css +94 -0
- package/build/esm/filter-list/base/FilterIcons.js +0 -39
- package/build/esm/filter-list/base/FilterIcons.js.map +1 -1
- package/build/esm/filter-list/base/FilterInputExcludeRow.js +55 -0
- package/build/esm/filter-list/base/FilterInputExcludeRow.js.map +1 -0
- package/build/esm/filter-list/base/FilterListHeader.js +3 -2
- package/build/esm/filter-list/base/FilterListHeader.js.map +1 -1
- package/build/esm/filter-list/base/FilterListItem.js +72 -23
- package/build/esm/filter-list/base/FilterListItem.js.map +1 -1
- package/build/esm/filter-list/base/FilterListItem.module.css +96 -20
- package/build/esm/filter-list/base/inputs/CheckboxListInput.js +2 -2
- package/build/esm/filter-list/base/inputs/CheckboxListInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/ContainsTextInput.js +2 -6
- package/build/esm/filter-list/base/inputs/ContainsTextInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/DateRangeInput.js +1 -1
- package/build/esm/filter-list/base/inputs/DateRangeInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/ListogramInput.js +2 -2
- package/build/esm/filter-list/base/inputs/ListogramInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/MultiDateInput.js +1 -1
- package/build/esm/filter-list/base/inputs/MultiDateInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/RangeInput.js +2 -2
- package/build/esm/filter-list/base/inputs/RangeInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/SingleDateInput.js +1 -1
- package/build/esm/filter-list/base/inputs/SingleDateInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/SingleSelectInput.js +1 -3
- package/build/esm/filter-list/base/inputs/SingleSelectInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/TimelineInput.js +1 -1
- package/build/esm/filter-list/base/inputs/TimelineInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/index.js +1 -1
- package/build/esm/filter-list/base/inputs/index.js.map +1 -1
- package/build/{browser/filter-list/base/inputs/useStaleData.js → esm/filter-list/base/inputs/useStableData.js} +5 -5
- package/build/esm/filter-list/base/inputs/useStableData.js.map +1 -0
- package/build/esm/filter-list/hooks/useFilterListState.js +3 -0
- package/build/esm/filter-list/hooks/useFilterListState.js.map +1 -1
- package/build/esm/filter-list/hooks/useFilterVisibility.js +7 -1
- package/build/esm/filter-list/hooks/useFilterVisibility.js.map +1 -1
- package/build/esm/filter-list/hooks/usePropertyAggregation.js +3 -2
- package/build/esm/filter-list/hooks/usePropertyAggregation.js.map +1 -1
- package/build/esm/filter-list/inputs/CheckboxListFilterInput.js +15 -5
- package/build/esm/filter-list/inputs/CheckboxListFilterInput.js.map +1 -1
- package/build/esm/filter-list/inputs/DateRangeFilterInput.js +10 -6
- package/build/esm/filter-list/inputs/DateRangeFilterInput.js.map +1 -1
- package/build/esm/filter-list/inputs/LinkedPropertyInput.js +41 -18
- package/build/esm/filter-list/inputs/LinkedPropertyInput.js.map +1 -1
- package/build/esm/filter-list/inputs/ListogramFilterInput.js +15 -5
- package/build/esm/filter-list/inputs/ListogramFilterInput.js.map +1 -1
- package/build/esm/filter-list/inputs/MultiSelectFilterInput.js +12 -4
- package/build/esm/filter-list/inputs/MultiSelectFilterInput.js.map +1 -1
- package/build/esm/filter-list/inputs/NumberRangeFilterInput.js +10 -6
- package/build/esm/filter-list/inputs/NumberRangeFilterInput.js.map +1 -1
- package/build/esm/filter-list/inputs/PropertyFilterInput.js +36 -10
- package/build/esm/filter-list/inputs/PropertyFilterInput.js.map +1 -1
- package/build/esm/filter-list/inputs/SingleSelectFilterInput.js +12 -4
- package/build/esm/filter-list/inputs/SingleSelectFilterInput.js.map +1 -1
- package/build/esm/filter-list/inputs/TextTagsFilterInput.js +12 -4
- package/build/esm/filter-list/inputs/TextTagsFilterInput.js.map +1 -1
- package/build/esm/filter-list/utils/filterStateToWhereClause.js +1 -1
- package/build/esm/filter-list/utils/filterStateToWhereClause.js.map +1 -1
- package/build/esm/filter-list/utils/filterValues.js +29 -1
- package/build/esm/filter-list/utils/filterValues.js.map +1 -1
- package/build/esm/object-table/LoadingCell.js +2 -1
- package/build/esm/object-table/LoadingCell.js.map +1 -1
- package/build/esm/object-table/LoadingCell.module.css +3 -21
- package/build/esm/object-table/LoadingStateTable.js +2 -1
- package/build/esm/object-table/LoadingStateTable.js.map +1 -1
- package/build/esm/object-table/MultiColumnSortDialog.js +1 -3
- package/build/esm/object-table/MultiColumnSortDialog.js.map +1 -1
- package/build/esm/object-table/MultiColumnSortDialog.module.css +0 -1
- package/build/esm/object-table/TableCell.module.css +1 -1
- package/build/esm/object-table/TableHeader.module.css +2 -2
- package/build/esm/object-table/TableHeaderWithPopover.js +2 -4
- package/build/esm/object-table/TableHeaderWithPopover.js.map +1 -1
- package/build/esm/object-table/TableHeaderWithPopover.module.css +1 -0
- package/build/esm/pdf-viewer/PdfRenderer.js +1 -1
- package/build/esm/pdf-viewer/PdfRenderer.js.map +1 -1
- package/build/esm/pdf-viewer/PdfViewer.js +59 -118
- package/build/esm/pdf-viewer/PdfViewer.js.map +1 -1
- package/build/esm/pdf-viewer/components/PdfViewerAnnotationLayer.js.map +1 -0
- package/build/{browser/pdf-viewer → esm/pdf-viewer/components}/PdfViewerAnnotationLayer.module.css +0 -1
- package/build/esm/pdf-viewer/components/PdfViewerContent.js +113 -0
- package/build/esm/pdf-viewer/components/PdfViewerContent.js.map +1 -0
- package/build/esm/pdf-viewer/components/PdfViewerOutlineSidebar.js +98 -0
- package/build/esm/pdf-viewer/components/PdfViewerOutlineSidebar.js.map +1 -0
- package/build/esm/pdf-viewer/components/PdfViewerOutlineSidebar.module.css +89 -0
- package/build/esm/pdf-viewer/components/PdfViewerSearchBar.js.map +1 -0
- package/build/esm/pdf-viewer/{PdfViewerSidebar.js → components/PdfViewerSidebar.js} +9 -5
- package/build/esm/pdf-viewer/components/PdfViewerSidebar.js.map +1 -0
- package/build/{browser/pdf-viewer → esm/pdf-viewer/components}/PdfViewerSidebar.module.css +0 -9
- package/build/esm/pdf-viewer/components/PdfViewerSidebarHeader.js +54 -0
- package/build/esm/pdf-viewer/components/PdfViewerSidebarHeader.js.map +1 -0
- package/build/esm/pdf-viewer/components/PdfViewerSidebarHeader.module.css +70 -0
- package/build/esm/pdf-viewer/{PdfViewerThumbnail.js → components/PdfViewerThumbnail.js} +1 -1
- package/build/esm/pdf-viewer/components/PdfViewerThumbnail.js.map +1 -0
- package/build/esm/pdf-viewer/{PdfViewerToolbar.js → components/PdfViewerToolbar.js} +39 -12
- package/build/esm/pdf-viewer/components/PdfViewerToolbar.js.map +1 -0
- package/build/esm/pdf-viewer/{PdfViewerToolbar.module.css → components/PdfViewerToolbar.module.css} +2 -2
- package/build/esm/pdf-viewer/constants.js +7 -5
- package/build/esm/pdf-viewer/constants.js.map +1 -1
- package/build/esm/pdf-viewer/hooks/usePdfDocument.js +2 -3
- package/build/esm/pdf-viewer/hooks/usePdfDocument.js.map +1 -1
- package/build/esm/pdf-viewer/hooks/usePdfOutline.js +268 -0
- package/build/esm/pdf-viewer/hooks/usePdfOutline.js.map +1 -0
- package/build/esm/pdf-viewer/hooks/usePdfViewer.js +12 -1
- package/build/esm/pdf-viewer/hooks/usePdfViewer.js.map +1 -1
- package/build/esm/pdf-viewer/hooks/usePdfViewerCore.js +80 -0
- package/build/esm/pdf-viewer/hooks/usePdfViewerCore.js.map +1 -0
- package/build/esm/pdf-viewer/hooks/usePdfViewerState.js +135 -0
- package/build/esm/pdf-viewer/hooks/usePdfViewerState.js.map +1 -0
- package/build/esm/pdf-viewer/types.js.map +1 -1
- package/build/esm/public/experimental.js +23 -2
- package/build/esm/public/experimental.js.map +1 -1
- package/build/esm/public/primitives.js +20 -0
- package/build/esm/public/primitives.js.map +1 -0
- package/build/esm/{filter-list/base/inputs → shared}/dateUtils.js +38 -2
- package/build/esm/shared/dateUtils.js.map +1 -0
- package/build/types/action-form/ActionFormApi.d.ts +1 -0
- package/build/types/action-form/ActionFormApi.d.ts.map +1 -1
- package/build/types/action-form/BaseForm.d.ts.map +1 -1
- package/build/types/action-form/FormField.d.ts +11 -0
- package/build/types/action-form/FormField.d.ts.map +1 -0
- package/build/types/action-form/FormFieldApi.d.ts +22 -8
- package/build/types/action-form/FormFieldApi.d.ts.map +1 -1
- package/build/types/action-form/FormHeader.d.ts +6 -0
- package/build/types/action-form/FormHeader.d.ts.map +1 -0
- package/build/types/action-form/fields/DateCalendar.d.ts +9 -0
- package/build/types/action-form/fields/DateCalendar.d.ts.map +1 -0
- package/build/types/action-form/fields/DatetimePickerField.d.ts +3 -0
- package/build/types/action-form/fields/DatetimePickerField.d.ts.map +1 -0
- package/build/types/action-form/fields/FormFieldRenderer.d.ts.map +1 -1
- package/build/types/action-form/fields/LazyDateCalendar.d.ts +3 -0
- package/build/types/action-form/fields/LazyDateCalendar.d.ts.map +1 -0
- package/build/types/action-form/fields/TextInputField.d.ts.map +1 -1
- package/build/types/filter-list/FilterInput.d.ts +3 -1
- package/build/types/filter-list/FilterInput.d.ts.map +1 -1
- package/build/types/filter-list/FilterListApi.d.ts +14 -10
- package/build/types/filter-list/FilterListApi.d.ts.map +1 -1
- package/build/types/filter-list/base/AddFilterPopover.d.ts +2 -1
- package/build/types/filter-list/base/AddFilterPopover.d.ts.map +1 -1
- package/build/types/filter-list/base/BaseFilterListApi.d.ts +4 -1
- package/build/types/filter-list/base/BaseFilterListApi.d.ts.map +1 -1
- package/build/types/filter-list/base/ExcludeDropdown.d.ts +8 -0
- package/build/types/filter-list/base/ExcludeDropdown.d.ts.map +1 -0
- package/build/types/filter-list/base/FilterIcons.d.ts +0 -2
- package/build/types/filter-list/base/FilterIcons.d.ts.map +1 -1
- package/build/types/filter-list/base/FilterInputExcludeRow.d.ts +12 -0
- package/build/types/filter-list/base/FilterInputExcludeRow.d.ts.map +1 -0
- package/build/types/filter-list/base/FilterListHeader.d.ts +3 -2
- package/build/types/filter-list/base/FilterListHeader.d.ts.map +1 -1
- package/build/types/filter-list/base/FilterListItem.d.ts.map +1 -1
- package/build/types/filter-list/base/inputs/DateRangeInput.d.ts.map +1 -1
- package/build/types/filter-list/base/inputs/SingleDateInput.d.ts.map +1 -1
- package/build/types/filter-list/base/inputs/index.d.ts +1 -1
- package/build/types/filter-list/base/inputs/index.d.ts.map +1 -1
- package/build/types/filter-list/base/inputs/useStableData.d.ts +1 -0
- package/build/types/filter-list/base/inputs/useStableData.d.ts.map +1 -0
- package/build/types/filter-list/hooks/useFilterVisibility.d.ts +2 -0
- package/build/types/filter-list/hooks/useFilterVisibility.d.ts.map +1 -1
- package/build/types/filter-list/hooks/usePropertyAggregation.d.ts +2 -2
- package/build/types/filter-list/hooks/usePropertyAggregation.d.ts.map +1 -1
- package/build/types/filter-list/inputs/CheckboxListFilterInput.d.ts +5 -2
- package/build/types/filter-list/inputs/CheckboxListFilterInput.d.ts.map +1 -1
- package/build/types/filter-list/inputs/DateRangeFilterInput.d.ts +3 -2
- package/build/types/filter-list/inputs/DateRangeFilterInput.d.ts.map +1 -1
- package/build/types/filter-list/inputs/LinkedPropertyInput.d.ts +2 -1
- package/build/types/filter-list/inputs/LinkedPropertyInput.d.ts.map +1 -1
- package/build/types/filter-list/inputs/ListogramFilterInput.d.ts +5 -2
- package/build/types/filter-list/inputs/ListogramFilterInput.d.ts.map +1 -1
- package/build/types/filter-list/inputs/MultiSelectFilterInput.d.ts +4 -2
- package/build/types/filter-list/inputs/MultiSelectFilterInput.d.ts.map +1 -1
- package/build/types/filter-list/inputs/NumberRangeFilterInput.d.ts +3 -2
- package/build/types/filter-list/inputs/NumberRangeFilterInput.d.ts.map +1 -1
- package/build/types/filter-list/inputs/PropertyFilterInput.d.ts +3 -1
- package/build/types/filter-list/inputs/PropertyFilterInput.d.ts.map +1 -1
- package/build/types/filter-list/inputs/SingleSelectFilterInput.d.ts +4 -2
- package/build/types/filter-list/inputs/SingleSelectFilterInput.d.ts.map +1 -1
- package/build/types/filter-list/inputs/TextTagsFilterInput.d.ts +4 -2
- package/build/types/filter-list/inputs/TextTagsFilterInput.d.ts.map +1 -1
- package/build/types/filter-list/utils/filterValues.d.ts +2 -0
- package/build/types/filter-list/utils/filterValues.d.ts.map +1 -1
- package/build/types/object-table/LoadingCell.d.ts.map +1 -1
- package/build/types/object-table/LoadingStateTable.d.ts.map +1 -1
- package/build/types/pdf-viewer/PdfRenderer.d.ts +2 -2
- package/build/types/pdf-viewer/PdfRenderer.d.ts.map +1 -1
- package/build/types/pdf-viewer/PdfViewer.d.ts +1 -1
- package/build/types/pdf-viewer/PdfViewer.d.ts.map +1 -1
- package/build/types/pdf-viewer/{PdfViewerAnnotationLayer.d.ts → components/PdfViewerAnnotationLayer.d.ts} +2 -3
- package/build/types/pdf-viewer/components/PdfViewerAnnotationLayer.d.ts.map +1 -0
- package/build/types/pdf-viewer/components/PdfViewerContent.d.ts +22 -0
- package/build/types/pdf-viewer/components/PdfViewerContent.d.ts.map +1 -0
- package/build/types/pdf-viewer/components/PdfViewerOutlineSidebar.d.ts +11 -0
- package/build/types/pdf-viewer/components/PdfViewerOutlineSidebar.d.ts.map +1 -0
- package/build/types/pdf-viewer/{PdfViewerSearchBar.d.ts → components/PdfViewerSearchBar.d.ts} +1 -2
- package/build/types/pdf-viewer/components/PdfViewerSearchBar.d.ts.map +1 -0
- package/build/types/pdf-viewer/components/PdfViewerSidebar.d.ts +12 -0
- package/build/types/pdf-viewer/components/PdfViewerSidebar.d.ts.map +1 -0
- package/build/types/pdf-viewer/components/PdfViewerSidebarHeader.d.ts +7 -0
- package/build/types/pdf-viewer/components/PdfViewerSidebarHeader.d.ts.map +1 -0
- package/build/types/pdf-viewer/{PdfViewerThumbnail.d.ts.map → components/PdfViewerThumbnail.d.ts.map} +1 -1
- package/build/types/pdf-viewer/{PdfViewerToolbar.d.ts → components/PdfViewerToolbar.d.ts} +5 -3
- package/build/types/pdf-viewer/components/PdfViewerToolbar.d.ts.map +1 -0
- package/build/types/pdf-viewer/constants.d.ts +5 -0
- package/build/types/pdf-viewer/constants.d.ts.map +1 -1
- package/build/types/pdf-viewer/hooks/usePdfDocument.d.ts.map +1 -1
- package/build/types/pdf-viewer/hooks/usePdfOutline.d.ts +3 -0
- package/build/types/pdf-viewer/hooks/usePdfOutline.d.ts.map +1 -0
- package/build/types/pdf-viewer/hooks/usePdfViewer.d.ts +1 -1
- package/build/types/pdf-viewer/hooks/usePdfViewer.d.ts.map +1 -1
- package/build/types/pdf-viewer/hooks/usePdfViewerCore.d.ts +43 -0
- package/build/types/pdf-viewer/hooks/usePdfViewerCore.d.ts.map +1 -0
- package/build/types/pdf-viewer/hooks/usePdfViewerState.d.ts +39 -0
- package/build/types/pdf-viewer/hooks/usePdfViewerState.d.ts.map +1 -0
- package/build/types/pdf-viewer/types.d.ts +42 -0
- package/build/types/pdf-viewer/types.d.ts.map +1 -1
- package/build/types/public/experimental.d.ts +21 -2
- package/build/types/public/experimental.d.ts.map +1 -1
- package/build/types/public/primitives.d.ts +3 -0
- package/build/types/public/primitives.d.ts.map +1 -0
- package/build/types/shared/dateUtils.d.ts +31 -0
- package/build/types/shared/dateUtils.d.ts.map +1 -0
- package/package.json +14 -4
- package/primitives.d.ts +17 -0
- package/build/browser/filter-list/base/inputs/dateUtils.js.map +0 -1
- package/build/browser/filter-list/base/inputs/useStaleData.js.map +0 -1
- package/build/browser/pdf-viewer/PdfViewerAnnotationLayer.js.map +0 -1
- package/build/browser/pdf-viewer/PdfViewerAnnotationLayer.module.css.js +0 -11
- package/build/browser/pdf-viewer/PdfViewerSearchBar.js.map +0 -1
- package/build/browser/pdf-viewer/PdfViewerSearchBar.module.css.js +0 -10
- package/build/browser/pdf-viewer/PdfViewerSidebar.js.map +0 -1
- package/build/browser/pdf-viewer/PdfViewerThumbnail.js.map +0 -1
- package/build/browser/pdf-viewer/PdfViewerToolbar.js.map +0 -1
- package/build/browser/pdf-viewer/PdfViewerToolbar.module.css.js +0 -12
- package/build/esm/filter-list/base/inputs/dateUtils.js.map +0 -1
- package/build/esm/filter-list/base/inputs/useStaleData.js.map +0 -1
- package/build/esm/pdf-viewer/PdfViewerAnnotationLayer.js.map +0 -1
- package/build/esm/pdf-viewer/PdfViewerSearchBar.js.map +0 -1
- package/build/esm/pdf-viewer/PdfViewerSidebar.js.map +0 -1
- package/build/esm/pdf-viewer/PdfViewerThumbnail.js.map +0 -1
- package/build/esm/pdf-viewer/PdfViewerToolbar.js.map +0 -1
- package/build/types/filter-list/base/inputs/dateUtils.d.ts +0 -17
- package/build/types/filter-list/base/inputs/dateUtils.d.ts.map +0 -1
- package/build/types/filter-list/base/inputs/useStaleData.d.ts +0 -1
- package/build/types/filter-list/base/inputs/useStaleData.d.ts.map +0 -1
- package/build/types/pdf-viewer/PdfViewerAnnotationLayer.d.ts.map +0 -1
- package/build/types/pdf-viewer/PdfViewerSearchBar.d.ts.map +0 -1
- package/build/types/pdf-viewer/PdfViewerSidebar.d.ts +0 -10
- package/build/types/pdf-viewer/PdfViewerSidebar.d.ts.map +0 -1
- package/build/types/pdf-viewer/PdfViewerToolbar.d.ts.map +0 -1
- /package/build/browser/pdf-viewer/{PdfViewerAnnotationLayer.js → components/PdfViewerAnnotationLayer.js} +0 -0
- /package/build/browser/pdf-viewer/{PdfViewerSearchBar.js → components/PdfViewerSearchBar.js} +0 -0
- /package/build/browser/pdf-viewer/{PdfViewerSearchBar.module.css → components/PdfViewerSearchBar.module.css} +0 -0
- /package/build/browser/pdf-viewer/{PdfViewerThumbnail.module.css → components/PdfViewerThumbnail.module.css} +0 -0
- /package/build/esm/pdf-viewer/{PdfViewerAnnotationLayer.js → components/PdfViewerAnnotationLayer.js} +0 -0
- /package/build/esm/pdf-viewer/{PdfViewerSearchBar.js → components/PdfViewerSearchBar.js} +0 -0
- /package/build/esm/pdf-viewer/{PdfViewerSearchBar.module.css → components/PdfViewerSearchBar.module.css} +0 -0
- /package/build/esm/pdf-viewer/{PdfViewerThumbnail.module.css → components/PdfViewerThumbnail.module.css} +0 -0
- /package/build/types/pdf-viewer/{PdfViewerThumbnail.d.ts → components/PdfViewerThumbnail.d.ts} +0 -0
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
/** Which sidebar panel to display when the sidebar is open. */
|
|
3
|
+
export type SidebarMode = "thumbnails" | "outline";
|
|
4
|
+
/** A single item in the PDF document outline (table of contents). */
|
|
5
|
+
export interface OutlineItem {
|
|
6
|
+
title: string;
|
|
7
|
+
depth: number;
|
|
8
|
+
pageNumber: number;
|
|
9
|
+
bold: boolean;
|
|
10
|
+
italic: boolean;
|
|
11
|
+
}
|
|
1
12
|
/** The visual style of an annotation rendered on the PDF. */
|
|
2
13
|
export type AnnotationType = "highlight" | "underline" | "comment" | "pin";
|
|
3
14
|
/** A single annotation positioned on a specific page of the PDF. */
|
|
@@ -20,6 +31,14 @@ export interface PdfAnnotation {
|
|
|
20
31
|
/** Optional color override (CSS color string) */
|
|
21
32
|
color?: string;
|
|
22
33
|
}
|
|
34
|
+
/** Result passed to the {@link PdfViewerProps.onDownload} callback. */
|
|
35
|
+
export type PdfDownloadResult = {
|
|
36
|
+
success: true
|
|
37
|
+
filename: string
|
|
38
|
+
} | {
|
|
39
|
+
success: false
|
|
40
|
+
error: Error
|
|
41
|
+
};
|
|
23
42
|
/** Props for the {@link PdfViewer} component. */
|
|
24
43
|
export interface PdfViewerProps {
|
|
25
44
|
/** PDF source — URL string or ArrayBuffer */
|
|
@@ -33,12 +52,35 @@ export interface PdfViewerProps {
|
|
|
33
52
|
* @returns void
|
|
34
53
|
*/
|
|
35
54
|
onAnnotationClick?: (annotation: PdfAnnotation) => void;
|
|
55
|
+
/**
|
|
56
|
+
* Callback fired when a download completes or fails.
|
|
57
|
+
*
|
|
58
|
+
* @param result - The download result indicating success with the filename, or failure with an error
|
|
59
|
+
* @returns void
|
|
60
|
+
*/
|
|
61
|
+
onDownload?: (result: PdfDownloadResult) => void;
|
|
36
62
|
/** Initial page number (1-indexed, default 1) */
|
|
37
63
|
initialPage?: number;
|
|
38
64
|
/** Initial zoom scale (default 1.0) */
|
|
39
65
|
initialScale?: number;
|
|
40
66
|
/** Whether the sidebar is initially open (default false) */
|
|
41
67
|
initialSidebarOpen?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Whether the download button is shown in the toolbar.
|
|
70
|
+
* @default false
|
|
71
|
+
*/
|
|
72
|
+
enableDownload?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Which sidebar panel to show: thumbnails or document outline.
|
|
75
|
+
* @default "thumbnails"
|
|
76
|
+
*/
|
|
77
|
+
sidebarMode?: SidebarMode;
|
|
78
|
+
/**
|
|
79
|
+
* Custom icon components for each outline depth level (0-indexed).
|
|
80
|
+
* Key 0 = top-level items, 1 = first nesting level, etc.
|
|
81
|
+
* If omitted, no icons are rendered.
|
|
82
|
+
*/
|
|
83
|
+
outlineIcons?: Partial<Record<number, React.ComponentType>>;
|
|
42
84
|
/** Additional CSS class name for the root element */
|
|
43
85
|
className?: string;
|
|
44
86
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";
|
|
1
|
+
{"mappings":"AAgBA,YAAY,WAAW,OAAQ;;AAG/B,YAAY,cAAc,eAAe;;AAGzC,iBAAiB,YAAY;CAC3B;CACA;CACA;CACA;CACA;AACD;;AAGD,YAAY,iBAAiB,cAAc,cAAc,YAAY;;AAGrE,iBAAiB,cAAc;;CAE7B;;CAEA,MAAM;;CAEN;;CAEA,MAAM;EAAE;EAAW;EAAW;EAAe;CAAgB;;CAE7D;;CAEA;AACD;;AAGD,YAAY,oBACR;CAAE,SAAS;CAAM;AAAkB,IACnC;CAAE,SAAS;CAAO,OAAO;AAAO;;AAGpC,iBAAiB,eAAe;;CAE9B,cAAc;;CAEd,cAAc,eAAe;;;;;;;CAO7B,qBAAqBA,YAAY;;;;;;;CAOjC,cAAcC,QAAQ;;CAEtB;;CAEA;;CAEA;;;;;CAKA;;;;;CAKA,cAAc;;;;;;CAMd,eAAe,QAAQ,eAAe,MAAM;;CAE5C;AACD","names":["annotation: PdfAnnotation","result: PdfDownloadResult"],"sources":["../../../src/pdf-viewer/types.ts"],"version":3,"file":"types.d.ts"}
|
|
@@ -12,5 +12,24 @@ export { BaseTable } from "../object-table/Table.js";
|
|
|
12
12
|
export { ColumnConfigDialog } from "../object-table/ColumnConfigDialog.js";
|
|
13
13
|
export type { ColumnConfigDialogProps, ColumnConfigOptions } from "../object-table/ColumnConfigDialog.js";
|
|
14
14
|
export { BasePdfViewer } from "../pdf-viewer/PdfViewer.js";
|
|
15
|
-
export type { AnnotationType, PdfAnnotation, PdfViewerProps } from "../pdf-viewer/types.js";
|
|
16
|
-
export {
|
|
15
|
+
export type { AnnotationType, PdfAnnotation, PdfDownloadResult, PdfViewerProps, SidebarMode } from "../pdf-viewer/types.js";
|
|
16
|
+
export { PdfViewerAnnotationLayer, type PdfViewerAnnotationLayerProps } from "../pdf-viewer/components/PdfViewerAnnotationLayer.js";
|
|
17
|
+
export { PdfViewerContent, type PdfViewerContentProps } from "../pdf-viewer/components/PdfViewerContent.js";
|
|
18
|
+
export { PdfViewerOutlineSidebar, type PdfViewerOutlineSidebarProps } from "../pdf-viewer/components/PdfViewerOutlineSidebar.js";
|
|
19
|
+
export { PdfViewerSearchBar, type PdfViewerSearchBarProps } from "../pdf-viewer/components/PdfViewerSearchBar.js";
|
|
20
|
+
export { PdfViewerSidebar, type PdfViewerSidebarProps } from "../pdf-viewer/components/PdfViewerSidebar.js";
|
|
21
|
+
export { PdfViewerToolbar, type PdfViewerToolbarProps } from "../pdf-viewer/components/PdfViewerToolbar.js";
|
|
22
|
+
export { type AnnotationPortalTarget, usePdfAnnotationPortals } from "../pdf-viewer/hooks/usePdfAnnotationPortals.js";
|
|
23
|
+
export { usePdfDocument } from "../pdf-viewer/hooks/usePdfDocument.js";
|
|
24
|
+
export { usePdfOutline } from "../pdf-viewer/hooks/usePdfOutline.js";
|
|
25
|
+
export { usePdfViewer, type UsePdfViewerResult } from "../pdf-viewer/hooks/usePdfViewer.js";
|
|
26
|
+
export { usePdfViewerSearch, type UsePdfViewerSearchResult } from "../pdf-viewer/hooks/usePdfViewerSearch.js";
|
|
27
|
+
export { usePdfViewerSync } from "../pdf-viewer/hooks/usePdfViewerSync.js";
|
|
28
|
+
export { type OutlineItem } from "../pdf-viewer/types.js";
|
|
29
|
+
export { usePdfViewerCore, type UsePdfViewerCoreOptions, type UsePdfViewerCoreResult } from "../pdf-viewer/hooks/usePdfViewerCore.js";
|
|
30
|
+
export { usePdfViewerState, type UsePdfViewerStateOptions, type UsePdfViewerStateResult } from "../pdf-viewer/hooks/usePdfViewerState.js";
|
|
31
|
+
export { PdfViewer, type PdfViewerMediaProps } from "../pdf-viewer/PdfRenderer.js";
|
|
32
|
+
export { ActionForm } from "../action-form/ActionForm.js";
|
|
33
|
+
export type { ActionFormProps, BaseFormProps, FormError, FormState } from "../action-form/ActionFormApi.js";
|
|
34
|
+
export { BaseForm } from "../action-form/BaseForm.js";
|
|
35
|
+
export type { ActionParameters, BaseFormFieldProps, CustomFieldProps, DatetimePickerFieldProps, DropdownFieldProps, FieldComponent, FieldValueType, FilePickerProps, FormFieldDefinition, FormFieldPropsByType, NumberInputFieldProps, ObjectSetFieldProps, Option, RadioButtonsFieldProps, RendererFieldDefinition, TextAreaFieldProps, TextInputFieldProps } from "../action-form/FormFieldApi.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,SAAS,sBAAsB;AAC/B,cACE,qBACA,yBACK;AACP,SAAS,kBAAkB;AAE3B,cACE,uBACA,uBACK;AACP,cACE,qBACA,qBACA,aACA,gCACK;AACP,SACE,yBACA,6BACK;AAGP,SAAS,mBAAmB;AAC5B,cACE,kBACA,yBACA,qBACA,uBACA,kBACA,uBACA,wBACK;AACP,cAAc,oBAAoB;AAGlC,cAAc,sBAAsB;AACpC,SAAS,iBAAiB;AAE1B,SAAS,0BAA0B;AACnC,cACE,yBACA,2BACK;AAGP,SAAS,qBAAqB;AAC9B,cACE,gBACA,eACA,
|
|
1
|
+
{"mappings":"AAgBA,SAAS,sBAAsB;AAC/B,cACE,qBACA,yBACK;AACP,SAAS,kBAAkB;AAE3B,cACE,uBACA,uBACK;AACP,cACE,qBACA,qBACA,aACA,gCACK;AACP,SACE,yBACA,6BACK;AAGP,SAAS,mBAAmB;AAC5B,cACE,kBACA,yBACA,qBACA,uBACA,kBACA,uBACA,wBACK;AACP,cAAc,oBAAoB;AAGlC,cAAc,sBAAsB;AACpC,SAAS,iBAAiB;AAE1B,SAAS,0BAA0B;AACnC,cACE,yBACA,2BACK;AAGP,SAAS,qBAAqB;AAC9B,cACE,gBACA,eACA,mBACA,gBACA,mBACK;AAGP,SACE,+BACK,qCACA;AACP,SACE,uBACK,6BACA;AACP,SACE,8BACK,oCACA;AACP,SACE,yBACK,+BACA;AACP,SACE,uBACK,6BACA;AACP,SACE,uBACK,6BACA;AAGP,cACO,wBACL,+BACK;AACP,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SACE,mBACK,0BACA;AACP,SACE,yBACK,gCACA;AACP,SAAS,wBAAwB;AACjC,cAAc,mBAAmB;AAGjC,SACE,uBACK,8BACA,8BACA;AACP,SACE,wBACK,+BACA,+BACA;AAGP,SACE,gBACK,2BACA;AAEP,SAAS,kBAAkB;AAC3B,cACE,iBACA,eACA,WACA,iBACK;AACP,SAAS,gBAAgB;AACzB,cACE,kBACA,oBACA,kBACA,0BACA,oBACA,gBACA,gBACA,iBACA,qBACA,sBACA,uBACA,qBACA,QACA,wBACA,yBACA,oBACA,2BACK","names":[],"sources":["../../../src/public/experimental.ts"],"version":3,"file":"experimental.d.ts"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { ActionButton, type ButtonProps } from "../base-components/action-button/ActionButton.js";
|
|
2
|
+
export { Dialog, type DialogProps } from "../base-components/dialog/Dialog.js";
|
|
3
|
+
export { Tooltip, TooltipArrow, type TooltipProps } from "../base-components/tooltip/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,SACE,mBACK,mBACA;AACP,SAAS,aAAa,mBAAmB;AACzC,SACE,SACA,mBACK,oBACA","names":[],"sources":["../../../src/public/primitives.ts"],"version":3,"file":"primitives.d.ts"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Date utilities for HTML date inputs.
|
|
3
|
+
*
|
|
4
|
+
* These functions operate on local time by design. HTML <input type="date">
|
|
5
|
+
* returns and expects values in "YYYY-MM-DD" format without timezone info.
|
|
6
|
+
*
|
|
7
|
+
* `parseDateFromInput` appends "T00:00:00" (no "Z") so the date is parsed as
|
|
8
|
+
* local midnight rather than UTC midnight. Without this, negative-offset
|
|
9
|
+
* timezones (e.g. US timezones) would shift "2024-01-15" to Jan 14 locally.
|
|
10
|
+
*
|
|
11
|
+
* Consumers providing dates from an API (typically UTC) should handle
|
|
12
|
+
* UTC-to-local conversion before passing values to these functions.
|
|
13
|
+
*/
|
|
14
|
+
export declare function formatDateForInput(date: Date | undefined | null): string;
|
|
15
|
+
/** Formats the time portion of a Date as "HH:mm". */
|
|
16
|
+
export declare function formatTime(date: Date): string;
|
|
17
|
+
export declare function parseDateFromInput(value: string | undefined | null): Date | undefined;
|
|
18
|
+
export declare function formatDatetimeForInput(date: Date | undefined | null): string;
|
|
19
|
+
/**
|
|
20
|
+
* Parses a datetime-local input string (e.g. "2024-01-15T14:30") into a Date.
|
|
21
|
+
* Delegates to `parseDateFromISO` since the parsing logic is identical for
|
|
22
|
+
* string inputs — datetime-local strings already include the time component
|
|
23
|
+
* and have no "Z" suffix, so `new Date()` parses them as local time.
|
|
24
|
+
*/
|
|
25
|
+
export declare function parseDatetimeFromInput(value: string | undefined | null): Date | undefined;
|
|
26
|
+
export declare function formatDateForDisplay(date: Date | undefined | null, fallback?: string): string;
|
|
27
|
+
/** Formats a Date as "2024-06-15 14:30" — space-separated, more readable than T. */
|
|
28
|
+
export declare function formatDatetimeForDisplay(date: Date | undefined | null): string;
|
|
29
|
+
/** Parses space-separated ("2024-06-15 14:30") or T-separated datetime strings. */
|
|
30
|
+
export declare function parseDatetimeFromDisplay(value: string | undefined | null): Date | undefined;
|
|
31
|
+
export declare function parseDateFromISO(value: string | Date | undefined | null): Date | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;AA8BA,OAAO,iBAAS,mBAAmBA,MAAM;;AASzC,OAAO,iBAAS,WAAWC,MAAM;AAMjC,OAAO,iBAAS,mBACdC,mCACC;AAMH,OAAO,iBAAS,uBACdF,MAAM;;;;;;;AAYR,OAAO,iBAAS,uBACdE,mCACC;AAKH,OAAO,iBAAS,qBACdF,MAAM,yBACNG;;AAWF,OAAO,iBAAS,yBACdH,MAAM;;AAOR,OAAO,iBAAS,yBACdE,mCACC;AAOH,OAAO,iBAAS,iBACdE,gBAAgB,0BACf","names":["date: Date | undefined | null","date: Date","value: string | undefined | null","fallback: string","value: string | Date | undefined | null"],"sources":["../../../src/shared/dateUtils.ts"],"version":3,"file":"dateUtils.d.ts"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/react-components",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.23",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,6 +25,15 @@
|
|
|
25
25
|
"require": "./build/cjs/public/experimental.cjs",
|
|
26
26
|
"default": "./build/browser/public/experimental.js"
|
|
27
27
|
},
|
|
28
|
+
"./primitives": {
|
|
29
|
+
"browser": "./build/browser/public/primitives.js",
|
|
30
|
+
"import": {
|
|
31
|
+
"types": "./build/types/public/primitives.d.ts",
|
|
32
|
+
"default": "./build/esm/public/primitives.js"
|
|
33
|
+
},
|
|
34
|
+
"require": "./build/cjs/public/primitives.cjs",
|
|
35
|
+
"default": "./build/browser/public/primitives.js"
|
|
36
|
+
},
|
|
28
37
|
"./styles.css": "./build/browser/styles.css",
|
|
29
38
|
"./*": {
|
|
30
39
|
"browser": "./build/browser/public/*.js",
|
|
@@ -46,6 +55,7 @@
|
|
|
46
55
|
"@tanstack/react-virtual": "^3.13.13",
|
|
47
56
|
"lodash-es": "^4.17.21",
|
|
48
57
|
"pdfjs-dist": "^4.9.155",
|
|
58
|
+
"react-day-picker": "^9.0.0",
|
|
49
59
|
"react-hook-form": "^7.54.0"
|
|
50
60
|
},
|
|
51
61
|
"peerDependencies": {
|
|
@@ -68,11 +78,11 @@
|
|
|
68
78
|
"react": "^18.3.1",
|
|
69
79
|
"react-dom": "^18.3.1",
|
|
70
80
|
"typescript": "~5.5.4",
|
|
81
|
+
"@osdk/api": "2.8.0-beta.27",
|
|
71
82
|
"@osdk/monorepo.api-extractor": "~0.7.0-beta.1",
|
|
72
|
-
"@osdk/api": "2.8.0-beta.24",
|
|
73
|
-
"@osdk/client": "2.8.0-beta.24",
|
|
74
83
|
"@osdk/monorepo.tsconfig": "~0.7.0-beta.1",
|
|
75
|
-
"@osdk/
|
|
84
|
+
"@osdk/client": "2.8.0-beta.27",
|
|
85
|
+
"@osdk/react": "0.10.0-beta.11"
|
|
76
86
|
},
|
|
77
87
|
"publishConfig": {
|
|
78
88
|
"access": "public"
|
package/primitives.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 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
|
+
export * from "./build/types/public/primitives.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dateUtils.js","names":["formatDateForInput","date","year","getFullYear","month","String","getMonth","padStart","day","getDate","parseDateFromInput","value","undefined","Date","isNaN","getTime","formatDateForDisplay","fallback","toLocaleDateString","parseDateFromISO"],"sources":["dateUtils.ts"],"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\n/**\n * Date utilities for HTML date inputs.\n *\n * These functions operate on local time by design. HTML <input type=\"date\">\n * returns and expects values in \"YYYY-MM-DD\" format without timezone info.\n *\n * `parseDateFromInput` appends \"T00:00:00\" (no \"Z\") so the date is parsed as\n * local midnight rather than UTC midnight. Without this, negative-offset\n * timezones (e.g. US timezones) would shift \"2024-01-15\" to Jan 14 locally.\n *\n * Consumers providing dates from an API (typically UTC) should handle\n * UTC-to-local conversion before passing values to these functions.\n */\n\nexport function formatDateForInput(date: Date | undefined): string {\n if (!date) return \"\";\n const year = date.getFullYear();\n const month = String(date.getMonth() + 1).padStart(2, \"0\");\n const day = String(date.getDate()).padStart(2, \"0\");\n return `${year}-${month}-${day}`;\n}\n\nexport function parseDateFromInput(value: string): Date | undefined {\n if (!value) return undefined;\n const date = new Date(value + \"T00:00:00\");\n return isNaN(date.getTime()) ? undefined : date;\n}\n\nexport function formatDateForDisplay(\n date: Date | undefined,\n fallback: string = \"\",\n): string {\n if (!date) return fallback;\n return date.toLocaleDateString(undefined, {\n year: \"numeric\",\n month: \"short\",\n day: \"numeric\",\n });\n}\n\nexport function parseDateFromISO(\n value: string | Date | undefined | null,\n): Date | undefined {\n if (value == null) return undefined;\n if (value instanceof Date) return value;\n const date = new Date(value);\n return isNaN(date.getTime()) ? undefined : date;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASA,kBAAkBA,CAACC,IAAsB,EAAU;EACjE,IAAI,CAACA,IAAI,EAAE,OAAO,EAAE;EACpB,MAAMC,IAAI,GAAGD,IAAI,CAACE,WAAW,CAAC,CAAC;EAC/B,MAAMC,KAAK,GAAGC,MAAM,CAACJ,IAAI,CAACK,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;EAC1D,MAAMC,GAAG,GAAGH,MAAM,CAACJ,IAAI,CAACQ,OAAO,CAAC,CAAC,CAAC,CAACF,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;EACnD,OAAO,GAAGL,IAAI,IAAIE,KAAK,IAAII,GAAG,EAAE;AAClC;AAEA,OAAO,SAASE,kBAAkBA,CAACC,KAAa,EAAoB;EAClE,IAAI,CAACA,KAAK,EAAE,OAAOC,SAAS;EAC5B,MAAMX,IAAI,GAAG,IAAIY,IAAI,CAACF,KAAK,GAAG,WAAW,CAAC;EAC1C,OAAOG,KAAK,CAACb,IAAI,CAACc,OAAO,CAAC,CAAC,CAAC,GAAGH,SAAS,GAAGX,IAAI;AACjD;AAEA,OAAO,SAASe,oBAAoBA,CAClCf,IAAsB,EACtBgB,QAAgB,GAAG,EAAE,EACb;EACR,IAAI,CAAChB,IAAI,EAAE,OAAOgB,QAAQ;EAC1B,OAAOhB,IAAI,CAACiB,kBAAkB,CAACN,SAAS,EAAE;IACxCV,IAAI,EAAE,SAAS;IACfE,KAAK,EAAE,OAAO;IACdI,GAAG,EAAE;EACP,CAAC,CAAC;AACJ;AAEA,OAAO,SAASW,gBAAgBA,CAC9BR,KAAuC,EACrB;EAClB,IAAIA,KAAK,IAAI,IAAI,EAAE,OAAOC,SAAS;EACnC,IAAID,KAAK,YAAYE,IAAI,EAAE,OAAOF,KAAK;EACvC,MAAMV,IAAI,GAAG,IAAIY,IAAI,CAACF,KAAK,CAAC;EAC5B,OAAOG,KAAK,CAACb,IAAI,CAACc,OAAO,CAAC,CAAC,CAAC,GAAGH,SAAS,GAAGX,IAAI;AACjD","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useStaleData.js","names":["useRef","useStaleData","data","isLoading","ref","current"],"sources":["useStaleData.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { useRef } from \"react\";\n\n// TODO: revisit whether this hook is necessary. It may be possible to handle\n// loading states inline (render data if present, show skeleton if loading)\n// instead of preserving stale data in a ref.\nexport function useStaleData<T>(data: T, isLoading: boolean): T {\n const ref = useRef(data);\n if (!isLoading) {\n ref.current = data;\n }\n return ref.current;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,QAAQ,OAAO;;AAE9B;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAAIC,IAAO,EAAEC,SAAkB,EAAK;EAC9D,MAAMC,GAAG,GAAGJ,MAAM,CAACE,IAAI,CAAC;EACxB,IAAI,CAACC,SAAS,EAAE;IACdC,GAAG,CAACC,OAAO,GAAGH,IAAI;EACpB;EACA,OAAOE,GAAG,CAACC,OAAO;AACpB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
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,WAA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AC6B,CAAC,EAAsB;EACpD,oBACElC,KAAA,CAAAyB,aAAA;IAAKF,SAAS,EAAEpB,MAAM,CAACgC;EAAgB,GACpCF,WAAW,CAACG,GAAG,CAAE/B,UAAU,iBAC1BL,KAAA,CAAAyB,aAAA,CAACrB,cAAc;IACbQ,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":[]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// CSS Module proxy for PdfViewerAnnotationLayer.module.css
|
|
2
|
-
const styles = {
|
|
3
|
-
"annotationLayer": "PdfViewerAnnotationLayer-module__annotationLayer___9qNMaJ-S",
|
|
4
|
-
"annotation": "PdfViewerAnnotationLayer-module__annotation___5hTAzm8w",
|
|
5
|
-
"highlight": "PdfViewerAnnotationLayer-module__highlight___hu-LZv1e",
|
|
6
|
-
"underline": "PdfViewerAnnotationLayer-module__underline___SjTKjwwv",
|
|
7
|
-
"comment": "PdfViewerAnnotationLayer-module__comment___darli8TU",
|
|
8
|
-
"pin": "PdfViewerAnnotationLayer-module__pin___VeZrPTVU"
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export default styles;
|
|
@@ -1 +0,0 @@
|
|
|
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,OAAOC,KAAK,IAAIC,WAAW,QAAQ,OAAO;AAC1C,OAAOC,MAAM,MAAM,iCAAiC;AAYpD,OAAO,SAASC,kBAAkBA,CAAC;EACjCC,KAAK;EACLC,YAAY;EACZC,iBAAiB;EACjBC,aAAa;EACbC,MAAM;EACNC,MAAM;EACNC;AACuB,CAAC,EAAsB;EAC9C,MAAMC,iBAAiB,GAAGV,WAAW,CAClCW,CAAsC,IAAK;IAC1CL,aAAa,CAACK,CAAC,CAACC,MAAM,CAACC,KAAK,CAAC;EAC/B,CAAC,EACD,CAACP,aAAa,CAChB,CAAC;EAED,MAAMQ,aAAa,GAAGd,WAAW,CAC9BW,CAAsB,IAAK;IAC1B,IAAIA,CAAC,CAACI,GAAG,KAAK,OAAO,EAAE;MACrBJ,CAAC,CAACK,cAAc,CAAC,CAAC;MAClB,IAAIL,CAAC,CAACM,QAAQ,EAAE;QACdT,MAAM,CAAC,CAAC;MACV,CAAC,MAAM;QACLD,MAAM,CAAC,CAAC;MACV;IACF,CAAC,MAAM,IAAII,CAAC,CAACI,GAAG,KAAK,QAAQ,EAAE;MAC7BJ,CAAC,CAACK,cAAc,CAAC,CAAC;MAClBP,OAAO,CAAC,CAAC;IACX;EACF,CAAC,EACD,CAACF,MAAM,EAAEC,MAAM,EAAEC,OAAO,CAC1B,CAAC;EAED,MAAMS,YAAY,GAAGd,YAAY,GAAG,CAAC,G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cAAc;IACzBgB,IAAI,EAAC;EAAQ,gBAEb1B,KAAA,CAAAqB,aAAA,CAACtB,KAAK;IAACmC,IAAI,EAAE;EAAG,CAAE,CACZ,CACL,CAAC;AAEV","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// CSS Module proxy for PdfViewerSearchBar.module.css
|
|
2
|
-
const styles = {
|
|
3
|
-
"searchBar": "PdfViewerSearchBar-module__searchBar___UR3IbGXb",
|
|
4
|
-
"searchInput": "PdfViewerSearchBar-module__searchInput___uGexyYcH",
|
|
5
|
-
"matchCount": "PdfViewerSearchBar-module__matchCount___np-TCNhQ",
|
|
6
|
-
"navButton": "PdfViewerSearchBar-module__navButton___WhEoIW0p",
|
|
7
|
-
"closeButton": "PdfViewerSearchBar-module__closeButton___Sgtlmr-- PdfViewerSearchBar-module__navButton___WhEoIW0p"
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export default styles;
|
|
@@ -1 +0,0 @@
|
|
|
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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AAG,EAAEhB,kBAAmB;IAACa,SAAS,EAAEpB,MAAM,CAACwB;EAAgB,gBAC9D9B,KAAA,CAAAyB,aAAA;IACEC,SAAS,EAAEpB,MAAM,CAACyB,mBAAoB;IACtCC,KAAK,EAAE;MAAEC,MAAM,EAAEhB,WAAW,CAACiB,YAAY,CAAC;IAAE;EAAE,GAE7CjB,WAAW,CAACkB,eAAe,CAAC,CAAC,CAACC,GAAG,CAAEC,WAAW,IAAK;IAClD,MAAMC,UAAU,GAAGD,WAAW,CAACE,KAAK,GAAG,CAAC;IACxC,oBACEvC,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":[]}
|
|
@@ -1 +0,0 @@
|
|
|
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,kBAAkB,EAAEC,eAAe,QAAQ,gBAAgB;AACpE,OAAOC,MAAM,MAAM,iCAAiC;AASpD,OAAO,SAASC,kBAAkBA,CAAC;EACjCC,QAAQ;EACRC,UAAU;EACVC,QAAQ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ACrB,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":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PdfViewerToolbar.js","names":["Input","ChevronLeft","ChevronRight","Download","Menu","Minus","Plus","Search","React","useCallback","useEffect","useState","MAX_SCALE","MIN_SCALE","SCALE_STEP","styles","PdfViewerToolbar","currentPage","numPages","scale","sidebarOpen","onPageChange","onScaleChange","onSearchOpen","onSidebarToggle","onDownload","pageInputValue","setPageInputValue","String","handlePrevPage","newPage","handleNextPage","handlePageInputChange","e","target","value","handlePageInputKeyDown","key","page","parseInt","isNaN","handlePageInputBlur","handleZoomIn","newScale","Math","min","handleZoomOut","max","scalePercent","round","createElement","className","toolbar","toolbarButton","onClick","title","type","size","separator","toolbarGroup","disabled","pageInput","onChange","onKeyDown","onBlur","pageCount","scaleDisplay"],"sources":["PdfViewerToolbar.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 { Input } from \"@base-ui/react/input\";\nimport {\n ChevronLeft,\n ChevronRight,\n Download,\n Menu,\n Minus,\n Plus,\n Search,\n} from \"@blueprintjs/icons\";\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport { MAX_SCALE, MIN_SCALE, SCALE_STEP } from \"./constants.js\";\nimport styles from \"./PdfViewerToolbar.module.css\";\n\ninterface PdfViewerToolbarProps {\n currentPage: number;\n numPages: number;\n scale: number;\n sidebarOpen: boolean;\n onPageChange: (page: number) => void;\n onScaleChange: (scale: number) => void;\n onSearchOpen: () => void;\n onSidebarToggle: () => void;\n onDownload: () => void;\n}\n\nexport function PdfViewerToolbar({\n currentPage,\n numPages,\n scale,\n sidebarOpen,\n onPageChange,\n onScaleChange,\n onSearchOpen,\n onSidebarToggle,\n onDownload,\n}: PdfViewerToolbarProps): React.ReactElement {\n const [pageInputValue, setPageInputValue] = useState(String(currentPage));\n\n // Sync input display when currentPage changes from scrolling\n useEffect(function syncPageInput() {\n setPageInputValue(String(currentPage));\n }, [currentPage]);\n\n const handlePrevPage = useCallback(() => {\n if (currentPage > 1) {\n const newPage = currentPage - 1;\n onPageChange(newPage);\n setPageInputValue(String(newPage));\n }\n }, [currentPage, onPageChange]);\n\n const handleNextPage = useCallback(() => {\n if (currentPage < numPages) {\n const newPage = currentPage + 1;\n onPageChange(newPage);\n setPageInputValue(String(newPage));\n }\n }, [currentPage, numPages, onPageChange]);\n\n const handlePageInputChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n setPageInputValue(e.target.value);\n },\n [],\n );\n\n const handlePageInputKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === \"Enter\") {\n const page = parseInt(pageInputValue, 10);\n if (!isNaN(page) && page >= 1 && page <= numPages) {\n onPageChange(page);\n } else {\n setPageInputValue(String(currentPage));\n }\n }\n },\n [pageInputValue, numPages, onPageChange, currentPage],\n );\n\n const handlePageInputBlur = useCallback(() => {\n setPageInputValue(String(currentPage));\n }, [currentPage]);\n\n const handleZoomIn = useCallback(() => {\n const newScale = Math.min(scale + SCALE_STEP, MAX_SCALE);\n onScaleChange(newScale);\n }, [scale, onScaleChange]);\n\n const handleZoomOut = useCallback(() => {\n const newScale = Math.max(scale - SCALE_STEP, MIN_SCALE);\n onScaleChange(newScale);\n }, [scale, onScaleChange]);\n\n const scalePercent = `${Math.round(scale * 100)}%`;\n\n return (\n <div className={styles.toolbar}>\n <button\n className={styles.toolbarButton}\n onClick={onSidebarToggle}\n aria-label={sidebarOpen ? \"Close sidebar\" : \"Open sidebar\"}\n title={sidebarOpen ? \"Close sidebar\" : \"Open sidebar\"}\n aria-pressed={sidebarOpen}\n type=\"button\"\n >\n <Menu size={16} />\n </button>\n\n <div className={styles.separator} />\n\n <div className={styles.toolbarGroup}>\n <button\n className={styles.toolbarButton}\n onClick={handlePrevPage}\n disabled={currentPage <= 1}\n aria-label=\"Previous page\"\n title=\"Previous page\"\n type=\"button\"\n >\n <ChevronLeft size={16} />\n </button>\n <Input\n className={styles.pageInput}\n type=\"text\"\n value={pageInputValue}\n onChange={handlePageInputChange}\n onKeyDown={handlePageInputKeyDown}\n onBlur={handlePageInputBlur}\n aria-label=\"Page number\"\n />\n <span className={styles.pageCount}>of {numPages}</span>\n <button\n className={styles.toolbarButton}\n onClick={handleNextPage}\n disabled={currentPage >= numPages}\n aria-label=\"Next page\"\n title=\"Next page\"\n type=\"button\"\n >\n <ChevronRight size={16} />\n </button>\n </div>\n\n <div className={styles.separator} />\n\n <div className={styles.toolbarGroup}>\n <button\n className={styles.toolbarButton}\n onClick={handleZoomOut}\n disabled={scale <= MIN_SCALE}\n aria-label=\"Zoom out\"\n title=\"Zoom out\"\n type=\"button\"\n >\n <Minus size={16} />\n </button>\n <span className={styles.scaleDisplay}>{scalePercent}</span>\n <button\n className={styles.toolbarButton}\n onClick={handleZoomIn}\n disabled={scale >= MAX_SCALE}\n aria-label=\"Zoom in\"\n title=\"Zoom in\"\n type=\"button\"\n >\n <Plus size={16} />\n </button>\n </div>\n\n <div className={styles.separator} />\n\n <button\n className={styles.toolbarButton}\n onClick={onSearchOpen}\n aria-label=\"Search\"\n title=\"Search\"\n type=\"button\"\n >\n <Search size={16} />\n </button>\n\n <div className={styles.separator} />\n\n <button\n className={styles.toolbarButton}\n onClick={onDownload}\n aria-label=\"Download\"\n title=\"Download\"\n type=\"button\"\n >\n <Download 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,KAAK,QAAQ,sBAAsB;AAC5C,SACEC,WAAW,EACXC,YAAY,EACZC,QAAQ,EACRC,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,MAAM,QACD,oBAAoB;AAC3B,OAAOC,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC/D,SAASC,SAAS,EAAEC,SAAS,EAAEC,UAAU,QAAQ,gBAAgB;AACjE,OAAOC,MAAM,MAAM,+BAA+B;AAclD,OAAO,SAASC,gBAAgBA,CAAC;EAC/BC,WAAW;EACXC,QAAQ;EACRC,KAAK;EACLC,WAAW;EACXC,YAAY;EACZC,aAAa;EACbC,YAAY;EACZC,eAAe;EACfC;AACqB,CAAC,EAAsB;EAC5C,MAAM,CAACC,cAAc,EAAEC,iBAAiB,CAAC,GAAGhB,QAAQ,CAACiB,MAAM,CAACX,WAAW,CAAC,CAAC;;EAEzE;EACAP,SAAS,CAAC,YAAyB;IACjCiB,iBAAiB,CAACC,MAAM,CAACX,WAAW,CAAC,CAAC;EACxC,CAAC,EAAE,CAACA,WAAW,CAAC,CAAC;EAEjB,MAAMY,cAAc,GAAGpB,WAAW,CAAC,MAAM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1
|
-
// CSS Module proxy for PdfViewerToolbar.module.css
|
|
2
|
-
const styles = {
|
|
3
|
-
"toolbar": "PdfViewerToolbar-module__toolbar___mMEUJkpy",
|
|
4
|
-
"toolbarGroup": "PdfViewerToolbar-module__toolbarGroup___JQ8lhuSw",
|
|
5
|
-
"separator": "PdfViewerToolbar-module__separator___B7J-o2nO",
|
|
6
|
-
"toolbarButton": "PdfViewerToolbar-module__toolbarButton___VPja8Zmi",
|
|
7
|
-
"pageInput": "PdfViewerToolbar-module__pageInput___TOvquG6P",
|
|
8
|
-
"pageCount": "PdfViewerToolbar-module__pageCount___koZz4nUT",
|
|
9
|
-
"scaleDisplay": "PdfViewerToolbar-module__scaleDisplay___JpCw8z-e"
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export default styles;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dateUtils.js","names":["formatDateForInput","date","year","getFullYear","month","String","getMonth","padStart","day","getDate","parseDateFromInput","value","undefined","Date","isNaN","getTime","formatDateForDisplay","fallback","toLocaleDateString","parseDateFromISO"],"sources":["dateUtils.ts"],"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\n/**\n * Date utilities for HTML date inputs.\n *\n * These functions operate on local time by design. HTML <input type=\"date\">\n * returns and expects values in \"YYYY-MM-DD\" format without timezone info.\n *\n * `parseDateFromInput` appends \"T00:00:00\" (no \"Z\") so the date is parsed as\n * local midnight rather than UTC midnight. Without this, negative-offset\n * timezones (e.g. US timezones) would shift \"2024-01-15\" to Jan 14 locally.\n *\n * Consumers providing dates from an API (typically UTC) should handle\n * UTC-to-local conversion before passing values to these functions.\n */\n\nexport function formatDateForInput(date: Date | undefined): string {\n if (!date) return \"\";\n const year = date.getFullYear();\n const month = String(date.getMonth() + 1).padStart(2, \"0\");\n const day = String(date.getDate()).padStart(2, \"0\");\n return `${year}-${month}-${day}`;\n}\n\nexport function parseDateFromInput(value: string): Date | undefined {\n if (!value) return undefined;\n const date = new Date(value + \"T00:00:00\");\n return isNaN(date.getTime()) ? undefined : date;\n}\n\nexport function formatDateForDisplay(\n date: Date | undefined,\n fallback: string = \"\",\n): string {\n if (!date) return fallback;\n return date.toLocaleDateString(undefined, {\n year: \"numeric\",\n month: \"short\",\n day: \"numeric\",\n });\n}\n\nexport function parseDateFromISO(\n value: string | Date | undefined | null,\n): Date | undefined {\n if (value == null) return undefined;\n if (value instanceof Date) return value;\n const date = new Date(value);\n return isNaN(date.getTime()) ? undefined : date;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASA,kBAAkBA,CAACC,IAAsB,EAAU;EACjE,IAAI,CAACA,IAAI,EAAE,OAAO,EAAE;EACpB,MAAMC,IAAI,GAAGD,IAAI,CAACE,WAAW,CAAC,CAAC;EAC/B,MAAMC,KAAK,GAAGC,MAAM,CAACJ,IAAI,CAACK,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;EAC1D,MAAMC,GAAG,GAAGH,MAAM,CAACJ,IAAI,CAACQ,OAAO,CAAC,CAAC,CAAC,CAACF,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;EACnD,OAAO,GAAGL,IAAI,IAAIE,KAAK,IAAII,GAAG,EAAE;AAClC;AAEA,OAAO,SAASE,kBAAkBA,CAACC,KAAa,EAAoB;EAClE,IAAI,CAACA,KAAK,EAAE,OAAOC,SAAS;EAC5B,MAAMX,IAAI,GAAG,IAAIY,IAAI,CAACF,KAAK,GAAG,WAAW,CAAC;EAC1C,OAAOG,KAAK,CAACb,IAAI,CAACc,OAAO,CAAC,CAAC,CAAC,GAAGH,SAAS,GAAGX,IAAI;AACjD;AAEA,OAAO,SAASe,oBAAoBA,CAClCf,IAAsB,EACtBgB,QAAgB,GAAG,EAAE,EACb;EACR,IAAI,CAAChB,IAAI,EAAE,OAAOgB,QAAQ;EAC1B,OAAOhB,IAAI,CAACiB,kBAAkB,CAACN,SAAS,EAAE;IACxCV,IAAI,EAAE,SAAS;IACfE,KAAK,EAAE,OAAO;IACdI,GAAG,EAAE;EACP,CAAC,CAAC;AACJ;AAEA,OAAO,SAASW,gBAAgBA,CAC9BR,KAAuC,EACrB;EAClB,IAAIA,KAAK,IAAI,IAAI,EAAE,OAAOC,SAAS;EACnC,IAAID,KAAK,YAAYE,IAAI,EAAE,OAAOF,KAAK;EACvC,MAAMV,IAAI,GAAG,IAAIY,IAAI,CAACF,KAAK,CAAC;EAC5B,OAAOG,KAAK,CAACb,IAAI,CAACc,OAAO,CAAC,CAAC,CAAC,GAAGH,SAAS,GAAGX,IAAI;AACjD","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useStaleData.js","names":["useRef","useStaleData","data","isLoading","ref","current"],"sources":["useStaleData.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { useRef } from \"react\";\n\n// TODO: revisit whether this hook is necessary. It may be possible to handle\n// loading states inline (render data if present, show skeleton if loading)\n// instead of preserving stale data in a ref.\nexport function useStaleData<T>(data: T, isLoading: boolean): T {\n const ref = useRef(data);\n if (!isLoading) {\n ref.current = data;\n }\n return ref.current;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,QAAQ,OAAO;;AAE9B;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAAIC,IAAO,EAAEC,SAAkB,EAAK;EAC9D,MAAMC,GAAG,GAAGJ,MAAM,CAACE,IAAI,CAAC;EACxB,IAAI,CAACC,SAAS,EAAE;IACdC,GAAG,CAACC,OAAO,GAAGH,IAAI;EACpB;EACA,OAAOE,GAAG,CAACC,OAAO;AACpB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
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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oBACExB,KAAA,CAAAyB,aAAA;IACEF,SAAS,EAAEA,SAAU;IACrBT,KAAK,EAAEA,KAAM;IACbN,OAAO,EAAEC,WAAY;IACrBiB,SAAS,EAAEhB,aAAc;IACzBiB,IAAI,EAAC,QAAQ;IACbC,QAAQ,EAAE,CAAE;IACZC,KAAK,EAAExB,UAAU,CAACyB,KAAM;IACxB,sBAAoBzB,UAAU,CAAC0B;EAAG,CACnC,CAAC;AAEN;AAEA,OAAO,SAASC,wBAAwBA,CAAC;EACvCC,WAAW;EACX3B,UAAU;EACVC,KAAK;EACL2B;AAC6B,CAAC,EAAsB;EACpD,oBACElC,KAAA,CAAAyB,aAAA;IAAKF,SAAS,EAAEpB,MAAM,CAACgC;EAAgB,GACpCF,WAAW,CAACG,GAAG,CAAE/B,UAAU,iBAC1BL,KAAA,CAAAyB,aAAA,CAACrB,cAAc;IACbQ,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":[]}
|
|
@@ -1 +0,0 @@
|
|
|
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,OAAOC,KAAK,IAAIC,WAAW,QAAQ,OAAO;AAC1C,OAAOC,MAAM,MAAM,iCAAiC;AAYpD,OAAO,SAASC,kBAAkBA,CAAC;EACjCC,KAAK;EACLC,YAAY;EACZC,iBAAiB;EACjBC,aAAa;EACbC,MAAM;EACNC,MAAM;EACNC;AACuB,CAAC,EAAsB;EAC9C,MAAMC,iBAAiB,GAAGV,WAAW,CAClCW,CAAsC,IAAK;IAC1CL,aAAa,CAACK,CAAC,CAACC,MAAM,CAACC,KAAK,CAAC;EAC/B,CAAC,EACD,CAACP,aAAa,CAChB,CAAC;EAED,MAAMQ,aAAa,GAAGd,WAAW,CAC9BW,CAAsB,IAAK;IAC1B,IAAIA,CAAC,CAACI,GAAG,KAAK,OAAO,EAAE;MACrBJ,CAAC,CAACK,cAAc,CAAC,CAAC;MAClB,IAAIL,CAAC,CAACM,QAAQ,EAAE;QACdT,MAAM,CAAC,CAAC;MACV,CAAC,MAAM;QACLD,MAAM,CAAC,CAAC;MACV;IACF,CAAC,MAAM,IAAII,CAAC,CAACI,GAAG,KAAK,QAAQ,EAAE;MAC7BJ,CAAC,CAACK,cAAc,CAAC,CAAC;MAClBP,OAAO,CAAC,CAAC;IACX;EACF,CAAC,EACD,CAACF,MAAM,EAAEC,MAAM,EAAEC,OAAO,CAC1B,CAAC;EAED,MAAMS,YAAY,GAAGd,YAAY,GAAG,CAAC,GACjC,GAAGC,iBAAiB,GAAG,CAAC,OAAOD,YAAY,EAAE,GAC7CD,KAAK,CAACgB,MAAM,GAAG,CAAC,GAChB,YAAY,GACZ,EAAE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CACL,CAAC;AAEV","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
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,kBAAkB,QAAQ,yBAAyB;AAS5D,OAAO,SAASC,gBAAgBA,CAAC;EAC/BC,QAAQ;EACRC,QAAQ;EACRC,WAAW;EACXC;AACqB,CAAC,EAAsB;EAC5C,MAAMC,kBAAkB,GAAGX,MAAM,CAAiB,IAAI,CAAC;EACvD,MAAMY,mBAAmB,G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AAE,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":[]}
|
|
@@ -1 +0,0 @@
|
|
|
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,kBAAkB,EAAEC,eAAe,QAAQ,gBAAgB;AACpE,OAAOC,MAAM,MAAM,iCAAiC;AASpD,OAAO,SAASC,kBAAkBA,CAAC;EACjCC,QAAQ;EACRC,UAAU;EACVC,QAAQ;EACRC;AACuB,CAAC,EAAsB;EAC9C,MAAMC,SAAS,GAAGV,MAAM,CAAoB,IAAI,CAAC;EACjD,MAAMW,aAAa,GAAGX,MAAM,CAA4C,IAAI,CAAC;EAC7E,MAAM,CAACY,UAAU,EAAEC,aAAa,CAAC,GAAGZ,QAAQ,CAE1Ca,SAAS,CAAC;EAEZf,SAAS,CAAC,MAAM;IACd,IAAIgB,SAAS,GAAG,KAAK;IAErB,KAAKT,QAAQ,CAACU,OAAO,CAACT,UAAU,CAAC,CAACU,IAAI,CAAEC,IAAI,IAAK;MAC/C,IAAIH,SAAS,IAAIL,SAAS,CAACS,OAAO,IAAI,IAAI,EAAE;QAC1C;MACF;MAEA,MAAMC,QAAQ,GAAGF,IAAI,CAACG,WAAW,CAAC;QAAEC,KAAK,EAAEnB;MAAgB,CAAC,CAAC;MAC7D,MAAMoB,MAAM,GAAGb,SAAS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+0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PdfViewerToolbar.js","names":["Input","ChevronLeft","ChevronRight","Download","Menu","Minus","Plus","Search","React","useCallback","useEffect","useState","MAX_SCALE","MIN_SCALE","SCALE_STEP","styles","PdfViewerToolbar","currentPage","numPages","scale","sidebarOpen","onPageChange","onScaleChange","onSearchOpen","onSidebarToggle","onDownload","pageInputValue","setPageInputValue","String","handlePrevPage","newPage","handleNextPage","handlePageInputChange","e","target","value","handlePageInputKeyDown","key","page","parseInt","isNaN","handlePageInputBlur","handleZoomIn","newScale","Math","min","handleZoomOut","max","scalePercent","round","createElement","className","toolbar","toolbarButton","onClick","title","type","size","separator","toolbarGroup","disabled","pageInput","onChange","onKeyDown","onBlur","pageCount","scaleDisplay"],"sources":["PdfViewerToolbar.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 { Input } from \"@base-ui/react/input\";\nimport {\n ChevronLeft,\n ChevronRight,\n Download,\n Menu,\n Minus,\n Plus,\n Search,\n} from \"@blueprintjs/icons\";\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport { MAX_SCALE, MIN_SCALE, SCALE_STEP } from \"./constants.js\";\nimport styles from \"./PdfViewerToolbar.module.css\";\n\ninterface PdfViewerToolbarProps {\n currentPage: number;\n numPages: number;\n scale: number;\n sidebarOpen: boolean;\n onPageChange: (page: number) => void;\n onScaleChange: (scale: number) => void;\n onSearchOpen: () => void;\n onSidebarToggle: () => void;\n onDownload: () => void;\n}\n\nexport function PdfViewerToolbar({\n currentPage,\n numPages,\n scale,\n sidebarOpen,\n onPageChange,\n onScaleChange,\n onSearchOpen,\n onSidebarToggle,\n onDownload,\n}: PdfViewerToolbarProps): React.ReactElement {\n const [pageInputValue, setPageInputValue] = useState(String(currentPage));\n\n // Sync input display when currentPage changes from scrolling\n useEffect(function syncPageInput() {\n setPageInputValue(String(currentPage));\n }, [currentPage]);\n\n const handlePrevPage = useCallback(() => {\n if (currentPage > 1) {\n const newPage = currentPage - 1;\n onPageChange(newPage);\n setPageInputValue(String(newPage));\n }\n }, [currentPage, onPageChange]);\n\n const handleNextPage = useCallback(() => {\n if (currentPage < numPages) {\n const newPage = currentPage + 1;\n onPageChange(newPage);\n setPageInputValue(String(newPage));\n }\n }, [currentPage, numPages, onPageChange]);\n\n const handlePageInputChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n setPageInputValue(e.target.value);\n },\n [],\n );\n\n const handlePageInputKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === \"Enter\") {\n const page = parseInt(pageInputValue, 10);\n if (!isNaN(page) && page >= 1 && page <= numPages) {\n onPageChange(page);\n } else {\n setPageInputValue(String(currentPage));\n }\n }\n },\n [pageInputValue, numPages, onPageChange, currentPage],\n );\n\n const handlePageInputBlur = useCallback(() => {\n setPageInputValue(String(currentPage));\n }, [currentPage]);\n\n const handleZoomIn = useCallback(() => {\n const newScale = Math.min(scale + SCALE_STEP, MAX_SCALE);\n onScaleChange(newScale);\n }, [scale, onScaleChange]);\n\n const handleZoomOut = useCallback(() => {\n const newScale = Math.max(scale - SCALE_STEP, MIN_SCALE);\n onScaleChange(newScale);\n }, [scale, onScaleChange]);\n\n const scalePercent = `${Math.round(scale * 100)}%`;\n\n return (\n <div className={styles.toolbar}>\n <button\n className={styles.toolbarButton}\n onClick={onSidebarToggle}\n aria-label={sidebarOpen ? \"Close sidebar\" : \"Open sidebar\"}\n title={sidebarOpen ? \"Close sidebar\" : \"Open sidebar\"}\n aria-pressed={sidebarOpen}\n type=\"button\"\n >\n <Menu size={16} />\n </button>\n\n <div className={styles.separator} />\n\n <div className={styles.toolbarGroup}>\n <button\n className={styles.toolbarButton}\n onClick={handlePrevPage}\n disabled={currentPage <= 1}\n aria-label=\"Previous page\"\n title=\"Previous page\"\n type=\"button\"\n >\n <ChevronLeft size={16} />\n </button>\n <Input\n className={styles.pageInput}\n type=\"text\"\n value={pageInputValue}\n onChange={handlePageInputChange}\n onKeyDown={handlePageInputKeyDown}\n onBlur={handlePageInputBlur}\n aria-label=\"Page number\"\n />\n <span className={styles.pageCount}>of {numPages}</span>\n <button\n className={styles.toolbarButton}\n onClick={handleNextPage}\n disabled={currentPage >= numPages}\n aria-label=\"Next page\"\n title=\"Next page\"\n type=\"button\"\n >\n <ChevronRight size={16} />\n </button>\n </div>\n\n <div className={styles.separator} />\n\n <div className={styles.toolbarGroup}>\n <button\n className={styles.toolbarButton}\n onClick={handleZoomOut}\n disabled={scale <= MIN_SCALE}\n aria-label=\"Zoom out\"\n title=\"Zoom out\"\n type=\"button\"\n >\n <Minus size={16} />\n </button>\n <span className={styles.scaleDisplay}>{scalePercent}</span>\n <button\n className={styles.toolbarButton}\n onClick={handleZoomIn}\n disabled={scale >= MAX_SCALE}\n aria-label=\"Zoom in\"\n title=\"Zoom in\"\n type=\"button\"\n >\n <Plus size={16} />\n </button>\n </div>\n\n <div className={styles.separator} />\n\n <button\n className={styles.toolbarButton}\n onClick={onSearchOpen}\n aria-label=\"Search\"\n title=\"Search\"\n type=\"button\"\n >\n <Search size={16} />\n </button>\n\n <div className={styles.separator} />\n\n <button\n className={styles.toolbarButton}\n onClick={onDownload}\n aria-label=\"Download\"\n title=\"Download\"\n type=\"button\"\n >\n <Download 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,KAAK,QAAQ,sBAAsB;AAC5C,SACEC,WAAW,EACXC,YAAY,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AAM,CAAC2C;EAAU,CAAE,CAAC,eAEpClD,KAAA,CAAA0C,aAAA;IACEC,SAAS,EAAEpC,MAAM,CAACsC,aAAc;IAChCC,OAAO,EAAE/B,YAAa;IACtB,cAAW,QAAQ;IACnBgC,KAAK,EAAC,QAAQ;IACdC,IAAI,EAAC;EAAQ,gBAEbhD,KAAA,CAAA0C,aAAA,CAAC3C,MAAM;IAACkD,IAAI,EAAE;EAAG,CAAE,CACb,CAAC,eAETjD,KAAA,CAAA0C,aAAA;IAAKC,SAAS,EAAEpC,MAAM,CAAC2C;EAAU,CAAE,CAAC,eAEpClD,KAAA,CAAA0C,aAAA;IACEC,SAAS,EAAEpC,MAAM,CAACsC,aAAc;IAChCC,OAAO,EAAE7B,UAAW;IACpB,cAAW,UAAU;IACrB8B,KAAK,EAAC,UAAU;IAChBC,IAAI,EAAC;EAAQ,gBAEbhD,KAAA,CAAA0C,aAAA,CAAC/C,QAAQ;IAACsD,IAAI,EAAE;EAAG,CAAE,CACf,CACL,CAAC;AAEV","ignoreList":[]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Date utilities for HTML date inputs.
|
|
3
|
-
*
|
|
4
|
-
* These functions operate on local time by design. HTML <input type="date">
|
|
5
|
-
* returns and expects values in "YYYY-MM-DD" format without timezone info.
|
|
6
|
-
*
|
|
7
|
-
* `parseDateFromInput` appends "T00:00:00" (no "Z") so the date is parsed as
|
|
8
|
-
* local midnight rather than UTC midnight. Without this, negative-offset
|
|
9
|
-
* timezones (e.g. US timezones) would shift "2024-01-15" to Jan 14 locally.
|
|
10
|
-
*
|
|
11
|
-
* Consumers providing dates from an API (typically UTC) should handle
|
|
12
|
-
* UTC-to-local conversion before passing values to these functions.
|
|
13
|
-
*/
|
|
14
|
-
export declare function formatDateForInput(date: Date | undefined): string;
|
|
15
|
-
export declare function parseDateFromInput(value: string): Date | undefined;
|
|
16
|
-
export declare function formatDateForDisplay(date: Date | undefined, fallback?: string): string;
|
|
17
|
-
export declare function parseDateFromISO(value: string | Date | undefined | null): Date | undefined;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;AA8BA,OAAO,iBAAS,mBAAmBA,MAAM;AAQzC,OAAO,iBAAS,mBAAmBC,gBAAgB;AAMnD,OAAO,iBAAS,qBACdD,MAAM,kBACNE;AAUF,OAAO,iBAAS,iBACdC,gBAAgB,0BACf","names":["date: Date | undefined","value: string","fallback: string","value: string | Date | undefined | null"],"sources":["../../../../../src/filter-list/base/inputs/dateUtils.ts"],"version":3,"file":"dateUtils.d.ts"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useStaleData<T>(data: T, isLoading: boolean): T;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"AAqBA,OAAO,iBAAS,aAAa,GAAGA,MAAM,GAAGC,qBAAqB","names":["data: T","isLoading: boolean"],"sources":["../../../../../src/filter-list/base/inputs/useStaleData.ts"],"version":3,"file":"useStaleData.d.ts"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"AAiBA,OAAO,WAAqC,OAAQ;AAEpD,cAAc,qBAAqB,YAAa;UAEtC,8BAA8B;CACtC,aAAa;CACb;CACA;CACA,qBAAqBA,YAAY;AAClC;AAgED,OAAO,iBAAS,yBAAyB,EACvC,aACA,YACA,OACA,mBAC8B,EAA7B,gCAAgC,MAAM","names":["annotation: PdfAnnotation"],"sources":["../../../src/pdf-viewer/PdfViewerAnnotationLayer.tsx"],"version":3,"file":"PdfViewerAnnotationLayer.d.ts"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"AAiBA,OAAO,WAA4B,OAAQ;UAGjC,wBAAwB;CAChC;CACA;CACA;CACA,gBAAgBA;CAChB;CACA;CACA;AACD;AAED,OAAO,iBAAS,mBAAmB,EACjC,OACA,cACA,mBACA,eACA,QACA,QACA,SACwB,EAAvB,0BAA0B,MAAM","names":["query: string"],"sources":["../../../src/pdf-viewer/PdfViewerSearchBar.tsx"],"version":3,"file":"PdfViewerSearchBar.d.ts"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { PDFDocumentProxy } from "pdfjs-dist";
|
|
2
|
-
import React from "react";
|
|
3
|
-
interface PdfViewerSidebarProps {
|
|
4
|
-
document: PDFDocumentProxy;
|
|
5
|
-
numPages: number;
|
|
6
|
-
currentPage: number;
|
|
7
|
-
onPageClick: (page: number) => void;
|
|
8
|
-
}
|
|
9
|
-
export declare function PdfViewerSidebar({ document, numPages, currentPage, onPageClick }: PdfViewerSidebarProps): React.ReactElement;
|
|
10
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"AAiBA,cAAc,wBAAwB,YAAa;AACnD,OAAO,WAAkC,OAAQ;UASvC,sBAAsB;CAC9B,UAAU;CACV;CACA;CACA,cAAcA;AACf;AAED,OAAO,iBAAS,iBAAiB,EAC/B,UACA,UACA,aACA,aACsB,EAArB,wBAAwB,MAAM","names":["page: number"],"sources":["../../../src/pdf-viewer/PdfViewerSidebar.tsx"],"version":3,"file":"PdfViewerSidebar.d.ts"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"AA0BA,OAAO,WAAiD,OAAQ;UAItD,sBAAsB;CAC9B;CACA;CACA;CACA;CACA,eAAeA;CACf,gBAAgBC;CAChB;CACA;CACA;AACD;AAED,OAAO,iBAAS,iBAAiB,EAC/B,aACA,UACA,OACA,aACA,cACA,eACA,cACA,iBACA,YACsB,EAArB,wBAAwB,MAAM","names":["page: number","scale: number"],"sources":["../../../src/pdf-viewer/PdfViewerToolbar.tsx"],"version":3,"file":"PdfViewerToolbar.d.ts"}
|
|
File without changes
|
/package/build/browser/pdf-viewer/{PdfViewerSearchBar.js → components/PdfViewerSearchBar.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/build/esm/pdf-viewer/{PdfViewerAnnotationLayer.js → components/PdfViewerAnnotationLayer.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/build/types/pdf-viewer/{PdfViewerThumbnail.d.ts → components/PdfViewerThumbnail.d.ts}
RENAMED
|
File without changes
|