@osdk/react-components 0.2.0-beta.9 → 0.2.1-main-20260407074313
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 +26 -0
- package/CHANGELOG.md +356 -0
- package/README.md +166 -7
- package/build/browser/action-form/ActionForm.js +117 -0
- package/build/browser/action-form/ActionForm.js.map +1 -0
- package/build/browser/action-form/ActionFormApi.js.map +1 -1
- package/build/browser/action-form/BaseForm.js +83 -0
- package/build/browser/action-form/BaseForm.js.map +1 -0
- 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/BaseInput.module.css +56 -0
- package/build/browser/action-form/fields/BaseInput.module.css.js +6 -0
- package/build/browser/action-form/fields/CustomField.js +30 -0
- package/build/browser/action-form/fields/CustomField.js.map +1 -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/DropdownField.js +104 -0
- package/build/browser/action-form/fields/DropdownField.js.map +1 -0
- package/build/browser/action-form/fields/FieldBridge.js +45 -0
- package/build/browser/action-form/fields/FieldBridge.js.map +1 -0
- package/build/browser/action-form/fields/FilePickerField.js +119 -0
- package/build/browser/action-form/fields/FilePickerField.js.map +1 -0
- package/build/browser/action-form/fields/FilePickerField.module.css +132 -0
- package/build/browser/action-form/fields/FilePickerField.module.css.js +11 -0
- package/build/browser/action-form/fields/FormFieldRenderer.js +128 -0
- package/build/browser/action-form/fields/FormFieldRenderer.js.map +1 -0
- 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/NumberInputField.js +130 -0
- package/build/browser/action-form/fields/NumberInputField.js.map +1 -0
- package/build/browser/action-form/fields/NumberInputField.module.css +96 -0
- package/build/browser/action-form/fields/NumberInputField.module.css.js +9 -0
- package/build/browser/action-form/fields/RadioButtonsField.js +57 -0
- package/build/browser/action-form/fields/RadioButtonsField.js.map +1 -0
- package/build/browser/action-form/fields/RadioButtonsField.module.css +83 -0
- package/build/browser/action-form/fields/RadioButtonsField.module.css.js +10 -0
- package/build/browser/action-form/fields/TextAreaField.js +50 -0
- package/build/browser/action-form/fields/TextAreaField.js.map +1 -0
- package/build/browser/action-form/fields/TextInputField.js +39 -0
- package/build/browser/action-form/fields/TextInputField.js.map +1 -0
- package/build/browser/action-form/utils/coerceFieldValue.js +93 -0
- package/build/browser/action-form/utils/coerceFieldValue.js.map +1 -0
- package/build/browser/action-form/utils/getDefaultFieldDefinitions.js +120 -0
- package/build/browser/action-form/utils/getDefaultFieldDefinitions.js.map +1 -0
- package/build/browser/base-components/action-button/ActionButton.module.css +0 -4
- package/build/browser/base-components/checkbox/Checkbox.js +8 -4
- package/build/browser/base-components/checkbox/Checkbox.js.map +1 -1
- package/build/browser/base-components/checkbox/Checkbox.module.css +13 -8
- package/build/browser/base-components/combobox/Combobox.js +154 -0
- package/build/browser/base-components/combobox/Combobox.js.map +1 -0
- package/build/browser/base-components/combobox/Combobox.module.css +364 -0
- package/build/browser/base-components/combobox/Combobox.module.css.js +18 -0
- package/build/browser/base-components/dialog/Dialog.js +4 -2
- package/build/browser/base-components/dialog/Dialog.js.map +1 -1
- package/build/browser/base-components/dialog/Dialog.module.css +0 -8
- package/build/browser/base-components/draggable-list/DraggableList.module.css +2 -10
- package/build/browser/base-components/search-bar/SearchBar.module.css +2 -2
- package/build/browser/base-components/searchable-menu/SearchableMenu.js +86 -0
- package/build/browser/base-components/searchable-menu/SearchableMenu.js.map +1 -0
- package/build/browser/base-components/searchable-menu/SearchableMenu.module.css +80 -0
- package/build/browser/base-components/searchable-menu/SearchableMenu.module.css.js +10 -0
- package/build/browser/base-components/select/Select.js +93 -0
- package/build/browser/base-components/select/Select.js.map +1 -0
- package/build/browser/base-components/select/Select.module.css +233 -0
- package/build/browser/base-components/select/Select.module.css.js +13 -0
- package/build/browser/base-components/skeleton/SkeletonBar.js +36 -0
- package/build/browser/base-components/skeleton/SkeletonBar.js.map +1 -0
- package/build/browser/base-components/skeleton/SkeletonBar.module.css +39 -0
- package/build/browser/base-components/skeleton/SkeletonBar.module.css.js +7 -0
- package/build/browser/base-components/switch/Switch.module.css +14 -15
- package/build/browser/base-components/tooltip/Tooltip.js +91 -0
- package/build/browser/base-components/tooltip/Tooltip.js.map +1 -0
- package/build/browser/base-components/tooltip/Tooltip.module.css +70 -0
- package/build/browser/base-components/tooltip/Tooltip.module.css.js +11 -0
- package/build/browser/base-components/tooltip/index.js +18 -0
- package/build/browser/base-components/tooltip/index.js.map +1 -0
- package/build/browser/filter-list/FilterInput.js +141 -0
- package/build/browser/filter-list/FilterInput.js.map +1 -0
- package/build/browser/filter-list/FilterList.js +142 -0
- package/build/browser/filter-list/FilterList.js.map +1 -0
- package/build/browser/filter-list/FilterListApi.js.map +1 -1
- package/build/browser/filter-list/FilterListItemApi.js.map +1 -1
- package/build/browser/filter-list/base/AddFilterPopover.js +35 -0
- package/build/browser/filter-list/base/AddFilterPopover.js.map +1 -0
- package/build/browser/filter-list/base/AddFilterPopover.module.css +49 -0
- package/build/browser/filter-list/base/AddFilterPopover.module.css.js +6 -0
- package/build/browser/filter-list/base/BaseFilterList.js +94 -0
- package/build/browser/filter-list/base/BaseFilterList.js.map +1 -0
- package/build/browser/filter-list/base/BaseFilterListApi.js +2 -0
- package/build/browser/filter-list/base/BaseFilterListApi.js.map +1 -0
- package/build/browser/filter-list/base/DragHandleIcon.js +51 -0
- package/build/browser/filter-list/base/DragHandleIcon.js.map +1 -0
- package/build/browser/filter-list/base/ExcludeDropdown.js +62 -0
- package/build/browser/filter-list/base/ExcludeDropdown.js.map +1 -0
- package/build/browser/filter-list/base/ExcludeDropdown.module.css +96 -0
- package/build/browser/filter-list/base/ExcludeDropdown.module.css.js +12 -0
- package/build/browser/filter-list/base/FilterIcons.js +65 -0
- package/build/browser/filter-list/base/FilterIcons.js.map +1 -0
- package/build/browser/filter-list/base/FilterInputExcludeRow.js +67 -0
- package/build/browser/filter-list/base/FilterInputExcludeRow.js.map +1 -0
- package/build/browser/filter-list/base/FilterList.module.css +84 -6
- package/build/browser/filter-list/base/FilterList.module.css.js +6 -0
- package/build/browser/filter-list/base/FilterListContent.js +172 -6
- package/build/browser/filter-list/base/FilterListContent.js.map +1 -1
- package/build/browser/filter-list/base/FilterListContent.module.css +6 -0
- package/build/browser/filter-list/base/FilterListContent.module.css.js +2 -1
- package/build/browser/filter-list/base/FilterListHeader.js +14 -13
- package/build/browser/filter-list/base/FilterListHeader.js.map +1 -1
- package/build/browser/filter-list/base/FilterListHeader.module.css +22 -21
- package/build/browser/filter-list/base/FilterListHeader.module.css.js +1 -1
- package/build/browser/filter-list/base/FilterListItem.js +124 -27
- package/build/browser/filter-list/base/FilterListItem.js.map +1 -1
- package/build/browser/filter-list/base/FilterListItem.module.css +173 -0
- package/build/browser/filter-list/base/FilterListItem.module.css.js +11 -1
- package/build/browser/filter-list/base/SortableFilterListItem.js +64 -0
- package/build/browser/filter-list/base/SortableFilterListItem.js.map +1 -0
- package/build/browser/filter-list/base/index.js +1 -2
- package/build/browser/filter-list/base/index.js.map +1 -1
- package/build/browser/filter-list/base/inputs/ContainsTextInput.js +5 -7
- package/build/browser/filter-list/base/inputs/ContainsTextInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/DateRangeInput.js +37 -0
- package/build/browser/filter-list/base/inputs/DateRangeInput.js.map +1 -0
- package/build/browser/filter-list/base/inputs/LinkedPropertyInput.module.css +20 -0
- package/build/browser/filter-list/base/inputs/LinkedPropertyInput.module.css.js +6 -0
- package/build/browser/filter-list/base/inputs/ListogramInput.js +118 -0
- package/build/browser/filter-list/base/inputs/ListogramInput.js.map +1 -0
- package/build/browser/filter-list/base/inputs/ListogramInput.module.css +137 -0
- package/build/browser/filter-list/base/inputs/ListogramInput.module.css.js +14 -0
- package/build/browser/filter-list/base/inputs/ListogramSkeleton.js +45 -0
- package/build/browser/filter-list/base/inputs/ListogramSkeleton.js.map +1 -0
- package/build/browser/filter-list/base/inputs/ListogramSkeleton.module.css +32 -0
- package/build/browser/filter-list/base/inputs/ListogramSkeleton.module.css.js +8 -0
- 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/MultiDateInput.module.css +6 -6
- package/build/browser/filter-list/base/inputs/MultiSelectInput.js +76 -0
- package/build/browser/filter-list/base/inputs/MultiSelectInput.js.map +1 -0
- package/build/browser/filter-list/base/inputs/MultiSelectInput.module.css +37 -0
- package/build/browser/filter-list/base/inputs/MultiSelectInput.module.css.js +8 -0
- package/build/browser/filter-list/base/inputs/NullValueWrapper.js +57 -0
- package/build/browser/filter-list/base/inputs/NullValueWrapper.js.map +1 -0
- package/build/browser/filter-list/base/inputs/NullValueWrapper.module.css +50 -0
- package/build/browser/filter-list/base/inputs/NullValueWrapper.module.css.js +10 -0
- package/build/browser/filter-list/base/inputs/NumberRangeInput.js +48 -0
- package/build/browser/filter-list/base/inputs/NumberRangeInput.js.map +1 -0
- package/build/browser/filter-list/base/inputs/RangeInput.js +159 -0
- package/build/browser/filter-list/base/inputs/RangeInput.js.map +1 -0
- package/build/browser/filter-list/base/inputs/RangeInput.module.css +106 -0
- package/build/browser/filter-list/base/inputs/RangeInput.module.css.js +13 -0
- 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/SingleDateInput.module.css +2 -2
- package/build/browser/filter-list/base/inputs/SingleSelectInput.js +77 -0
- package/build/browser/filter-list/base/inputs/SingleSelectInput.js.map +1 -0
- package/build/browser/filter-list/base/inputs/SingleSelectInput.module.css +45 -0
- package/build/browser/filter-list/base/inputs/SingleSelectInput.module.css.js +10 -0
- package/build/browser/filter-list/base/inputs/TextTagsInput.js +133 -0
- package/build/browser/filter-list/base/inputs/TextTagsInput.js.map +1 -0
- package/build/browser/filter-list/base/inputs/TextTagsInput.module.css +25 -0
- package/build/browser/filter-list/base/inputs/TextTagsInput.module.css.js +7 -0
- package/build/browser/filter-list/base/inputs/TimelineInput.js +74 -0
- package/build/browser/filter-list/base/inputs/TimelineInput.js.map +1 -0
- package/build/browser/filter-list/base/inputs/TimelineInput.module.css +75 -0
- package/build/browser/filter-list/base/inputs/TimelineInput.module.css.js +10 -0
- package/build/browser/filter-list/base/inputs/createHistogramBuckets.js +53 -0
- package/build/browser/filter-list/base/inputs/createHistogramBuckets.js.map +1 -0
- package/build/browser/filter-list/base/inputs/index.js +5 -1
- package/build/browser/filter-list/base/inputs/index.js.map +1 -1
- package/build/browser/filter-list/base/inputs/shared.module.css +5 -5
- package/build/browser/filter-list/base/inputs/useStableData.js +29 -0
- package/build/browser/filter-list/base/inputs/useStableData.js.map +1 -0
- package/build/browser/filter-list/hooks/useFilterListState.js +56 -10
- package/build/browser/filter-list/hooks/useFilterListState.js.map +1 -1
- package/build/browser/filter-list/hooks/useFilterVisibility.js +74 -0
- package/build/browser/filter-list/hooks/useFilterVisibility.js.map +1 -0
- package/build/browser/filter-list/hooks/usePropertyAggregation.js +98 -0
- package/build/browser/filter-list/hooks/usePropertyAggregation.js.map +1 -0
- package/build/browser/filter-list/inputs/ContainsTextFilterInput.js +38 -0
- package/build/browser/filter-list/inputs/ContainsTextFilterInput.js.map +1 -0
- package/build/browser/filter-list/inputs/DateRangeFilterInput.js +109 -0
- package/build/browser/filter-list/inputs/DateRangeFilterInput.js.map +1 -0
- package/build/browser/filter-list/inputs/LinkedPropertyInput.js +496 -0
- package/build/browser/filter-list/inputs/LinkedPropertyInput.js.map +1 -0
- package/build/browser/filter-list/inputs/ListogramFilterInput.js +83 -0
- package/build/browser/filter-list/inputs/ListogramFilterInput.js.map +1 -0
- package/build/browser/filter-list/inputs/MultiDateFilterInput.js +38 -0
- package/build/browser/filter-list/inputs/MultiDateFilterInput.js.map +1 -0
- package/build/browser/filter-list/inputs/MultiSelectFilterInput.js +71 -0
- package/build/browser/filter-list/inputs/MultiSelectFilterInput.js.map +1 -0
- package/build/browser/filter-list/inputs/NumberRangeFilterInput.js +109 -0
- package/build/browser/filter-list/inputs/NumberRangeFilterInput.js.map +1 -0
- package/build/browser/filter-list/inputs/PropertyFilterInput.js +142 -0
- package/build/browser/filter-list/inputs/PropertyFilterInput.js.map +1 -0
- package/build/browser/filter-list/inputs/SingleDateFilterInput.js +38 -0
- package/build/browser/filter-list/inputs/SingleDateFilterInput.js.map +1 -0
- package/build/browser/filter-list/inputs/SingleSelectFilterInput.js +71 -0
- package/build/browser/filter-list/inputs/SingleSelectFilterInput.js.map +1 -0
- package/build/browser/filter-list/inputs/TextTagsFilterInput.js +70 -0
- package/build/browser/filter-list/inputs/TextTagsFilterInput.js.map +1 -0
- package/build/browser/filter-list/inputs/TimelineFilterInput.js +49 -0
- package/build/browser/filter-list/inputs/TimelineFilterInput.js.map +1 -0
- package/build/browser/filter-list/inputs/ToggleFilterInput.js +36 -0
- package/build/browser/filter-list/inputs/ToggleFilterInput.js.map +1 -0
- package/build/browser/filter-list/types/AggregationTypes.js +2 -0
- package/build/browser/filter-list/types/AggregationTypes.js.map +1 -0
- package/build/browser/filter-list/types/CustomRendererTypes.js.map +1 -1
- package/build/browser/filter-list/types/LinkedFilterTypes.js.map +1 -1
- package/build/browser/filter-list/types/index.js +0 -2
- package/build/browser/filter-list/types/index.js.map +1 -1
- package/build/browser/filter-list/utils/aggregationHelpers.js +44 -0
- package/build/browser/filter-list/utils/aggregationHelpers.js.map +1 -0
- package/build/browser/filter-list/utils/filterStateSerialization.js +42 -0
- package/build/browser/filter-list/utils/filterStateSerialization.js.map +1 -0
- package/build/browser/filter-list/utils/filterStateToWhereClause.js +124 -91
- package/build/browser/filter-list/utils/filterStateToWhereClause.js.map +1 -1
- package/build/browser/filter-list/utils/filterValues.js +55 -1
- package/build/browser/filter-list/utils/filterValues.js.map +1 -1
- package/build/browser/filter-list/utils/getFilterKey.js +1 -1
- package/build/browser/filter-list/utils/getFilterKey.js.map +1 -1
- package/build/browser/filter-list/utils/getFilterLabel.js +36 -0
- package/build/browser/filter-list/utils/getFilterLabel.js.map +1 -0
- package/build/browser/object-table/ColumnConfigDialog.module.css +1 -11
- package/build/browser/object-table/DefaultCellRenderer.js +23 -5
- package/build/browser/object-table/DefaultCellRenderer.js.map +1 -1
- package/build/browser/object-table/EditableCell.js +87 -10
- package/build/browser/object-table/EditableCell.js.map +1 -1
- package/build/browser/object-table/EditableCell.module.css +69 -2
- package/build/browser/object-table/EditableCell.module.css.js +6 -1
- package/build/browser/object-table/LoadingCell.js +7 -3
- 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/LoadingRow.js +2 -1
- package/build/browser/object-table/LoadingRow.js.map +1 -1
- 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 +22 -58
- package/build/browser/object-table/MultiColumnSortDialog.js.map +1 -1
- package/build/browser/object-table/MultiColumnSortDialog.module.css +0 -69
- package/build/browser/object-table/MultiColumnSortDialog.module.css.js +0 -5
- package/build/browser/object-table/ObjectTable.js +16 -23
- package/build/browser/object-table/ObjectTable.js.map +1 -1
- package/build/browser/object-table/ObjectTableApi.js.map +1 -1
- package/build/browser/object-table/SelectionCells.js +1 -0
- package/build/browser/object-table/SelectionCells.js.map +1 -1
- package/build/browser/object-table/Table.js +23 -15
- package/build/browser/object-table/Table.js.map +1 -1
- package/build/browser/object-table/Table.module.css +0 -8
- package/build/browser/object-table/Table.module.css.js +1 -2
- package/build/browser/object-table/TableBody.js +8 -2
- package/build/browser/object-table/TableBody.js.map +1 -1
- package/build/browser/object-table/TableCell.module.css +2 -9
- package/build/browser/object-table/TableEditContainer.js +90 -0
- package/build/browser/object-table/TableEditContainer.js.map +1 -0
- package/build/browser/object-table/TableEditContainer.module.css +71 -0
- package/build/browser/object-table/TableEditContainer.module.css.js +13 -0
- package/build/browser/object-table/TableHeader.js +4 -1
- package/build/browser/object-table/TableHeader.js.map +1 -1
- package/build/browser/object-table/TableHeader.module.css +4 -3
- package/build/browser/object-table/TableHeader.module.css.js +1 -0
- 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 -12
- package/build/browser/object-table/TableRow.js +10 -3
- package/build/browser/object-table/TableRow.js.map +1 -1
- package/build/browser/object-table/TableRow.module.css +2 -1
- package/build/browser/object-table/components/AsyncValueCell.js +35 -0
- package/build/browser/object-table/components/AsyncValueCell.js.map +1 -0
- package/build/browser/object-table/hooks/useColumnDefs.js +5 -2
- package/build/browser/object-table/hooks/useColumnDefs.js.map +1 -1
- package/build/browser/object-table/hooks/useEditableTable.js +39 -11
- package/build/browser/object-table/hooks/useEditableTable.js.map +1 -1
- package/build/browser/object-table/hooks/useFunctionColumnsData.js +135 -0
- package/build/browser/object-table/hooks/useFunctionColumnsData.js.map +1 -0
- package/build/browser/object-table/hooks/useObjectTableData.js +33 -17
- package/build/browser/object-table/hooks/useObjectTableData.js.map +1 -1
- package/build/browser/object-table/hooks/useRowSelection.js +11 -8
- package/build/browser/object-table/hooks/useRowSelection.js.map +1 -1
- package/build/browser/object-table/utils/AsyncCellData.js +30 -0
- package/build/browser/object-table/utils/AsyncCellData.js.map +1 -0
- package/build/browser/object-table/utils/constants.js +1 -0
- package/build/browser/object-table/utils/constants.js.map +1 -1
- package/build/browser/object-table/utils/getCellId.js +0 -7
- package/build/browser/object-table/utils/getCellId.js.map +1 -1
- package/build/browser/object-table/utils/types.js.map +1 -1
- package/build/browser/pdf-viewer/PdfRenderer.js +88 -0
- package/build/browser/pdf-viewer/PdfRenderer.js.map +1 -0
- package/build/browser/pdf-viewer/PdfViewer.js +179 -0
- package/build/browser/pdf-viewer/PdfViewer.js.map +1 -0
- package/build/browser/pdf-viewer/PdfViewer.module.css +95 -0
- package/build/browser/pdf-viewer/PdfViewer.module.css.js +16 -0
- package/build/browser/pdf-viewer/PdfViewerContext.js +108 -0
- package/build/browser/pdf-viewer/PdfViewerContext.js.map +1 -0
- package/build/browser/pdf-viewer/components/PdfViewerAnnotationLayer.js +141 -0
- package/build/browser/pdf-viewer/components/PdfViewerAnnotationLayer.js.map +1 -0
- package/build/browser/pdf-viewer/components/PdfViewerAnnotationLayer.module.css +82 -0
- package/build/browser/pdf-viewer/components/PdfViewerAnnotationLayer.module.css.js +12 -0
- package/build/browser/pdf-viewer/components/PdfViewerContent.js +125 -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 +84 -0
- package/build/browser/pdf-viewer/components/PdfViewerSearchBar.js.map +1 -0
- package/build/browser/pdf-viewer/components/PdfViewerSearchBar.module.css +65 -0
- package/build/browser/pdf-viewer/components/PdfViewerSearchBar.module.css.js +10 -0
- package/build/browser/pdf-viewer/components/PdfViewerSidebar.js +78 -0
- package/build/browser/pdf-viewer/components/PdfViewerSidebar.js.map +1 -0
- package/build/browser/pdf-viewer/components/PdfViewerSidebar.module.css +37 -0
- package/build/browser/pdf-viewer/components/PdfViewerSidebar.module.css.js +10 -0
- 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/components/PdfViewerThumbnail.js +100 -0
- package/build/browser/pdf-viewer/components/PdfViewerThumbnail.js.map +1 -0
- package/build/browser/pdf-viewer/components/PdfViewerThumbnail.module.css +26 -0
- package/build/browser/pdf-viewer/components/PdfViewerThumbnail.module.css.js +8 -0
- package/build/browser/pdf-viewer/components/PdfViewerToolbar.js +221 -0
- package/build/browser/pdf-viewer/components/PdfViewerToolbar.js.map +1 -0
- package/build/browser/pdf-viewer/components/PdfViewerToolbar.module.css +91 -0
- package/build/browser/pdf-viewer/components/PdfViewerToolbar.module.css.js +13 -0
- package/build/browser/pdf-viewer/constants.js +46 -0
- package/build/browser/pdf-viewer/constants.js.map +1 -0
- package/build/browser/pdf-viewer/hooks/usePdfAnnotationPortals.js +54 -0
- package/build/browser/pdf-viewer/hooks/usePdfAnnotationPortals.js.map +1 -0
- package/build/browser/pdf-viewer/hooks/usePdfAnnotationsByPage.js +30 -0
- package/build/browser/pdf-viewer/hooks/usePdfAnnotationsByPage.js.map +1 -0
- package/build/browser/pdf-viewer/hooks/usePdfDocument.js +66 -0
- package/build/browser/pdf-viewer/hooks/usePdfDocument.js.map +1 -0
- package/build/browser/pdf-viewer/hooks/usePdfFormFields.js +341 -0
- package/build/browser/pdf-viewer/hooks/usePdfFormFields.js.map +1 -0
- package/build/browser/pdf-viewer/hooks/usePdfHighlightMode.js +227 -0
- package/build/browser/pdf-viewer/hooks/usePdfHighlightMode.js.map +1 -0
- 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 +86 -0
- package/build/browser/pdf-viewer/hooks/usePdfViewer.js.map +1 -0
- 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/usePdfViewerSearch.js +106 -0
- package/build/browser/pdf-viewer/hooks/usePdfViewerSearch.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/hooks/usePdfViewerSync.js +71 -0
- package/build/browser/pdf-viewer/hooks/usePdfViewerSync.js.map +1 -0
- package/build/browser/pdf-viewer/types.js +2 -0
- package/build/browser/pdf-viewer/types.js.map +1 -0
- package/build/browser/public/experimental.js +34 -0
- 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/shared/ErrorBoundary.module.css +14 -14
- package/build/browser/{filter-list/utils → shared}/assertUnreachable.js +1 -1
- package/build/browser/{filter-list/utils → shared}/assertUnreachable.js.map +1 -1
- package/build/{esm/filter-list/base/inputs → browser/shared}/dateUtils.js +38 -2
- package/build/browser/shared/dateUtils.js.map +1 -0
- package/build/browser/shared/typedMemo.js +25 -0
- package/build/browser/shared/typedMemo.js.map +1 -0
- package/build/browser/styles.css +4452 -1405
- 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-HMQTYQEX.cjs +9 -0
- package/build/cjs/chunk-HMQTYQEX.cjs.map +1 -0
- package/build/cjs/chunk-MRRRZN44.cjs +165 -0
- package/build/cjs/chunk-MRRRZN44.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 +9514 -2011
- package/build/cjs/public/experimental.cjs.map +1 -1
- package/build/cjs/public/experimental.css +3230 -736
- package/build/cjs/public/experimental.css.map +1 -1
- package/build/cjs/public/experimental.d.cts +1182 -125
- 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 +50 -0
- package/build/esm/action-form/ActionForm.js +117 -0
- package/build/esm/action-form/ActionForm.js.map +1 -0
- package/build/esm/action-form/ActionFormApi.js.map +1 -1
- package/build/esm/action-form/BaseForm.js +83 -0
- package/build/esm/action-form/BaseForm.js.map +1 -0
- 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/BaseInput.module.css +56 -0
- package/build/esm/action-form/fields/CustomField.js +30 -0
- package/build/esm/action-form/fields/CustomField.js.map +1 -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/DropdownField.js +104 -0
- package/build/esm/action-form/fields/DropdownField.js.map +1 -0
- package/build/esm/action-form/fields/FieldBridge.js +45 -0
- package/build/esm/action-form/fields/FieldBridge.js.map +1 -0
- package/build/esm/action-form/fields/FilePickerField.js +119 -0
- package/build/esm/action-form/fields/FilePickerField.js.map +1 -0
- package/build/esm/action-form/fields/FilePickerField.module.css +132 -0
- package/build/esm/action-form/fields/FormFieldRenderer.js +128 -0
- package/build/esm/action-form/fields/FormFieldRenderer.js.map +1 -0
- 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/NumberInputField.js +130 -0
- package/build/esm/action-form/fields/NumberInputField.js.map +1 -0
- package/build/esm/action-form/fields/NumberInputField.module.css +96 -0
- package/build/esm/action-form/fields/RadioButtonsField.js +57 -0
- package/build/esm/action-form/fields/RadioButtonsField.js.map +1 -0
- package/build/esm/action-form/fields/RadioButtonsField.module.css +83 -0
- package/build/esm/action-form/fields/TextAreaField.js +50 -0
- package/build/esm/action-form/fields/TextAreaField.js.map +1 -0
- package/build/esm/action-form/fields/TextInputField.js +39 -0
- package/build/esm/action-form/fields/TextInputField.js.map +1 -0
- package/build/esm/action-form/utils/coerceFieldValue.js +93 -0
- package/build/esm/action-form/utils/coerceFieldValue.js.map +1 -0
- package/build/esm/action-form/utils/getDefaultFieldDefinitions.js +120 -0
- package/build/esm/action-form/utils/getDefaultFieldDefinitions.js.map +1 -0
- package/build/esm/base-components/action-button/ActionButton.module.css +0 -4
- package/build/esm/base-components/checkbox/Checkbox.js +8 -4
- package/build/esm/base-components/checkbox/Checkbox.js.map +1 -1
- package/build/esm/base-components/checkbox/Checkbox.module.css +13 -8
- package/build/esm/base-components/combobox/Combobox.js +154 -0
- package/build/esm/base-components/combobox/Combobox.js.map +1 -0
- package/build/esm/base-components/combobox/Combobox.module.css +364 -0
- package/build/esm/base-components/dialog/Dialog.js +4 -2
- package/build/esm/base-components/dialog/Dialog.js.map +1 -1
- package/build/esm/base-components/dialog/Dialog.module.css +0 -8
- package/build/esm/base-components/draggable-list/DraggableList.module.css +2 -10
- package/build/esm/base-components/search-bar/SearchBar.module.css +2 -2
- package/build/esm/base-components/searchable-menu/SearchableMenu.js +86 -0
- package/build/esm/base-components/searchable-menu/SearchableMenu.js.map +1 -0
- package/build/esm/base-components/searchable-menu/SearchableMenu.module.css +80 -0
- package/build/esm/base-components/select/Select.js +93 -0
- package/build/esm/base-components/select/Select.js.map +1 -0
- package/build/esm/base-components/select/Select.module.css +233 -0
- package/build/esm/base-components/skeleton/SkeletonBar.js +36 -0
- package/build/esm/base-components/skeleton/SkeletonBar.js.map +1 -0
- package/build/esm/base-components/skeleton/SkeletonBar.module.css +39 -0
- package/build/esm/base-components/switch/Switch.module.css +14 -15
- package/build/esm/base-components/tooltip/Tooltip.js +91 -0
- package/build/esm/base-components/tooltip/Tooltip.js.map +1 -0
- package/build/esm/base-components/tooltip/Tooltip.module.css +70 -0
- package/build/esm/base-components/tooltip/index.js +18 -0
- package/build/esm/base-components/tooltip/index.js.map +1 -0
- package/build/esm/filter-list/FilterInput.js +141 -0
- package/build/esm/filter-list/FilterInput.js.map +1 -0
- package/build/esm/filter-list/FilterList.js +142 -0
- package/build/esm/filter-list/FilterList.js.map +1 -0
- package/build/esm/filter-list/FilterListApi.js.map +1 -1
- package/build/esm/filter-list/FilterListItemApi.js.map +1 -1
- package/build/esm/filter-list/base/AddFilterPopover.js +35 -0
- package/build/esm/filter-list/base/AddFilterPopover.js.map +1 -0
- package/build/esm/filter-list/base/AddFilterPopover.module.css +49 -0
- package/build/esm/filter-list/base/BaseFilterList.js +94 -0
- package/build/esm/filter-list/base/BaseFilterList.js.map +1 -0
- package/build/esm/filter-list/base/BaseFilterListApi.js +2 -0
- package/build/esm/filter-list/base/BaseFilterListApi.js.map +1 -0
- package/build/esm/filter-list/base/DragHandleIcon.js +51 -0
- package/build/esm/filter-list/base/DragHandleIcon.js.map +1 -0
- package/build/esm/filter-list/base/ExcludeDropdown.js +62 -0
- package/build/esm/filter-list/base/ExcludeDropdown.js.map +1 -0
- package/build/esm/filter-list/base/ExcludeDropdown.module.css +96 -0
- package/build/esm/filter-list/base/FilterIcons.js +65 -0
- package/build/esm/filter-list/base/FilterIcons.js.map +1 -0
- package/build/esm/filter-list/base/FilterInputExcludeRow.js +67 -0
- package/build/esm/filter-list/base/FilterInputExcludeRow.js.map +1 -0
- package/build/esm/filter-list/base/FilterList.module.css +84 -6
- package/build/esm/filter-list/base/FilterListContent.js +172 -6
- package/build/esm/filter-list/base/FilterListContent.js.map +1 -1
- package/build/esm/filter-list/base/FilterListContent.module.css +6 -0
- package/build/esm/filter-list/base/FilterListHeader.js +14 -13
- package/build/esm/filter-list/base/FilterListHeader.js.map +1 -1
- package/build/esm/filter-list/base/FilterListHeader.module.css +22 -21
- package/build/esm/filter-list/base/FilterListItem.js +124 -27
- package/build/esm/filter-list/base/FilterListItem.js.map +1 -1
- package/build/esm/filter-list/base/FilterListItem.module.css +173 -0
- package/build/esm/filter-list/base/SortableFilterListItem.js +64 -0
- package/build/esm/filter-list/base/SortableFilterListItem.js.map +1 -0
- package/build/esm/filter-list/base/index.js +1 -2
- package/build/esm/filter-list/base/index.js.map +1 -1
- package/build/esm/filter-list/base/inputs/ContainsTextInput.js +5 -7
- package/build/esm/filter-list/base/inputs/ContainsTextInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/DateRangeInput.js +37 -0
- package/build/esm/filter-list/base/inputs/DateRangeInput.js.map +1 -0
- package/build/esm/filter-list/base/inputs/LinkedPropertyInput.module.css +20 -0
- package/build/esm/filter-list/base/inputs/ListogramInput.js +118 -0
- package/build/esm/filter-list/base/inputs/ListogramInput.js.map +1 -0
- package/build/esm/filter-list/base/inputs/ListogramInput.module.css +137 -0
- package/build/esm/filter-list/base/inputs/ListogramSkeleton.js +45 -0
- package/build/esm/filter-list/base/inputs/ListogramSkeleton.js.map +1 -0
- package/build/esm/filter-list/base/inputs/ListogramSkeleton.module.css +32 -0
- 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/MultiDateInput.module.css +6 -6
- package/build/esm/filter-list/base/inputs/MultiSelectInput.js +76 -0
- package/build/esm/filter-list/base/inputs/MultiSelectInput.js.map +1 -0
- package/build/esm/filter-list/base/inputs/MultiSelectInput.module.css +37 -0
- package/build/esm/filter-list/base/inputs/NullValueWrapper.js +57 -0
- package/build/esm/filter-list/base/inputs/NullValueWrapper.js.map +1 -0
- package/build/esm/filter-list/base/inputs/NullValueWrapper.module.css +50 -0
- package/build/esm/filter-list/base/inputs/NumberRangeInput.js +48 -0
- package/build/esm/filter-list/base/inputs/NumberRangeInput.js.map +1 -0
- package/build/esm/filter-list/base/inputs/RangeInput.js +159 -0
- package/build/esm/filter-list/base/inputs/RangeInput.js.map +1 -0
- package/build/esm/filter-list/base/inputs/RangeInput.module.css +106 -0
- 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/SingleDateInput.module.css +2 -2
- package/build/esm/filter-list/base/inputs/SingleSelectInput.js +77 -0
- package/build/esm/filter-list/base/inputs/SingleSelectInput.js.map +1 -0
- package/build/esm/filter-list/base/inputs/SingleSelectInput.module.css +45 -0
- package/build/esm/filter-list/base/inputs/TextTagsInput.js +133 -0
- package/build/esm/filter-list/base/inputs/TextTagsInput.js.map +1 -0
- package/build/esm/filter-list/base/inputs/TextTagsInput.module.css +25 -0
- package/build/esm/filter-list/base/inputs/TimelineInput.js +74 -0
- package/build/esm/filter-list/base/inputs/TimelineInput.js.map +1 -0
- package/build/esm/filter-list/base/inputs/TimelineInput.module.css +75 -0
- package/build/esm/filter-list/base/inputs/createHistogramBuckets.js +53 -0
- package/build/esm/filter-list/base/inputs/createHistogramBuckets.js.map +1 -0
- package/build/esm/filter-list/base/inputs/index.js +5 -1
- package/build/esm/filter-list/base/inputs/index.js.map +1 -1
- package/build/esm/filter-list/base/inputs/shared.module.css +5 -5
- package/build/esm/filter-list/base/inputs/useStableData.js +29 -0
- package/build/esm/filter-list/base/inputs/useStableData.js.map +1 -0
- package/build/esm/filter-list/hooks/useFilterListState.js +56 -10
- package/build/esm/filter-list/hooks/useFilterListState.js.map +1 -1
- package/build/esm/filter-list/hooks/useFilterVisibility.js +74 -0
- package/build/esm/filter-list/hooks/useFilterVisibility.js.map +1 -0
- package/build/esm/filter-list/hooks/usePropertyAggregation.js +98 -0
- package/build/esm/filter-list/hooks/usePropertyAggregation.js.map +1 -0
- package/build/esm/filter-list/inputs/ContainsTextFilterInput.js +38 -0
- package/build/esm/filter-list/inputs/ContainsTextFilterInput.js.map +1 -0
- package/build/esm/filter-list/inputs/DateRangeFilterInput.js +109 -0
- package/build/esm/filter-list/inputs/DateRangeFilterInput.js.map +1 -0
- package/build/esm/filter-list/inputs/LinkedPropertyInput.js +496 -0
- package/build/esm/filter-list/inputs/LinkedPropertyInput.js.map +1 -0
- package/build/esm/filter-list/inputs/ListogramFilterInput.js +83 -0
- package/build/esm/filter-list/inputs/ListogramFilterInput.js.map +1 -0
- package/build/esm/filter-list/inputs/MultiDateFilterInput.js +38 -0
- package/build/esm/filter-list/inputs/MultiDateFilterInput.js.map +1 -0
- package/build/esm/filter-list/inputs/MultiSelectFilterInput.js +71 -0
- package/build/esm/filter-list/inputs/MultiSelectFilterInput.js.map +1 -0
- package/build/esm/filter-list/inputs/NumberRangeFilterInput.js +109 -0
- package/build/esm/filter-list/inputs/NumberRangeFilterInput.js.map +1 -0
- package/build/esm/filter-list/inputs/PropertyFilterInput.js +142 -0
- package/build/esm/filter-list/inputs/PropertyFilterInput.js.map +1 -0
- package/build/esm/filter-list/inputs/SingleDateFilterInput.js +38 -0
- package/build/esm/filter-list/inputs/SingleDateFilterInput.js.map +1 -0
- package/build/esm/filter-list/inputs/SingleSelectFilterInput.js +71 -0
- package/build/esm/filter-list/inputs/SingleSelectFilterInput.js.map +1 -0
- package/build/esm/filter-list/inputs/TextTagsFilterInput.js +70 -0
- package/build/esm/filter-list/inputs/TextTagsFilterInput.js.map +1 -0
- package/build/esm/filter-list/inputs/TimelineFilterInput.js +49 -0
- package/build/esm/filter-list/inputs/TimelineFilterInput.js.map +1 -0
- package/build/esm/filter-list/inputs/ToggleFilterInput.js +36 -0
- package/build/esm/filter-list/inputs/ToggleFilterInput.js.map +1 -0
- package/build/esm/filter-list/types/AggregationTypes.js +2 -0
- package/build/esm/filter-list/types/AggregationTypes.js.map +1 -0
- package/build/esm/filter-list/types/CustomRendererTypes.js.map +1 -1
- package/build/esm/filter-list/types/LinkedFilterTypes.js.map +1 -1
- package/build/esm/filter-list/types/index.js +0 -2
- package/build/esm/filter-list/types/index.js.map +1 -1
- package/build/esm/filter-list/utils/aggregationHelpers.js +44 -0
- package/build/esm/filter-list/utils/aggregationHelpers.js.map +1 -0
- package/build/esm/filter-list/utils/filterStateSerialization.js +42 -0
- package/build/esm/filter-list/utils/filterStateSerialization.js.map +1 -0
- package/build/esm/filter-list/utils/filterStateToWhereClause.js +124 -91
- package/build/esm/filter-list/utils/filterStateToWhereClause.js.map +1 -1
- package/build/esm/filter-list/utils/filterValues.js +55 -1
- package/build/esm/filter-list/utils/filterValues.js.map +1 -1
- package/build/esm/filter-list/utils/getFilterKey.js +1 -1
- package/build/esm/filter-list/utils/getFilterKey.js.map +1 -1
- package/build/esm/filter-list/utils/getFilterLabel.js +36 -0
- package/build/esm/filter-list/utils/getFilterLabel.js.map +1 -0
- package/build/esm/object-table/ColumnConfigDialog.module.css +1 -11
- package/build/esm/object-table/DefaultCellRenderer.js +23 -5
- package/build/esm/object-table/DefaultCellRenderer.js.map +1 -1
- package/build/esm/object-table/EditableCell.js +87 -10
- package/build/esm/object-table/EditableCell.js.map +1 -1
- package/build/esm/object-table/EditableCell.module.css +69 -2
- package/build/esm/object-table/LoadingCell.js +7 -3
- 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/LoadingRow.js +2 -1
- package/build/esm/object-table/LoadingRow.js.map +1 -1
- 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 +22 -58
- package/build/esm/object-table/MultiColumnSortDialog.js.map +1 -1
- package/build/esm/object-table/MultiColumnSortDialog.module.css +0 -69
- package/build/esm/object-table/ObjectTable.js +16 -23
- package/build/esm/object-table/ObjectTable.js.map +1 -1
- package/build/esm/object-table/ObjectTableApi.js.map +1 -1
- package/build/esm/object-table/SelectionCells.js +1 -0
- package/build/esm/object-table/SelectionCells.js.map +1 -1
- package/build/esm/object-table/Table.js +23 -15
- package/build/esm/object-table/Table.js.map +1 -1
- package/build/esm/object-table/Table.module.css +0 -8
- package/build/esm/object-table/TableBody.js +8 -2
- package/build/esm/object-table/TableBody.js.map +1 -1
- package/build/esm/object-table/TableCell.module.css +2 -9
- package/build/esm/object-table/TableEditContainer.js +90 -0
- package/build/esm/object-table/TableEditContainer.js.map +1 -0
- package/build/esm/object-table/TableEditContainer.module.css +71 -0
- package/build/esm/object-table/TableHeader.js +4 -1
- package/build/esm/object-table/TableHeader.js.map +1 -1
- package/build/esm/object-table/TableHeader.module.css +4 -3
- 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 -12
- package/build/esm/object-table/TableRow.js +10 -3
- package/build/esm/object-table/TableRow.js.map +1 -1
- package/build/esm/object-table/TableRow.module.css +2 -1
- package/build/esm/object-table/components/AsyncValueCell.js +35 -0
- package/build/esm/object-table/components/AsyncValueCell.js.map +1 -0
- package/build/esm/object-table/hooks/useColumnDefs.js +5 -2
- package/build/esm/object-table/hooks/useColumnDefs.js.map +1 -1
- package/build/esm/object-table/hooks/useEditableTable.js +39 -11
- package/build/esm/object-table/hooks/useEditableTable.js.map +1 -1
- package/build/esm/object-table/hooks/useFunctionColumnsData.js +135 -0
- package/build/esm/object-table/hooks/useFunctionColumnsData.js.map +1 -0
- package/build/esm/object-table/hooks/useObjectTableData.js +33 -17
- package/build/esm/object-table/hooks/useObjectTableData.js.map +1 -1
- package/build/esm/object-table/hooks/useRowSelection.js +11 -8
- package/build/esm/object-table/hooks/useRowSelection.js.map +1 -1
- package/build/esm/object-table/utils/AsyncCellData.js +30 -0
- package/build/esm/object-table/utils/AsyncCellData.js.map +1 -0
- package/build/esm/object-table/utils/constants.js +1 -0
- package/build/esm/object-table/utils/constants.js.map +1 -1
- package/build/esm/object-table/utils/getCellId.js +0 -7
- package/build/esm/object-table/utils/getCellId.js.map +1 -1
- package/build/esm/object-table/utils/types.js.map +1 -1
- package/build/esm/pdf-viewer/PdfRenderer.js +88 -0
- package/build/esm/pdf-viewer/PdfRenderer.js.map +1 -0
- package/build/esm/pdf-viewer/PdfViewer.js +179 -0
- package/build/esm/pdf-viewer/PdfViewer.js.map +1 -0
- package/build/esm/pdf-viewer/PdfViewer.module.css +95 -0
- package/build/esm/pdf-viewer/PdfViewerContext.js +108 -0
- package/build/esm/pdf-viewer/PdfViewerContext.js.map +1 -0
- package/build/esm/pdf-viewer/components/PdfViewerAnnotationLayer.js +141 -0
- package/build/esm/pdf-viewer/components/PdfViewerAnnotationLayer.js.map +1 -0
- package/build/esm/pdf-viewer/components/PdfViewerAnnotationLayer.module.css +82 -0
- package/build/esm/pdf-viewer/components/PdfViewerContent.js +125 -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 +84 -0
- package/build/esm/pdf-viewer/components/PdfViewerSearchBar.js.map +1 -0
- package/build/esm/pdf-viewer/components/PdfViewerSearchBar.module.css +65 -0
- package/build/esm/pdf-viewer/components/PdfViewerSidebar.js +78 -0
- package/build/esm/pdf-viewer/components/PdfViewerSidebar.js.map +1 -0
- package/build/esm/pdf-viewer/components/PdfViewerSidebar.module.css +37 -0
- 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/components/PdfViewerThumbnail.js +100 -0
- package/build/esm/pdf-viewer/components/PdfViewerThumbnail.js.map +1 -0
- package/build/esm/pdf-viewer/components/PdfViewerThumbnail.module.css +26 -0
- package/build/esm/pdf-viewer/components/PdfViewerToolbar.js +221 -0
- package/build/esm/pdf-viewer/components/PdfViewerToolbar.js.map +1 -0
- package/build/esm/pdf-viewer/components/PdfViewerToolbar.module.css +91 -0
- package/build/esm/pdf-viewer/constants.js +46 -0
- package/build/esm/pdf-viewer/constants.js.map +1 -0
- package/build/esm/pdf-viewer/hooks/usePdfAnnotationPortals.js +54 -0
- package/build/esm/pdf-viewer/hooks/usePdfAnnotationPortals.js.map +1 -0
- package/build/esm/pdf-viewer/hooks/usePdfAnnotationsByPage.js +30 -0
- package/build/esm/pdf-viewer/hooks/usePdfAnnotationsByPage.js.map +1 -0
- package/build/esm/pdf-viewer/hooks/usePdfDocument.js +66 -0
- package/build/esm/pdf-viewer/hooks/usePdfDocument.js.map +1 -0
- package/build/esm/pdf-viewer/hooks/usePdfFormFields.js +341 -0
- package/build/esm/pdf-viewer/hooks/usePdfFormFields.js.map +1 -0
- package/build/esm/pdf-viewer/hooks/usePdfHighlightMode.js +227 -0
- package/build/esm/pdf-viewer/hooks/usePdfHighlightMode.js.map +1 -0
- 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 +86 -0
- package/build/esm/pdf-viewer/hooks/usePdfViewer.js.map +1 -0
- 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/usePdfViewerSearch.js +106 -0
- package/build/esm/pdf-viewer/hooks/usePdfViewerSearch.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/hooks/usePdfViewerSync.js +71 -0
- package/build/esm/pdf-viewer/hooks/usePdfViewerSync.js.map +1 -0
- package/build/esm/pdf-viewer/types.js +2 -0
- package/build/esm/pdf-viewer/types.js.map +1 -0
- package/build/esm/public/experimental.js +34 -0
- 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/shared/ErrorBoundary.module.css +14 -14
- package/build/esm/{filter-list/utils → shared}/assertUnreachable.js +1 -1
- package/build/esm/{filter-list/utils → shared}/assertUnreachable.js.map +1 -1
- package/build/{browser/filter-list/base/inputs → esm/shared}/dateUtils.js +38 -2
- package/build/esm/shared/dateUtils.js.map +1 -0
- package/build/esm/shared/typedMemo.js +25 -0
- package/build/esm/shared/typedMemo.js.map +1 -0
- package/build/types/action-form/ActionForm.d.ts +4 -0
- package/build/types/action-form/ActionForm.d.ts.map +1 -0
- package/build/types/action-form/ActionFormApi.d.ts +49 -32
- package/build/types/action-form/ActionFormApi.d.ts.map +1 -1
- package/build/types/action-form/BaseForm.d.ts +3 -0
- package/build/types/action-form/BaseForm.d.ts.map +1 -0
- 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 +152 -51
- 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/CustomField.d.ts +9 -0
- package/build/types/action-form/fields/CustomField.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/DropdownField.d.ts +6 -0
- package/build/types/action-form/fields/DropdownField.d.ts.map +1 -0
- package/build/types/action-form/fields/FieldBridge.d.ts +9 -0
- package/build/types/action-form/fields/FieldBridge.d.ts.map +1 -0
- package/build/types/action-form/fields/FilePickerField.d.ts +3 -0
- package/build/types/action-form/fields/FilePickerField.d.ts.map +1 -0
- package/build/types/action-form/fields/FormFieldRenderer.d.ts +8 -0
- package/build/types/action-form/fields/FormFieldRenderer.d.ts.map +1 -0
- 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/NumberInputField.d.ts +3 -0
- package/build/types/action-form/fields/NumberInputField.d.ts.map +1 -0
- package/build/types/action-form/fields/RadioButtonsField.d.ts +3 -0
- package/build/types/action-form/fields/RadioButtonsField.d.ts.map +1 -0
- package/build/types/action-form/fields/TextAreaField.d.ts +3 -0
- package/build/types/action-form/fields/TextAreaField.d.ts.map +1 -0
- package/build/types/action-form/fields/TextInputField.d.ts +5 -0
- package/build/types/action-form/fields/TextInputField.d.ts.map +1 -0
- package/build/types/action-form/utils/coerceFieldValue.d.ts +10 -0
- package/build/types/action-form/utils/coerceFieldValue.d.ts.map +1 -0
- package/build/types/action-form/utils/getDefaultFieldDefinitions.d.ts +9 -0
- package/build/types/action-form/utils/getDefaultFieldDefinitions.d.ts.map +1 -0
- package/build/types/base-components/checkbox/Checkbox.d.ts +2 -1
- package/build/types/base-components/checkbox/Checkbox.d.ts.map +1 -1
- package/build/types/base-components/combobox/Combobox.d.ts +65 -0
- package/build/types/base-components/combobox/Combobox.d.ts.map +1 -0
- package/build/types/base-components/dialog/Dialog.d.ts +3 -2
- package/build/types/base-components/dialog/Dialog.d.ts.map +1 -1
- package/build/types/base-components/searchable-menu/SearchableMenu.d.ts +18 -0
- package/build/types/base-components/searchable-menu/SearchableMenu.d.ts.map +1 -0
- package/build/types/base-components/select/Select.d.ts +40 -0
- package/build/types/base-components/select/Select.d.ts.map +1 -0
- package/build/types/base-components/skeleton/SkeletonBar.d.ts +9 -0
- package/build/types/base-components/skeleton/SkeletonBar.d.ts.map +1 -0
- package/build/types/base-components/tooltip/Tooltip.d.ts +31 -0
- package/build/types/base-components/tooltip/Tooltip.d.ts.map +1 -0
- package/build/types/base-components/tooltip/index.d.ts +1 -0
- package/build/types/base-components/tooltip/index.d.ts.map +1 -0
- package/build/types/filter-list/FilterInput.d.ts +17 -0
- package/build/types/filter-list/FilterInput.d.ts.map +1 -0
- package/build/types/filter-list/{base/FilterList.d.ts → FilterList.d.ts} +1 -1
- package/build/types/filter-list/FilterList.d.ts.map +1 -0
- package/build/types/filter-list/FilterListApi.d.ts +49 -33
- package/build/types/filter-list/FilterListApi.d.ts.map +1 -1
- package/build/types/filter-list/FilterListItemApi.d.ts +22 -6
- package/build/types/filter-list/FilterListItemApi.d.ts.map +1 -1
- package/build/types/filter-list/base/AddFilterPopover.d.ts +13 -0
- package/build/types/filter-list/base/AddFilterPopover.d.ts.map +1 -0
- package/build/types/filter-list/base/BaseFilterList.d.ts +3 -0
- package/build/types/filter-list/base/BaseFilterList.d.ts.map +1 -0
- package/build/types/filter-list/base/BaseFilterListApi.d.ts +32 -0
- package/build/types/filter-list/base/BaseFilterListApi.d.ts.map +1 -0
- package/build/types/filter-list/base/DragHandleIcon.d.ts +2 -0
- package/build/types/filter-list/base/DragHandleIcon.d.ts.map +1 -0
- 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 +10 -0
- package/build/types/filter-list/base/FilterIcons.d.ts.map +1 -0
- package/build/types/filter-list/base/FilterInputExcludeRow.d.ts +13 -0
- package/build/types/filter-list/base/FilterInputExcludeRow.d.ts.map +1 -0
- package/build/types/filter-list/base/FilterListContent.d.ts +9 -6
- package/build/types/filter-list/base/FilterListContent.d.ts.map +1 -1
- 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 +10 -6
- package/build/types/filter-list/base/FilterListItem.d.ts.map +1 -1
- package/build/types/filter-list/base/SortableFilterListItem.d.ts +16 -0
- package/build/types/filter-list/base/SortableFilterListItem.d.ts.map +1 -0
- package/build/types/filter-list/base/index.d.ts +2 -2
- package/build/types/filter-list/base/index.d.ts.map +1 -1
- package/build/types/filter-list/base/inputs/ContainsTextInput.d.ts.map +1 -1
- package/build/types/filter-list/base/inputs/DateRangeInput.d.ts +17 -0
- package/build/types/filter-list/base/inputs/DateRangeInput.d.ts.map +1 -0
- package/build/types/filter-list/base/inputs/ListogramInput.d.ts +21 -0
- package/build/types/filter-list/base/inputs/ListogramInput.d.ts.map +1 -0
- package/build/types/filter-list/base/inputs/ListogramSkeleton.d.ts +2 -0
- package/build/types/filter-list/base/inputs/ListogramSkeleton.d.ts.map +1 -0
- package/build/types/filter-list/base/inputs/MultiSelectInput.d.ts +16 -0
- package/build/types/filter-list/base/inputs/MultiSelectInput.d.ts.map +1 -0
- package/build/types/filter-list/base/inputs/NullValueWrapper.d.ts +15 -0
- package/build/types/filter-list/base/inputs/NullValueWrapper.d.ts.map +1 -0
- package/build/types/filter-list/base/inputs/NumberRangeInput.d.ts +17 -0
- package/build/types/filter-list/base/inputs/NumberRangeInput.d.ts.map +1 -0
- package/build/types/filter-list/base/inputs/RangeInput.d.ts +30 -0
- package/build/types/filter-list/base/inputs/RangeInput.d.ts.map +1 -0
- package/build/types/filter-list/base/inputs/SingleDateInput.d.ts.map +1 -1
- package/build/types/filter-list/base/inputs/SingleSelectInput.d.ts +18 -0
- package/build/types/filter-list/base/inputs/SingleSelectInput.d.ts.map +1 -0
- package/build/types/filter-list/base/inputs/TextTagsInput.d.ts +18 -0
- package/build/types/filter-list/base/inputs/TextTagsInput.d.ts.map +1 -0
- package/build/types/filter-list/base/inputs/TimelineInput.d.ts +11 -0
- package/build/types/filter-list/base/inputs/TimelineInput.d.ts.map +1 -0
- package/build/types/filter-list/base/inputs/createHistogramBuckets.d.ts +16 -0
- package/build/types/filter-list/base/inputs/createHistogramBuckets.d.ts.map +1 -0
- package/build/types/filter-list/base/inputs/index.d.ts +5 -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/useFilterListState.d.ts +2 -0
- package/build/types/filter-list/hooks/useFilterListState.d.ts.map +1 -1
- package/build/types/filter-list/hooks/useFilterVisibility.d.ts +10 -0
- package/build/types/filter-list/hooks/useFilterVisibility.d.ts.map +1 -0
- package/build/types/filter-list/hooks/usePropertyAggregation.d.ts +18 -0
- package/build/types/filter-list/hooks/usePropertyAggregation.d.ts.map +1 -0
- package/build/types/filter-list/inputs/ContainsTextFilterInput.d.ts +10 -0
- package/build/types/filter-list/inputs/ContainsTextFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/inputs/DateRangeFilterInput.d.ts +13 -0
- package/build/types/filter-list/inputs/DateRangeFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/inputs/LinkedPropertyInput.d.ts +22 -0
- package/build/types/filter-list/inputs/LinkedPropertyInput.d.ts.map +1 -0
- package/build/types/filter-list/inputs/ListogramFilterInput.d.ts +19 -0
- package/build/types/filter-list/inputs/ListogramFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/inputs/MultiDateFilterInput.d.ts +9 -0
- package/build/types/filter-list/inputs/MultiDateFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/inputs/MultiSelectFilterInput.d.ts +15 -0
- package/build/types/filter-list/inputs/MultiSelectFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/inputs/NumberRangeFilterInput.d.ts +13 -0
- package/build/types/filter-list/inputs/NumberRangeFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/inputs/PropertyFilterInput.d.ts +19 -0
- package/build/types/filter-list/inputs/PropertyFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/inputs/SingleDateFilterInput.d.ts +9 -0
- package/build/types/filter-list/inputs/SingleDateFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/inputs/SingleSelectFilterInput.d.ts +15 -0
- package/build/types/filter-list/inputs/SingleSelectFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/inputs/TextTagsFilterInput.d.ts +15 -0
- package/build/types/filter-list/inputs/TextTagsFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/inputs/TimelineFilterInput.d.ts +9 -0
- package/build/types/filter-list/inputs/TimelineFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/inputs/ToggleFilterInput.d.ts +9 -0
- package/build/types/filter-list/inputs/ToggleFilterInput.d.ts.map +1 -0
- package/build/types/filter-list/types/AggregationTypes.d.ts +5 -0
- package/build/types/filter-list/types/AggregationTypes.d.ts.map +1 -0
- package/build/types/filter-list/types/CustomRendererTypes.d.ts +2 -1
- package/build/types/filter-list/types/CustomRendererTypes.d.ts.map +1 -1
- package/build/types/filter-list/types/LinkedFilterTypes.d.ts +0 -19
- package/build/types/filter-list/types/LinkedFilterTypes.d.ts.map +1 -1
- package/build/types/filter-list/types/index.d.ts +0 -2
- package/build/types/filter-list/types/index.d.ts.map +1 -1
- package/build/types/filter-list/utils/aggregationHelpers.d.ts +9 -0
- package/build/types/filter-list/utils/aggregationHelpers.d.ts.map +1 -0
- package/build/types/filter-list/utils/filterStateSerialization.d.ts +3 -0
- package/build/types/filter-list/utils/filterStateSerialization.d.ts.map +1 -0
- package/build/types/filter-list/utils/filterStateToWhereClause.d.ts +5 -1
- package/build/types/filter-list/utils/filterStateToWhereClause.d.ts.map +1 -1
- package/build/types/filter-list/utils/filterValues.d.ts +4 -0
- package/build/types/filter-list/utils/filterValues.d.ts.map +1 -1
- package/build/types/filter-list/utils/getFilterKey.d.ts.map +1 -1
- package/build/types/filter-list/utils/getFilterLabel.d.ts +3 -0
- package/build/types/filter-list/utils/getFilterLabel.d.ts.map +1 -0
- package/build/types/object-table/DefaultCellRenderer.d.ts +2 -2
- package/build/types/object-table/DefaultCellRenderer.d.ts.map +1 -1
- package/build/types/object-table/EditableCell.d.ts +22 -6
- package/build/types/object-table/EditableCell.d.ts.map +1 -1
- package/build/types/object-table/LoadingCell.d.ts +1 -0
- package/build/types/object-table/LoadingCell.d.ts.map +1 -1
- package/build/types/object-table/LoadingRow.d.ts.map +1 -1
- package/build/types/object-table/LoadingStateTable.d.ts.map +1 -1
- package/build/types/object-table/MultiColumnSortDialog.d.ts.map +1 -1
- package/build/types/object-table/ObjectTable.d.ts +1 -9
- package/build/types/object-table/ObjectTable.d.ts.map +1 -1
- package/build/types/object-table/ObjectTableApi.d.ts +82 -22
- package/build/types/object-table/ObjectTableApi.d.ts.map +1 -1
- package/build/types/object-table/Table.d.ts +10 -10
- package/build/types/object-table/Table.d.ts.map +1 -1
- package/build/types/object-table/TableBody.d.ts +4 -1
- package/build/types/object-table/TableBody.d.ts.map +1 -1
- package/build/types/object-table/TableEditContainer.d.ts +9 -0
- package/build/types/object-table/TableEditContainer.d.ts.map +1 -0
- package/build/types/object-table/TableHeader.d.ts.map +1 -1
- package/build/types/object-table/TableRow.d.ts +4 -1
- package/build/types/object-table/TableRow.d.ts.map +1 -1
- package/build/types/object-table/components/AsyncValueCell.d.ts +5 -0
- package/build/types/object-table/components/AsyncValueCell.d.ts.map +1 -0
- package/build/types/object-table/hooks/useEditableTable.d.ts +4 -9
- package/build/types/object-table/hooks/useEditableTable.d.ts.map +1 -1
- package/build/types/object-table/hooks/useFunctionColumnsData.d.ts +13 -0
- package/build/types/object-table/hooks/useFunctionColumnsData.d.ts.map +1 -0
- package/build/types/object-table/hooks/useObjectTableData.d.ts +6 -1
- package/build/types/object-table/hooks/useObjectTableData.d.ts.map +1 -1
- package/build/types/object-table/hooks/useRowSelection.d.ts +3 -2
- package/build/types/object-table/hooks/useRowSelection.d.ts.map +1 -1
- package/build/types/object-table/utils/AsyncCellData.d.ts +8 -0
- package/build/types/object-table/utils/AsyncCellData.d.ts.map +1 -0
- package/build/types/object-table/utils/constants.d.ts +1 -0
- package/build/types/object-table/utils/constants.d.ts.map +1 -1
- package/build/types/object-table/utils/getCellId.d.ts +0 -1
- package/build/types/object-table/utils/getCellId.d.ts.map +1 -1
- package/build/types/object-table/utils/types.d.ts +28 -3
- package/build/types/object-table/utils/types.d.ts.map +1 -1
- package/build/types/pdf-viewer/PdfRenderer.d.ts +8 -0
- package/build/types/pdf-viewer/PdfRenderer.d.ts.map +1 -0
- package/build/types/pdf-viewer/PdfViewer.d.ts +4 -0
- package/build/types/pdf-viewer/PdfViewer.d.ts.map +1 -0
- package/build/types/pdf-viewer/PdfViewerContext.d.ts +64 -0
- package/build/types/pdf-viewer/PdfViewerContext.d.ts.map +1 -0
- package/build/types/pdf-viewer/components/PdfViewerAnnotationLayer.d.ts +9 -0
- package/build/types/pdf-viewer/components/PdfViewerAnnotationLayer.d.ts.map +1 -0
- package/build/types/pdf-viewer/components/PdfViewerContent.d.ts +26 -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/components/PdfViewerSearchBar.d.ts +11 -0
- 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/components/PdfViewerThumbnail.d.ts +10 -0
- package/build/types/pdf-viewer/components/PdfViewerThumbnail.d.ts.map +1 -0
- package/build/types/pdf-viewer/components/PdfViewerToolbar.d.ts +21 -0
- package/build/types/pdf-viewer/components/PdfViewerToolbar.d.ts.map +1 -0
- package/build/types/pdf-viewer/constants.d.ts +22 -0
- package/build/types/pdf-viewer/constants.d.ts.map +1 -0
- package/build/types/pdf-viewer/hooks/usePdfAnnotationPortals.d.ts +10 -0
- package/build/types/pdf-viewer/hooks/usePdfAnnotationPortals.d.ts.map +1 -0
- package/build/types/pdf-viewer/hooks/usePdfAnnotationsByPage.d.ts +5 -0
- package/build/types/pdf-viewer/hooks/usePdfAnnotationsByPage.d.ts.map +1 -0
- package/build/types/pdf-viewer/hooks/usePdfDocument.d.ts +9 -0
- package/build/types/pdf-viewer/hooks/usePdfDocument.d.ts.map +1 -0
- package/build/types/pdf-viewer/hooks/usePdfFormFields.d.ts +24 -0
- package/build/types/pdf-viewer/hooks/usePdfFormFields.d.ts.map +1 -0
- package/build/types/pdf-viewer/hooks/usePdfHighlightMode.d.ts +36 -0
- package/build/types/pdf-viewer/hooks/usePdfHighlightMode.d.ts.map +1 -0
- 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 +9 -0
- package/build/types/pdf-viewer/hooks/usePdfViewer.d.ts.map +1 -0
- 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/usePdfViewerSearch.d.ts +15 -0
- package/build/types/pdf-viewer/hooks/usePdfViewerSearch.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/hooks/usePdfViewerSync.d.ts +15 -0
- package/build/types/pdf-viewer/hooks/usePdfViewerSync.d.ts.map +1 -0
- package/build/types/pdf-viewer/types.d.ts +210 -0
- package/build/types/pdf-viewer/types.d.ts.map +1 -0
- package/build/types/public/experimental.d.ts +33 -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/assertUnreachable.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/build/types/shared/typedMemo.d.ts +6 -0
- package/build/types/shared/typedMemo.d.ts.map +1 -0
- package/package.json +23 -10
- package/primitives.d.ts +17 -0
- package/build/browser/filter-list/__tests__/dateUtils.test.js +0 -55
- package/build/browser/filter-list/__tests__/dateUtils.test.js.map +0 -1
- package/build/browser/filter-list/__tests__/filterStateToWhereClause.test.js +0 -296
- package/build/browser/filter-list/__tests__/filterStateToWhereClause.test.js.map +0 -1
- package/build/browser/filter-list/__tests__/getFilterKey.test.js +0 -53
- package/build/browser/filter-list/__tests__/getFilterKey.test.js.map +0 -1
- package/build/browser/filter-list/__tests__/testUtils.js +0 -203
- package/build/browser/filter-list/__tests__/testUtils.js.map +0 -1
- package/build/browser/filter-list/base/FilterInput.js +0 -225
- package/build/browser/filter-list/base/FilterInput.js.map +0 -1
- package/build/browser/filter-list/base/FilterList.js +0 -73
- package/build/browser/filter-list/base/FilterList.js.map +0 -1
- package/build/browser/filter-list/base/inputs/dateUtils.js.map +0 -1
- package/build/browser/filter-list/hooks/__tests__/useFilterListState.test.js +0 -128
- package/build/browser/filter-list/hooks/__tests__/useFilterListState.test.js.map +0 -1
- package/build/browser/filter-list/types/AddFilterMenuTypes.js +0 -2
- package/build/browser/filter-list/types/AddFilterMenuTypes.js.map +0 -1
- package/build/browser/filter-list/types/FilterPanelTypes.js +0 -2
- package/build/browser/filter-list/types/FilterPanelTypes.js.map +0 -1
- package/build/browser/object-table/__tests__/useEditableTable.test.js +0 -197
- package/build/browser/object-table/__tests__/useEditableTable.test.js.map +0 -1
- package/build/browser/object-table/hooks/__tests__/useCellContextMenu.test.js +0 -147
- package/build/browser/object-table/hooks/__tests__/useCellContextMenu.test.js.map +0 -1
- package/build/browser/object-table/hooks/__tests__/useColumnDefs.test.js +0 -520
- package/build/browser/object-table/hooks/__tests__/useColumnDefs.test.js.map +0 -1
- package/build/browser/object-table/hooks/__tests__/useColumnPinning.test.js +0 -266
- package/build/browser/object-table/hooks/__tests__/useColumnPinning.test.js.map +0 -1
- package/build/browser/object-table/hooks/__tests__/useColumnVisibility.test.js +0 -200
- package/build/browser/object-table/hooks/__tests__/useColumnVisibility.test.js.map +0 -1
- package/build/browser/object-table/hooks/__tests__/useObjectTableData.test.js +0 -315
- package/build/browser/object-table/hooks/__tests__/useObjectTableData.test.js.map +0 -1
- package/build/browser/object-table/hooks/__tests__/useRowSelection.test.js +0 -596
- package/build/browser/object-table/hooks/__tests__/useRowSelection.test.js.map +0 -1
- package/build/browser/object-table/hooks/__tests__/useSelectionColumn.test.js +0 -220
- package/build/browser/object-table/hooks/__tests__/useSelectionColumn.test.js.map +0 -1
- package/build/browser/object-table/hooks/__tests__/useTableSorting.test.js +0 -501
- package/build/browser/object-table/hooks/__tests__/useTableSorting.test.js.map +0 -1
- package/build/esm/filter-list/__tests__/dateUtils.test.js +0 -55
- package/build/esm/filter-list/__tests__/dateUtils.test.js.map +0 -1
- package/build/esm/filter-list/__tests__/filterStateToWhereClause.test.js +0 -296
- package/build/esm/filter-list/__tests__/filterStateToWhereClause.test.js.map +0 -1
- package/build/esm/filter-list/__tests__/getFilterKey.test.js +0 -53
- package/build/esm/filter-list/__tests__/getFilterKey.test.js.map +0 -1
- package/build/esm/filter-list/__tests__/testUtils.js +0 -203
- package/build/esm/filter-list/__tests__/testUtils.js.map +0 -1
- package/build/esm/filter-list/base/FilterInput.js +0 -225
- package/build/esm/filter-list/base/FilterInput.js.map +0 -1
- package/build/esm/filter-list/base/FilterList.js +0 -73
- package/build/esm/filter-list/base/FilterList.js.map +0 -1
- package/build/esm/filter-list/base/inputs/dateUtils.js.map +0 -1
- package/build/esm/filter-list/hooks/__tests__/useFilterListState.test.js +0 -128
- package/build/esm/filter-list/hooks/__tests__/useFilterListState.test.js.map +0 -1
- package/build/esm/filter-list/types/AddFilterMenuTypes.js +0 -2
- package/build/esm/filter-list/types/AddFilterMenuTypes.js.map +0 -1
- package/build/esm/filter-list/types/FilterPanelTypes.js +0 -2
- package/build/esm/filter-list/types/FilterPanelTypes.js.map +0 -1
- package/build/esm/object-table/__tests__/useEditableTable.test.js +0 -197
- package/build/esm/object-table/__tests__/useEditableTable.test.js.map +0 -1
- package/build/esm/object-table/hooks/__tests__/useCellContextMenu.test.js +0 -147
- package/build/esm/object-table/hooks/__tests__/useCellContextMenu.test.js.map +0 -1
- package/build/esm/object-table/hooks/__tests__/useColumnDefs.test.js +0 -520
- package/build/esm/object-table/hooks/__tests__/useColumnDefs.test.js.map +0 -1
- package/build/esm/object-table/hooks/__tests__/useColumnPinning.test.js +0 -266
- package/build/esm/object-table/hooks/__tests__/useColumnPinning.test.js.map +0 -1
- package/build/esm/object-table/hooks/__tests__/useColumnVisibility.test.js +0 -200
- package/build/esm/object-table/hooks/__tests__/useColumnVisibility.test.js.map +0 -1
- package/build/esm/object-table/hooks/__tests__/useObjectTableData.test.js +0 -315
- package/build/esm/object-table/hooks/__tests__/useObjectTableData.test.js.map +0 -1
- package/build/esm/object-table/hooks/__tests__/useRowSelection.test.js +0 -596
- package/build/esm/object-table/hooks/__tests__/useRowSelection.test.js.map +0 -1
- package/build/esm/object-table/hooks/__tests__/useSelectionColumn.test.js +0 -220
- package/build/esm/object-table/hooks/__tests__/useSelectionColumn.test.js.map +0 -1
- package/build/esm/object-table/hooks/__tests__/useTableSorting.test.js +0 -501
- package/build/esm/object-table/hooks/__tests__/useTableSorting.test.js.map +0 -1
- package/build/types/filter-list/__tests__/dateUtils.test.d.ts +0 -1
- package/build/types/filter-list/__tests__/dateUtils.test.d.ts.map +0 -1
- package/build/types/filter-list/__tests__/filterStateToWhereClause.test.d.ts +0 -1
- package/build/types/filter-list/__tests__/filterStateToWhereClause.test.d.ts.map +0 -1
- package/build/types/filter-list/__tests__/getFilterKey.test.d.ts +0 -1
- package/build/types/filter-list/__tests__/getFilterKey.test.d.ts.map +0 -1
- package/build/types/filter-list/__tests__/testUtils.d.ts +0 -65
- package/build/types/filter-list/__tests__/testUtils.d.ts.map +0 -1
- package/build/types/filter-list/base/FilterInput.d.ts +0 -13
- package/build/types/filter-list/base/FilterInput.d.ts.map +0 -1
- package/build/types/filter-list/base/FilterList.d.ts.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/hooks/__tests__/useFilterListState.test.d.ts +0 -1
- package/build/types/filter-list/hooks/__tests__/useFilterListState.test.d.ts.map +0 -1
- package/build/types/filter-list/types/AddFilterMenuTypes.d.ts +0 -77
- package/build/types/filter-list/types/AddFilterMenuTypes.d.ts.map +0 -1
- package/build/types/filter-list/types/FilterPanelTypes.d.ts +0 -18
- package/build/types/filter-list/types/FilterPanelTypes.d.ts.map +0 -1
- package/build/types/filter-list/utils/assertUnreachable.d.ts.map +0 -1
- package/build/types/object-table/__tests__/useEditableTable.test.d.ts +0 -1
- package/build/types/object-table/__tests__/useEditableTable.test.d.ts.map +0 -1
- package/build/types/object-table/hooks/__tests__/useCellContextMenu.test.d.ts +0 -1
- package/build/types/object-table/hooks/__tests__/useCellContextMenu.test.d.ts.map +0 -1
- package/build/types/object-table/hooks/__tests__/useColumnDefs.test.d.ts +0 -1
- package/build/types/object-table/hooks/__tests__/useColumnDefs.test.d.ts.map +0 -1
- package/build/types/object-table/hooks/__tests__/useColumnPinning.test.d.ts +0 -1
- package/build/types/object-table/hooks/__tests__/useColumnPinning.test.d.ts.map +0 -1
- package/build/types/object-table/hooks/__tests__/useColumnVisibility.test.d.ts +0 -1
- package/build/types/object-table/hooks/__tests__/useColumnVisibility.test.d.ts.map +0 -1
- package/build/types/object-table/hooks/__tests__/useObjectTableData.test.d.ts +0 -1
- package/build/types/object-table/hooks/__tests__/useObjectTableData.test.d.ts.map +0 -1
- package/build/types/object-table/hooks/__tests__/useRowSelection.test.d.ts +0 -1
- package/build/types/object-table/hooks/__tests__/useRowSelection.test.d.ts.map +0 -1
- package/build/types/object-table/hooks/__tests__/useSelectionColumn.test.d.ts +0 -1
- package/build/types/object-table/hooks/__tests__/useSelectionColumn.test.d.ts.map +0 -1
- package/build/types/object-table/hooks/__tests__/useTableSorting.test.d.ts +0 -1
- package/build/types/object-table/hooks/__tests__/useTableSorting.test.d.ts.map +0 -1
- /package/build/types/{filter-list/utils → shared}/assertUnreachable.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePdfViewer.js","names":["AnnotationEditorType","EventBus","PDFFindController","PDFLinkService","PDFViewer","useEffect","useRef","PAGES_LOADED_EVENT","usePdfViewer","containerRef","viewerRef","document","initialScale","initialPage","pdfViewerRef","eventBusRef","findControllerRef","container","current","viewer","eventBus","linkService","findController","updateMatchesCountOnProgress","pdfViewer","removePageBorders","annotationEditorMode","NONE","annotationEditorHighlightColors","setViewer","setDocument","onPagesLoaded","currentScale","currentPageNumber","scrollPageIntoView","pageNumber","off","on","cleanup"],"sources":["usePdfViewer.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\nimport { AnnotationEditorType } from \"pdfjs-dist\";\nimport type { PDFDocumentProxy } from \"pdfjs-dist\";\nimport {\n EventBus,\n PDFFindController,\n PDFLinkService,\n PDFViewer,\n} from \"pdfjs-dist/web/pdf_viewer.mjs\";\nimport type { RefObject } from \"react\";\nimport { useEffect, useRef } from \"react\";\nimport { PAGES_LOADED_EVENT } from \"../constants.js\";\n\nexport interface UsePdfViewerResult {\n pdfViewerRef: RefObject<PDFViewer | null>;\n eventBusRef: RefObject<EventBus | null>;\n findControllerRef: RefObject<PDFFindController | null>;\n}\n\nexport function usePdfViewer(\n containerRef: RefObject<HTMLDivElement | null>,\n viewerRef: RefObject<HTMLDivElement | null>,\n document: PDFDocumentProxy | undefined,\n initialScale?: number,\n initialPage?: number,\n): UsePdfViewerResult {\n const pdfViewerRef = useRef<PDFViewer | null>(null);\n const eventBusRef = useRef<EventBus | null>(null);\n const findControllerRef = useRef<PDFFindController | null>(null);\n\n useEffect(function initializePdfViewer() {\n const container = containerRef.current;\n const viewer = viewerRef.current;\n if (container == null || viewer == null || document == null) {\n return;\n }\n\n const eventBus = new EventBus();\n const linkService = new PDFLinkService({ eventBus });\n const findController = new PDFFindController({\n linkService,\n eventBus,\n updateMatchesCountOnProgress: true,\n });\n\n const pdfViewer = new PDFViewer({\n container,\n viewer,\n eventBus,\n linkService,\n findController,\n removePageBorders: true,\n annotationEditorMode: AnnotationEditorType.NONE,\n annotationEditorHighlightColors:\n \"yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F\",\n });\n\n linkService.setViewer(pdfViewer);\n linkService.setDocument(document);\n findController.setDocument(document);\n pdfViewer.setDocument(document);\n\n // Apply initial scale and page after pages are loaded to avoid\n // \"scrollPageIntoView: not a valid pageNumber\" console errors.\n const onPagesLoaded = () => {\n if (initialScale != null) {\n pdfViewer.currentScale = initialScale;\n }\n if (initialPage != null && initialPage > 1) {\n pdfViewer.currentPageNumber = initialPage;\n pdfViewer.scrollPageIntoView({ pageNumber: initialPage });\n }\n eventBus.off(PAGES_LOADED_EVENT, onPagesLoaded);\n };\n eventBus.on(PAGES_LOADED_EVENT, onPagesLoaded);\n\n eventBusRef.current = eventBus;\n findControllerRef.current = findController;\n pdfViewerRef.current = pdfViewer;\n\n return () => {\n pdfViewerRef.current = null;\n eventBusRef.current = null;\n findControllerRef.current = null;\n pdfViewer.cleanup();\n };\n }, [containerRef, viewerRef, document]);\n\n return { pdfViewerRef, eventBusRef, findControllerRef };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,oBAAoB,QAAQ,YAAY;AAEjD,SACEC,QAAQ,EACRC,iBAAiB,EACjBC,cAAc,EACdC,SAAS,QACJ,+BAA+B;AAEtC,SAASC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,SAASC,kBAAkB,QAAQ,iBAAiB;AAQpD,OAAO,SAASC,YAAYA,CAC1BC,YAA8C,EAC9CC,SAA2C,EAC3CC,QAAsC,EACtCC,YAAqB,EACrBC,WAAoB,EACA;EACpB,MAAMC,YAAY,GAAGR,MAAM,CAAmB,IAAI,CAAC;EACnD,MAAMS,WAAW,GAAGT,MAAM,CAAkB,IAAI,CAAC;EACjD,MAAMU,iBAAiB,GAAGV,MAAM,CAA2B,IAAI,CAAC;EAEhED,SAAS,CAAC,YAA+B;IACvC,MAAMY,SAAS,GAAGR,YAAY,CAACS,OAAO;IACtC,MAAMC,MAAM,GAAGT,SAAS,CAACQ,OAAO;IAChC,IAAID,SAAS,IAAI,IAAI,IAAIE,MAAM,IAAI,IAAI,IAAIR,QAAQ,IAAI,IAAI,EAAE;MAC3D;IACF;IAEA,MAAMS,QAAQ,GAAG,IAAInB,QAAQ,CAAC,CAAC;IAC/B,MAAMoB,WAAW,GAAG,IAAIlB,cAAc,CAAC;MAAEiB;IAAS,CAAC,CAAC;IACpD,MAAME,cAAc,GAAG,IAAIpB,iBAAiB,CAAC;MAC3CmB,WAAW;MACXD,QAAQ;MACRG,4BAA4B,EAAE;IAChC,CAAC,CAAC;IAEF,MAAMC,SAAS,GAAG,IAAIpB,SAAS,CAAC;MAC9Ba,SAAS;MACTE,MAAM;MACNC,QAAQ;MACRC,WAAW;MACXC,cAAc;MACdG,iBAAiB,EAAE,IAAI;MACvBC,oBAAoB,EAAE1B,oBAAoB,CAAC2B,IAAI;MAC/CC,+BAA+B,EAC7B;IACJ,CAAC,CAAC;IAEFP,WAAW,CAACQ,SAAS,CAACL,SAAS,CAAC;IAChCH,WAAW,CAACS,WAAW,CAACnB,QAAQ,CAAC;IACjCW,cAAc,CAACQ,WAAW,CAACnB,QAAQ,CAAC;IACpCa,SAAS,CAACM,WAAW,CAACnB,QAAQ,CAAC;;IAE/B;IACA;IACA,MAAMoB,aAAa,GAAGA,CAAA,KAAM;MAC1B,IAAInB,YAAY,IAAI,IAAI,EAAE;QACxBY,SAAS,CAACQ,YAAY,GAAGpB,YAAY;MACvC;MACA,IAAIC,WAAW,IAAI,IAAI,IAAIA,WAAW,GAAG,CAAC,EAAE;QAC1CW,SAAS,CAACS,iBAAiB,GAAGpB,WAAW;QACzCW,SAAS,CAACU,kBAAkB,CAAC;UAAEC,UAAU,EAAEtB;QAAY,CAAC,CAAC;MAC3D;MACAO,QAAQ,CAACgB,GAAG,CAAC7B,kBAAkB,EAAEwB,aAAa,CAAC;IACjD,CAAC;IACDX,QAAQ,CAACiB,EAAE,CAAC9B,kBAAkB,EAAEwB,aAAa,CAAC;IAE9ChB,WAAW,CAACG,OAAO,GAAGE,QAAQ;IAC9BJ,iBAAiB,CAACE,OAAO,GAAGI,cAAc;IAC1CR,YAAY,CAACI,OAAO,GAAGM,SAAS;IAEhC,OAAO,MAAM;MACXV,YAAY,CAACI,OAAO,GAAG,IAAI;MAC3BH,WAAW,CAACG,OAAO,GAAG,IAAI;MAC1BF,iBAAiB,CAACE,OAAO,GAAG,IAAI;MAChCM,SAAS,CAACc,OAAO,CAAC,CAAC;IACrB,CAAC;EACH,CAAC,EAAE,CAAC7B,YAAY,EAAEC,SAAS,EAAEC,QAAQ,CAAC,CAAC;EAEvC,OAAO;IAAEG,YAAY;IAAEC,WAAW;IAAEC;EAAkB,CAAC;AACzD","ignoreList":[]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { useCallback, useMemo, useRef, useState } from "react";
|
|
18
|
+
import { usePdfAnnotationPortals } from "./usePdfAnnotationPortals.js";
|
|
19
|
+
import { usePdfDocument } from "./usePdfDocument.js";
|
|
20
|
+
import { usePdfViewer } from "./usePdfViewer.js";
|
|
21
|
+
import { usePdfViewerSync } from "./usePdfViewerSync.js";
|
|
22
|
+
export function usePdfViewerCore({
|
|
23
|
+
src,
|
|
24
|
+
initialPage = 1,
|
|
25
|
+
initialScale = 1.0
|
|
26
|
+
}) {
|
|
27
|
+
const {
|
|
28
|
+
document,
|
|
29
|
+
numPages,
|
|
30
|
+
loading,
|
|
31
|
+
error
|
|
32
|
+
} = usePdfDocument(src);
|
|
33
|
+
const [scale, setScale] = useState(initialScale);
|
|
34
|
+
const [currentPage, setCurrentPage] = useState(initialPage);
|
|
35
|
+
const containerRef = useRef(null);
|
|
36
|
+
const viewerRef = useRef(null);
|
|
37
|
+
const {
|
|
38
|
+
pdfViewerRef,
|
|
39
|
+
eventBusRef,
|
|
40
|
+
findControllerRef
|
|
41
|
+
} = usePdfViewer(containerRef, viewerRef, document, initialScale, initialPage);
|
|
42
|
+
const handleScaleChange = useCallback(newScale => {
|
|
43
|
+
setScale(newScale);
|
|
44
|
+
}, []);
|
|
45
|
+
const handlePageChange = useCallback(page => {
|
|
46
|
+
setCurrentPage(page);
|
|
47
|
+
}, []);
|
|
48
|
+
const {
|
|
49
|
+
scrollToPage: syncScrollToPage
|
|
50
|
+
} = usePdfViewerSync({
|
|
51
|
+
pdfViewerRef,
|
|
52
|
+
eventBusRef,
|
|
53
|
+
document,
|
|
54
|
+
scale,
|
|
55
|
+
onScaleChange: handleScaleChange,
|
|
56
|
+
onPageChange: handlePageChange
|
|
57
|
+
});
|
|
58
|
+
const scrollToPage = useCallback(page => {
|
|
59
|
+
setCurrentPage(page);
|
|
60
|
+
syncScrollToPage(page);
|
|
61
|
+
}, [syncScrollToPage]);
|
|
62
|
+
const portalTargets = usePdfAnnotationPortals(pdfViewerRef, eventBusRef, document);
|
|
63
|
+
return useMemo(() => ({
|
|
64
|
+
document,
|
|
65
|
+
numPages,
|
|
66
|
+
loading,
|
|
67
|
+
error,
|
|
68
|
+
containerRef,
|
|
69
|
+
viewerRef,
|
|
70
|
+
currentPage,
|
|
71
|
+
scrollToPage,
|
|
72
|
+
scale,
|
|
73
|
+
setScale,
|
|
74
|
+
portalTargets,
|
|
75
|
+
pdfViewerRef,
|
|
76
|
+
eventBusRef,
|
|
77
|
+
findControllerRef
|
|
78
|
+
}), [document, numPages, loading, error, currentPage, scrollToPage, scale, setScale, portalTargets]);
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=usePdfViewerCore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePdfViewerCore.js","names":["useCallback","useMemo","useRef","useState","usePdfAnnotationPortals","usePdfDocument","usePdfViewer","usePdfViewerSync","usePdfViewerCore","src","initialPage","initialScale","document","numPages","loading","error","scale","setScale","currentPage","setCurrentPage","containerRef","viewerRef","pdfViewerRef","eventBusRef","findControllerRef","handleScaleChange","newScale","handlePageChange","page","scrollToPage","syncScrollToPage","onScaleChange","onPageChange","portalTargets"],"sources":["usePdfViewerCore.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\nimport type { PDFDocumentProxy } from \"pdfjs-dist\";\nimport type {\n EventBus,\n PDFFindController,\n PDFViewer,\n} from \"pdfjs-dist/web/pdf_viewer.mjs\";\nimport type { RefObject } from \"react\";\nimport { useCallback, useMemo, useRef, useState } from \"react\";\nimport type { AnnotationPortalTarget } from \"./usePdfAnnotationPortals.js\";\nimport { usePdfAnnotationPortals } from \"./usePdfAnnotationPortals.js\";\nimport { usePdfDocument } from \"./usePdfDocument.js\";\nimport { usePdfViewer } from \"./usePdfViewer.js\";\nimport { usePdfViewerSync } from \"./usePdfViewerSync.js\";\n\nexport interface UsePdfViewerCoreOptions {\n /** PDF source — URL string or ArrayBuffer */\n src: string | ArrayBuffer;\n /** Initial page number (1-indexed, default 1) */\n initialPage?: number;\n /** Initial zoom scale (default 1.0) */\n initialScale?: number;\n}\n\nexport interface UsePdfViewerCoreResult {\n /** The loaded PDF document, or undefined while loading */\n document: PDFDocumentProxy | undefined;\n /** Total number of pages in the document */\n numPages: number;\n /** Whether the document is currently loading */\n loading: boolean;\n /** Error encountered while loading the document */\n error: Error | undefined;\n\n /** Ref to attach to the scroll-container div */\n containerRef: RefObject<HTMLDivElement>;\n /** Ref to attach to the inner viewer div (className=\"pdfViewer\") */\n viewerRef: RefObject<HTMLDivElement>;\n\n /** Current page number (1-indexed) */\n currentPage: number;\n /** Navigate to a specific page (updates state and scrolls the viewer) */\n scrollToPage: (page: number) => void;\n\n /** Current zoom scale */\n scale: number;\n /** Set the zoom scale directly */\n setScale: (scale: number) => void;\n\n /** Portal targets for rendering annotation overlays on each page */\n portalTargets: AnnotationPortalTarget[];\n\n /** Ref to the internal pdfjs PDFViewer instance */\n pdfViewerRef: RefObject<PDFViewer | null>;\n /** Ref to the internal pdfjs EventBus instance */\n eventBusRef: RefObject<EventBus | null>;\n /** Ref to the internal pdfjs PDFFindController instance */\n findControllerRef: RefObject<PDFFindController | null>;\n}\n\nexport function usePdfViewerCore({\n src,\n initialPage = 1,\n initialScale = 1.0,\n}: UsePdfViewerCoreOptions): UsePdfViewerCoreResult {\n const { document, numPages, loading, error } = usePdfDocument(src);\n const [scale, setScale] = useState(initialScale);\n const [currentPage, setCurrentPage] = useState(initialPage);\n const containerRef = useRef<HTMLDivElement>(null);\n const viewerRef = useRef<HTMLDivElement>(null);\n\n const { pdfViewerRef, eventBusRef, findControllerRef } = usePdfViewer(\n containerRef,\n viewerRef,\n document,\n initialScale,\n initialPage,\n );\n\n const handleScaleChange = useCallback((newScale: number) => {\n setScale(newScale);\n }, []);\n\n const handlePageChange = useCallback((page: number) => {\n setCurrentPage(page);\n }, []);\n\n const { scrollToPage: syncScrollToPage } = usePdfViewerSync({\n pdfViewerRef,\n eventBusRef,\n document,\n scale,\n onScaleChange: handleScaleChange,\n onPageChange: handlePageChange,\n });\n\n const scrollToPage = useCallback(\n (page: number) => {\n setCurrentPage(page);\n syncScrollToPage(page);\n },\n [syncScrollToPage],\n );\n\n const portalTargets = usePdfAnnotationPortals(\n pdfViewerRef,\n eventBusRef,\n document,\n );\n\n return useMemo((): UsePdfViewerCoreResult => ({\n document,\n numPages,\n loading,\n error,\n containerRef,\n viewerRef,\n currentPage,\n scrollToPage,\n scale,\n setScale,\n portalTargets,\n pdfViewerRef,\n eventBusRef,\n findControllerRef,\n }), [\n document,\n numPages,\n loading,\n error,\n currentPage,\n scrollToPage,\n scale,\n setScale,\n portalTargets,\n ]);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,SAASA,WAAW,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAE9D,SAASC,uBAAuB,QAAQ,8BAA8B;AACtE,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,gBAAgB,QAAQ,uBAAuB;AA+CxD,OAAO,SAASC,gBAAgBA,CAAC;EAC/BC,GAAG;EACHC,WAAW,GAAG,CAAC;EACfC,YAAY,GAAG;AACQ,CAAC,EAA0B;EAClD,MAAM;IAAEC,QAAQ;IAAEC,QAAQ;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGV,cAAc,CAACI,GAAG,CAAC;EAClE,MAAM,CAACO,KAAK,EAAEC,QAAQ,CAAC,GAAGd,QAAQ,CAACQ,YAAY,CAAC;EAChD,MAAM,CAACO,WAAW,EAAEC,cAAc,CAAC,GAAGhB,QAAQ,CAACO,WAAW,CAAC;EAC3D,MAAMU,YAAY,GAAGlB,MAAM,CAAiB,IAAI,CAAC;EACjD,MAAMmB,SAAS,GAAGnB,MAAM,CAAiB,IAAI,CAAC;EAE9C,MAAM;IAAEoB,YAAY;IAAEC,WAAW;IAAEC;EAAkB,CAAC,GAAGlB,YAAY,CACnEc,YAAY,EACZC,SAAS,EACTT,QAAQ,EACRD,YAAY,EACZD,WACF,CAAC;EAED,MAAMe,iBAAiB,GAAGzB,WAAW,CAAE0B,QAAgB,IAAK;IAC1DT,QAAQ,CAACS,QAAQ,CAAC;EACpB,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMC,gBAAgB,GAAG3B,WAAW,CAAE4B,IAAY,IAAK;IACrDT,cAAc,CAACS,IAAI,CAAC;EACtB,CAAC,EAAE,EAAE,CAAC;EAEN,MAAM;IAAEC,YAAY,EAAEC;EAAiB,CAAC,GAAGvB,gBAAgB,CAAC;IAC1De,YAAY;IACZC,WAAW;IACXX,QAAQ;IACRI,KAAK;IACLe,aAAa,EAAEN,iBAAiB;IAChCO,YAAY,EAAEL;EAChB,CAAC,CAAC;EAEF,MAAME,YAAY,GAAG7B,WAAW,CAC7B4B,IAAY,IAAK;IAChBT,cAAc,CAACS,IAAI,CAAC;IACpBE,gBAAgB,CAACF,IAAI,CAAC;EACxB,CAAC,EACD,CAACE,gBAAgB,CACnB,CAAC;EAED,MAAMG,aAAa,GAAG7B,uBAAuB,CAC3CkB,YAAY,EACZC,WAAW,EACXX,QACF,CAAC;EAED,OAAOX,OAAO,CAAC,OAA+B;IAC5CW,QAAQ;IACRC,QAAQ;IACRC,OAAO;IACPC,KAAK;IACLK,YAAY;IACZC,SAAS;IACTH,WAAW;IACXW,YAAY;IACZb,KAAK;IACLC,QAAQ;IACRgB,aAAa;IACbX,YAAY;IACZC,WAAW;IACXC;EACF,CAAC,CAAC,EAAE,CACFZ,QAAQ,EACRC,QAAQ,EACRC,OAAO,EACPC,KAAK,EACLG,WAAW,EACXW,YAAY,EACZb,KAAK,EACLC,QAAQ,EACRgB,aAAa,CACd,CAAC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
18
|
+
import { EMPTY_STRING, FIND_EVENT, UPDATE_FIND_CONTROL_STATE_EVENT, UPDATE_FIND_MATCHES_COUNT_EVENT } from "../constants.js";
|
|
19
|
+
export function usePdfViewerSearch(eventBusRef, findControllerRef, document) {
|
|
20
|
+
const [query, setQueryState] = useState(EMPTY_STRING);
|
|
21
|
+
const [totalMatches, setTotalMatches] = useState(0);
|
|
22
|
+
const [currentMatchIndex, setCurrentMatchIndex] = useState(0);
|
|
23
|
+
const [isSearchOpen, setIsSearchOpen] = useState(false);
|
|
24
|
+
const dispatchFind = useCallback((queryString, findPrevious) => {
|
|
25
|
+
eventBusRef.current?.dispatch(FIND_EVENT, {
|
|
26
|
+
source: undefined,
|
|
27
|
+
type: "",
|
|
28
|
+
query: queryString,
|
|
29
|
+
caseSensitive: false,
|
|
30
|
+
highlightAll: true,
|
|
31
|
+
phraseSearch: true,
|
|
32
|
+
findPrevious
|
|
33
|
+
});
|
|
34
|
+
}, [eventBusRef]);
|
|
35
|
+
const dispatchFindAgain = useCallback(findPrevious => {
|
|
36
|
+
eventBusRef.current?.dispatch(FIND_EVENT, {
|
|
37
|
+
source: undefined,
|
|
38
|
+
type: "again",
|
|
39
|
+
query,
|
|
40
|
+
caseSensitive: false,
|
|
41
|
+
highlightAll: true,
|
|
42
|
+
phraseSearch: true,
|
|
43
|
+
findPrevious
|
|
44
|
+
});
|
|
45
|
+
}, [eventBusRef, query]);
|
|
46
|
+
const setQuery = useCallback(input => {
|
|
47
|
+
setQueryState(input);
|
|
48
|
+
if (input === EMPTY_STRING) {
|
|
49
|
+
setTotalMatches(0);
|
|
50
|
+
setCurrentMatchIndex(0);
|
|
51
|
+
// Dispatch empty query to clear highlights
|
|
52
|
+
dispatchFind(EMPTY_STRING, false);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
dispatchFind(input, false);
|
|
56
|
+
}, [dispatchFind]);
|
|
57
|
+
const nextMatch = useCallback(() => {
|
|
58
|
+
dispatchFindAgain(false);
|
|
59
|
+
}, [dispatchFindAgain]);
|
|
60
|
+
const prevMatch = useCallback(() => {
|
|
61
|
+
dispatchFindAgain(true);
|
|
62
|
+
}, [dispatchFindAgain]);
|
|
63
|
+
const openSearch = useCallback(() => {
|
|
64
|
+
setIsSearchOpen(true);
|
|
65
|
+
}, []);
|
|
66
|
+
const closeSearch = useCallback(() => {
|
|
67
|
+
setIsSearchOpen(false);
|
|
68
|
+
setQueryState(EMPTY_STRING);
|
|
69
|
+
setTotalMatches(0);
|
|
70
|
+
setCurrentMatchIndex(0);
|
|
71
|
+
// Clear highlights
|
|
72
|
+
dispatchFind(EMPTY_STRING, false);
|
|
73
|
+
}, [dispatchFind]);
|
|
74
|
+
useEffect(function () {
|
|
75
|
+
const eventBus = eventBusRef.current;
|
|
76
|
+
if (eventBus == null) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const handleMatchesCount = evt => {
|
|
80
|
+
setTotalMatches(evt.matchesCount.total);
|
|
81
|
+
setCurrentMatchIndex(evt.matchesCount.current > 0 ? evt.matchesCount.current - 1 : 0);
|
|
82
|
+
};
|
|
83
|
+
const handleControlState = evt => {
|
|
84
|
+
setTotalMatches(evt.matchesCount.total);
|
|
85
|
+
setCurrentMatchIndex(evt.matchesCount.current > 0 ? evt.matchesCount.current - 1 : 0);
|
|
86
|
+
};
|
|
87
|
+
eventBus.on(UPDATE_FIND_MATCHES_COUNT_EVENT, handleMatchesCount);
|
|
88
|
+
eventBus.on(UPDATE_FIND_CONTROL_STATE_EVENT, handleControlState);
|
|
89
|
+
return () => {
|
|
90
|
+
eventBus.off(UPDATE_FIND_MATCHES_COUNT_EVENT, handleMatchesCount);
|
|
91
|
+
eventBus.off(UPDATE_FIND_CONTROL_STATE_EVENT, handleControlState);
|
|
92
|
+
};
|
|
93
|
+
}, [eventBusRef, findControllerRef, document]);
|
|
94
|
+
return useMemo(() => ({
|
|
95
|
+
query,
|
|
96
|
+
totalMatches,
|
|
97
|
+
currentMatchIndex,
|
|
98
|
+
isSearchOpen,
|
|
99
|
+
setQuery,
|
|
100
|
+
nextMatch,
|
|
101
|
+
prevMatch,
|
|
102
|
+
openSearch,
|
|
103
|
+
closeSearch
|
|
104
|
+
}), [query, totalMatches, currentMatchIndex, isSearchOpen, setQuery, nextMatch, prevMatch, openSearch, closeSearch]);
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=usePdfViewerSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePdfViewerSearch.js","names":["useCallback","useEffect","useMemo","useState","EMPTY_STRING","FIND_EVENT","UPDATE_FIND_CONTROL_STATE_EVENT","UPDATE_FIND_MATCHES_COUNT_EVENT","usePdfViewerSearch","eventBusRef","findControllerRef","document","query","setQueryState","totalMatches","setTotalMatches","currentMatchIndex","setCurrentMatchIndex","isSearchOpen","setIsSearchOpen","dispatchFind","queryString","findPrevious","current","dispatch","source","undefined","type","caseSensitive","highlightAll","phraseSearch","dispatchFindAgain","setQuery","input","nextMatch","prevMatch","openSearch","closeSearch","eventBus","handleMatchesCount","evt","matchesCount","total","handleControlState","on","off"],"sources":["usePdfViewerSearch.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\nimport type { PDFDocumentProxy } from \"pdfjs-dist\";\nimport type {\n EventBus,\n PDFFindController,\n} from \"pdfjs-dist/web/pdf_viewer.mjs\";\nimport type { RefObject } from \"react\";\nimport { useCallback, useEffect, useMemo, useState } from \"react\";\nimport {\n EMPTY_STRING,\n FIND_EVENT,\n UPDATE_FIND_CONTROL_STATE_EVENT,\n UPDATE_FIND_MATCHES_COUNT_EVENT,\n} from \"../constants.js\";\n\nexport interface UsePdfViewerSearchResult {\n query: string;\n totalMatches: number;\n currentMatchIndex: number;\n isSearchOpen: boolean;\n setQuery: (query: string) => void;\n nextMatch: () => void;\n prevMatch: () => void;\n openSearch: () => void;\n closeSearch: () => void;\n}\n\nexport function usePdfViewerSearch(\n eventBusRef: RefObject<EventBus | null>,\n findControllerRef: RefObject<PDFFindController | null>,\n document: PDFDocumentProxy | undefined,\n): UsePdfViewerSearchResult {\n const [query, setQueryState] = useState(EMPTY_STRING);\n const [totalMatches, setTotalMatches] = useState(0);\n const [currentMatchIndex, setCurrentMatchIndex] = useState(0);\n const [isSearchOpen, setIsSearchOpen] = useState(false);\n\n const dispatchFind = useCallback(\n (queryString: string, findPrevious: boolean) => {\n eventBusRef.current?.dispatch(FIND_EVENT, {\n source: undefined,\n type: \"\",\n query: queryString,\n caseSensitive: false,\n highlightAll: true,\n phraseSearch: true,\n findPrevious,\n });\n },\n [eventBusRef],\n );\n\n const dispatchFindAgain = useCallback(\n (findPrevious: boolean) => {\n eventBusRef.current?.dispatch(FIND_EVENT, {\n source: undefined,\n type: \"again\",\n query,\n caseSensitive: false,\n highlightAll: true,\n phraseSearch: true,\n findPrevious,\n });\n },\n [eventBusRef, query],\n );\n\n const setQuery = useCallback(\n (input: string) => {\n setQueryState(input);\n\n if (input === EMPTY_STRING) {\n setTotalMatches(0);\n setCurrentMatchIndex(0);\n // Dispatch empty query to clear highlights\n dispatchFind(EMPTY_STRING, false);\n return;\n }\n\n dispatchFind(input, false);\n },\n [dispatchFind],\n );\n\n const nextMatch = useCallback(() => {\n dispatchFindAgain(false);\n }, [dispatchFindAgain]);\n\n const prevMatch = useCallback(() => {\n dispatchFindAgain(true);\n }, [dispatchFindAgain]);\n\n const openSearch = useCallback(() => {\n setIsSearchOpen(true);\n }, []);\n\n const closeSearch = useCallback(() => {\n setIsSearchOpen(false);\n setQueryState(EMPTY_STRING);\n setTotalMatches(0);\n setCurrentMatchIndex(0);\n // Clear highlights\n dispatchFind(EMPTY_STRING, false);\n }, [dispatchFind]);\n\n useEffect(function subscribeSearchEvents() {\n const eventBus = eventBusRef.current;\n if (eventBus == null) {\n return;\n }\n\n const handleMatchesCount = (evt: {\n matchesCount: { current: number; total: number };\n }) => {\n setTotalMatches(evt.matchesCount.total);\n setCurrentMatchIndex(\n evt.matchesCount.current > 0 ? evt.matchesCount.current - 1 : 0,\n );\n };\n\n const handleControlState = (evt: {\n state: number;\n matchesCount: { current: number; total: number };\n }) => {\n setTotalMatches(evt.matchesCount.total);\n setCurrentMatchIndex(\n evt.matchesCount.current > 0 ? evt.matchesCount.current - 1 : 0,\n );\n };\n\n eventBus.on(UPDATE_FIND_MATCHES_COUNT_EVENT, handleMatchesCount);\n eventBus.on(UPDATE_FIND_CONTROL_STATE_EVENT, handleControlState);\n\n return () => {\n eventBus.off(UPDATE_FIND_MATCHES_COUNT_EVENT, handleMatchesCount);\n eventBus.off(UPDATE_FIND_CONTROL_STATE_EVENT, handleControlState);\n };\n }, [eventBusRef, findControllerRef, document]);\n\n return useMemo((): UsePdfViewerSearchResult => ({\n query,\n totalMatches,\n currentMatchIndex,\n isSearchOpen,\n setQuery,\n nextMatch,\n prevMatch,\n openSearch,\n closeSearch,\n }), [\n query,\n totalMatches,\n currentMatchIndex,\n isSearchOpen,\n setQuery,\n nextMatch,\n prevMatch,\n openSearch,\n closeSearch,\n ]);\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
18
|
+
import { MAX_SCALE, MIN_SCALE, SCALE_STEP } from "../constants.js";
|
|
19
|
+
import { usePdfOutline } from "./usePdfOutline.js";
|
|
20
|
+
import { usePdfViewerCore } from "./usePdfViewerCore.js";
|
|
21
|
+
import { usePdfViewerSearch } from "./usePdfViewerSearch.js";
|
|
22
|
+
export function usePdfViewerState({
|
|
23
|
+
src,
|
|
24
|
+
initialPage,
|
|
25
|
+
initialScale,
|
|
26
|
+
initialSidebarOpen = false,
|
|
27
|
+
sidebarMode: sidebarModeProp = "thumbnails",
|
|
28
|
+
onDownload
|
|
29
|
+
}) {
|
|
30
|
+
const core = usePdfViewerCore({
|
|
31
|
+
src,
|
|
32
|
+
initialPage,
|
|
33
|
+
initialScale
|
|
34
|
+
});
|
|
35
|
+
const [rotation, setRotation] = useState(0);
|
|
36
|
+
const [sidebarOpen, setSidebarOpen] = useState(initialSidebarOpen);
|
|
37
|
+
const [sidebarMode, setSidebarMode] = useState(sidebarModeProp);
|
|
38
|
+
const search = usePdfViewerSearch(core.eventBusRef, core.findControllerRef, core.document);
|
|
39
|
+
const outlineItems = usePdfOutline(core.document);
|
|
40
|
+
|
|
41
|
+
// Sync sidebarMode prop changes to state
|
|
42
|
+
useEffect(function () {
|
|
43
|
+
setSidebarMode(sidebarModeProp);
|
|
44
|
+
}, [sidebarModeProp]);
|
|
45
|
+
|
|
46
|
+
// Sync rotation → PDFViewer
|
|
47
|
+
useEffect(function () {
|
|
48
|
+
const pdfViewer = core.pdfViewerRef.current;
|
|
49
|
+
if (pdfViewer != null) {
|
|
50
|
+
pdfViewer.pagesRotation = rotation;
|
|
51
|
+
}
|
|
52
|
+
}, [core.pdfViewerRef, rotation]);
|
|
53
|
+
|
|
54
|
+
// Ctrl+F keyboard shortcut
|
|
55
|
+
useEffect(function () {
|
|
56
|
+
const handleKeyDown = e => {
|
|
57
|
+
if ((e.ctrlKey || e.metaKey) && e.key === "f") {
|
|
58
|
+
e.preventDefault();
|
|
59
|
+
search.openSearch();
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
63
|
+
return () => {
|
|
64
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
65
|
+
};
|
|
66
|
+
}, [search.openSearch]);
|
|
67
|
+
const zoomIn = useCallback(() => {
|
|
68
|
+
core.setScale(Math.min(core.scale + SCALE_STEP, MAX_SCALE));
|
|
69
|
+
}, [core.scale, core.setScale]);
|
|
70
|
+
const zoomOut = useCallback(() => {
|
|
71
|
+
core.setScale(Math.max(core.scale - SCALE_STEP, MIN_SCALE));
|
|
72
|
+
}, [core.scale, core.setScale]);
|
|
73
|
+
const rotateLeft = useCallback(() => {
|
|
74
|
+
setRotation(prev => (prev - 90 + 360) % 360);
|
|
75
|
+
}, []);
|
|
76
|
+
const rotateRight = useCallback(() => {
|
|
77
|
+
setRotation(prev => (prev + 90) % 360);
|
|
78
|
+
}, []);
|
|
79
|
+
const toggleSidebar = useCallback(() => {
|
|
80
|
+
setSidebarOpen(prev => !prev);
|
|
81
|
+
}, []);
|
|
82
|
+
const download = useCallback(filename => {
|
|
83
|
+
if (core.document == null) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
void core.document.getData().then(data => {
|
|
87
|
+
const blob = new Blob([data.buffer], {
|
|
88
|
+
type: "application/pdf"
|
|
89
|
+
});
|
|
90
|
+
const url = URL.createObjectURL(blob);
|
|
91
|
+
const resolvedFilename = resolveDownloadFilename(src, filename);
|
|
92
|
+
const a = globalThis.document.createElement("a");
|
|
93
|
+
a.href = url;
|
|
94
|
+
a.download = resolvedFilename;
|
|
95
|
+
a.click();
|
|
96
|
+
URL.revokeObjectURL(url);
|
|
97
|
+
onDownload?.({
|
|
98
|
+
success: true,
|
|
99
|
+
filename: resolvedFilename
|
|
100
|
+
});
|
|
101
|
+
}).catch(err => {
|
|
102
|
+
onDownload?.({
|
|
103
|
+
success: false,
|
|
104
|
+
error: err instanceof Error ? err : new Error("Failed to download PDF")
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
}, [core.document, src, onDownload]);
|
|
108
|
+
return useMemo(() => ({
|
|
109
|
+
...core,
|
|
110
|
+
zoomIn,
|
|
111
|
+
zoomOut,
|
|
112
|
+
rotation,
|
|
113
|
+
rotateLeft,
|
|
114
|
+
rotateRight,
|
|
115
|
+
sidebarOpen,
|
|
116
|
+
sidebarMode,
|
|
117
|
+
setSidebarMode,
|
|
118
|
+
toggleSidebar,
|
|
119
|
+
search,
|
|
120
|
+
outlineItems,
|
|
121
|
+
download
|
|
122
|
+
}), [core, zoomIn, zoomOut, rotation, rotateLeft, rotateRight, sidebarOpen, sidebarMode, setSidebarMode, toggleSidebar, search, outlineItems, download]);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** Derive a download filename from an explicit name, the src URL, or a fallback. */
|
|
126
|
+
function resolveDownloadFilename(src, filename) {
|
|
127
|
+
if (filename != null) {
|
|
128
|
+
return filename;
|
|
129
|
+
}
|
|
130
|
+
if (typeof src === "string") {
|
|
131
|
+
return src.split("/").pop()?.split("?")[0] || "document.pdf";
|
|
132
|
+
}
|
|
133
|
+
return "document.pdf";
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=usePdfViewerState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePdfViewerState.js","names":["useCallback","useEffect","useMemo","useState","MAX_SCALE","MIN_SCALE","SCALE_STEP","usePdfOutline","usePdfViewerCore","usePdfViewerSearch","usePdfViewerState","src","initialPage","initialScale","initialSidebarOpen","sidebarMode","sidebarModeProp","onDownload","core","rotation","setRotation","sidebarOpen","setSidebarOpen","setSidebarMode","search","eventBusRef","findControllerRef","document","outlineItems","pdfViewer","pdfViewerRef","current","pagesRotation","handleKeyDown","e","ctrlKey","metaKey","key","preventDefault","openSearch","window","addEventListener","removeEventListener","zoomIn","setScale","Math","min","scale","zoomOut","max","rotateLeft","prev","rotateRight","toggleSidebar","download","filename","getData","then","data","blob","Blob","buffer","type","url","URL","createObjectURL","resolvedFilename","resolveDownloadFilename","a","globalThis","createElement","href","click","revokeObjectURL","success","catch","err","error","Error","split","pop"],"sources":["usePdfViewerState.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\nimport { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { MAX_SCALE, MIN_SCALE, SCALE_STEP } from \"../constants.js\";\nimport type { PdfDownloadResult, SidebarMode } from \"../types.js\";\nimport { usePdfOutline } from \"./usePdfOutline.js\";\nimport type {\n UsePdfViewerCoreOptions,\n UsePdfViewerCoreResult,\n} from \"./usePdfViewerCore.js\";\nimport { usePdfViewerCore } from \"./usePdfViewerCore.js\";\nimport type { UsePdfViewerSearchResult } from \"./usePdfViewerSearch.js\";\nimport { usePdfViewerSearch } from \"./usePdfViewerSearch.js\";\n\nexport interface UsePdfViewerStateOptions extends UsePdfViewerCoreOptions {\n /** Whether the sidebar is initially open (default false) */\n initialSidebarOpen?: boolean;\n /** Which sidebar panel to show (default \"thumbnails\") */\n sidebarMode?: SidebarMode;\n /** Callback fired when a download completes or fails */\n onDownload?: (result: PdfDownloadResult) => void;\n}\n\nexport interface UsePdfViewerStateResult extends UsePdfViewerCoreResult {\n /** Zoom in by one step */\n zoomIn: () => void;\n /** Zoom out by one step */\n zoomOut: () => void;\n\n /** Current rotation in degrees (0, 90, 180, 270) */\n rotation: number;\n /** Rotate 90 degrees counter-clockwise */\n rotateLeft: () => void;\n /** Rotate 90 degrees clockwise */\n rotateRight: () => void;\n\n /** Whether the sidebar panel is open */\n sidebarOpen: boolean;\n /** Which sidebar panel is active */\n sidebarMode: SidebarMode;\n /** Change the active sidebar panel */\n setSidebarMode: (mode: SidebarMode) => void;\n /** Toggle sidebar open/closed */\n toggleSidebar: () => void;\n\n /** Search state and actions */\n search: UsePdfViewerSearchResult;\n\n /** Document outline items (from bookmarks or text extraction) */\n outlineItems: ReturnType<typeof usePdfOutline>;\n\n /** Download the PDF as a file */\n download: (filename?: string) => void;\n}\n\nexport function usePdfViewerState({\n src,\n initialPage,\n initialScale,\n initialSidebarOpen = false,\n sidebarMode: sidebarModeProp = \"thumbnails\",\n onDownload,\n}: UsePdfViewerStateOptions): UsePdfViewerStateResult {\n const core = usePdfViewerCore({ src, initialPage, initialScale });\n\n const [rotation, setRotation] = useState(0);\n const [sidebarOpen, setSidebarOpen] = useState(initialSidebarOpen);\n const [sidebarMode, setSidebarMode] = useState<SidebarMode>(sidebarModeProp);\n\n const search = usePdfViewerSearch(\n core.eventBusRef,\n core.findControllerRef,\n core.document,\n );\n\n const outlineItems = usePdfOutline(core.document);\n\n // Sync sidebarMode prop changes to state\n useEffect(function syncSidebarMode() {\n setSidebarMode(sidebarModeProp);\n }, [sidebarModeProp]);\n\n // Sync rotation → PDFViewer\n useEffect(function syncRotationToViewer() {\n const pdfViewer = core.pdfViewerRef.current;\n if (pdfViewer != null) {\n pdfViewer.pagesRotation = rotation;\n }\n }, [core.pdfViewerRef, rotation]);\n\n // Ctrl+F keyboard shortcut\n useEffect(function registerSearchShortcut() {\n const handleKeyDown = (e: KeyboardEvent) => {\n if ((e.ctrlKey || e.metaKey) && e.key === \"f\") {\n e.preventDefault();\n search.openSearch();\n }\n };\n window.addEventListener(\"keydown\", handleKeyDown);\n return () => {\n window.removeEventListener(\"keydown\", handleKeyDown);\n };\n }, [search.openSearch]);\n\n const zoomIn = useCallback(() => {\n core.setScale(Math.min(core.scale + SCALE_STEP, MAX_SCALE));\n }, [core.scale, core.setScale]);\n\n const zoomOut = useCallback(() => {\n core.setScale(Math.max(core.scale - SCALE_STEP, MIN_SCALE));\n }, [core.scale, core.setScale]);\n\n const rotateLeft = useCallback(() => {\n setRotation((prev) => (prev - 90 + 360) % 360);\n }, []);\n\n const rotateRight = useCallback(() => {\n setRotation((prev) => (prev + 90) % 360);\n }, []);\n\n const toggleSidebar = useCallback(() => {\n setSidebarOpen((prev) => !prev);\n }, []);\n\n const download = useCallback((filename?: string) => {\n if (core.document == null) {\n return;\n }\n void core.document.getData().then((data) => {\n const blob = new Blob([data.buffer as ArrayBuffer], {\n type: \"application/pdf\",\n });\n const url = URL.createObjectURL(blob);\n const resolvedFilename = resolveDownloadFilename(src, filename);\n const a = globalThis.document.createElement(\"a\");\n a.href = url;\n a.download = resolvedFilename;\n a.click();\n URL.revokeObjectURL(url);\n onDownload?.({ success: true, filename: resolvedFilename });\n }).catch((err: unknown) => {\n onDownload?.({\n success: false,\n error: err instanceof Error\n ? err\n : new Error(\"Failed to download PDF\"),\n });\n });\n }, [core.document, src, onDownload]);\n\n return useMemo((): UsePdfViewerStateResult => ({\n ...core,\n zoomIn,\n zoomOut,\n rotation,\n rotateLeft,\n rotateRight,\n sidebarOpen,\n sidebarMode,\n setSidebarMode,\n toggleSidebar,\n search,\n outlineItems,\n download,\n }), [\n core,\n zoomIn,\n zoomOut,\n rotation,\n rotateLeft,\n rotateRight,\n sidebarOpen,\n sidebarMode,\n setSidebarMode,\n toggleSidebar,\n search,\n outlineItems,\n download,\n ]);\n}\n\n/** Derive a download filename from an explicit name, the src URL, or a fallback. */\nfunction resolveDownloadFilename(\n src: string | ArrayBuffer,\n filename: string | undefined,\n): string {\n if (filename != null) {\n return filename;\n }\n if (typeof src === \"string\") {\n return src.split(\"/\").pop()?.split(\"?\")[0] || \"document.pdf\";\n }\n return \"document.pdf\";\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { useCallback, useEffect, useRef } from "react";
|
|
18
|
+
import { PAGE_CHANGING_EVENT, SCALE_CHANGING_EVENT } from "../constants.js";
|
|
19
|
+
export function usePdfViewerSync({
|
|
20
|
+
pdfViewerRef,
|
|
21
|
+
eventBusRef,
|
|
22
|
+
document,
|
|
23
|
+
scale,
|
|
24
|
+
onScaleChange,
|
|
25
|
+
onPageChange
|
|
26
|
+
}) {
|
|
27
|
+
const lastScaleRef = useRef(scale);
|
|
28
|
+
|
|
29
|
+
// Sync React scale → PDFViewer
|
|
30
|
+
useEffect(function () {
|
|
31
|
+
const pdfViewer = pdfViewerRef.current;
|
|
32
|
+
if (pdfViewer == null) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (Math.abs(lastScaleRef.current - scale) > 0.001) {
|
|
36
|
+
lastScaleRef.current = scale;
|
|
37
|
+
pdfViewer.currentScale = scale;
|
|
38
|
+
}
|
|
39
|
+
}, [pdfViewerRef, scale]);
|
|
40
|
+
|
|
41
|
+
// Listen to PDFViewer events → React state
|
|
42
|
+
useEffect(function () {
|
|
43
|
+
const eventBus = eventBusRef.current;
|
|
44
|
+
if (eventBus == null) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const handlePageChanging = evt => {
|
|
48
|
+
onPageChange(evt.pageNumber);
|
|
49
|
+
};
|
|
50
|
+
const handleScaleChanging = evt => {
|
|
51
|
+
lastScaleRef.current = evt.scale;
|
|
52
|
+
onScaleChange(evt.scale);
|
|
53
|
+
};
|
|
54
|
+
eventBus.on(PAGE_CHANGING_EVENT, handlePageChanging);
|
|
55
|
+
eventBus.on(SCALE_CHANGING_EVENT, handleScaleChanging);
|
|
56
|
+
return () => {
|
|
57
|
+
eventBus.off(PAGE_CHANGING_EVENT, handlePageChanging);
|
|
58
|
+
eventBus.off(SCALE_CHANGING_EVENT, handleScaleChanging);
|
|
59
|
+
};
|
|
60
|
+
}, [eventBusRef, document, onPageChange, onScaleChange]);
|
|
61
|
+
const scrollToPage = useCallback(page => {
|
|
62
|
+
const pdfViewer = pdfViewerRef.current;
|
|
63
|
+
if (pdfViewer != null) {
|
|
64
|
+
pdfViewer.currentPageNumber = page;
|
|
65
|
+
}
|
|
66
|
+
}, [pdfViewerRef]);
|
|
67
|
+
return {
|
|
68
|
+
scrollToPage
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=usePdfViewerSync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePdfViewerSync.js","names":["useCallback","useEffect","useRef","PAGE_CHANGING_EVENT","SCALE_CHANGING_EVENT","usePdfViewerSync","pdfViewerRef","eventBusRef","document","scale","onScaleChange","onPageChange","lastScaleRef","pdfViewer","current","Math","abs","currentScale","eventBus","handlePageChanging","evt","pageNumber","handleScaleChanging","on","off","scrollToPage","page","currentPageNumber"],"sources":["usePdfViewerSync.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\nimport type { PDFDocumentProxy } from \"pdfjs-dist\";\nimport type { EventBus, PDFViewer } from \"pdfjs-dist/web/pdf_viewer.mjs\";\nimport type { RefObject } from \"react\";\nimport { useCallback, useEffect, useRef } from \"react\";\nimport { PAGE_CHANGING_EVENT, SCALE_CHANGING_EVENT } from \"../constants.js\";\n\ninterface UsePdfViewerSyncOptions {\n pdfViewerRef: RefObject<PDFViewer | null>;\n eventBusRef: RefObject<EventBus | null>;\n document: PDFDocumentProxy | undefined;\n scale: number;\n onScaleChange: (scale: number) => void;\n onPageChange: (page: number) => void;\n}\n\nexport function usePdfViewerSync({\n pdfViewerRef,\n eventBusRef,\n document,\n scale,\n onScaleChange,\n onPageChange,\n}: UsePdfViewerSyncOptions): {\n scrollToPage: (page: number) => void;\n} {\n const lastScaleRef = useRef(scale);\n\n // Sync React scale → PDFViewer\n useEffect(function syncScaleToViewer() {\n const pdfViewer = pdfViewerRef.current;\n if (pdfViewer == null) {\n return;\n }\n if (Math.abs(lastScaleRef.current - scale) > 0.001) {\n lastScaleRef.current = scale;\n pdfViewer.currentScale = scale;\n }\n }, [pdfViewerRef, scale]);\n\n // Listen to PDFViewer events → React state\n useEffect(function subscribeViewerEvents() {\n const eventBus = eventBusRef.current;\n if (eventBus == null) {\n return;\n }\n\n const handlePageChanging = (evt: { pageNumber: number }) => {\n onPageChange(evt.pageNumber);\n };\n\n const handleScaleChanging = (evt: { scale: number }) => {\n lastScaleRef.current = evt.scale;\n onScaleChange(evt.scale);\n };\n\n eventBus.on(PAGE_CHANGING_EVENT, handlePageChanging);\n eventBus.on(SCALE_CHANGING_EVENT, handleScaleChanging);\n\n return () => {\n eventBus.off(PAGE_CHANGING_EVENT, handlePageChanging);\n eventBus.off(SCALE_CHANGING_EVENT, handleScaleChanging);\n };\n }, [eventBusRef, document, onPageChange, onScaleChange]);\n\n const scrollToPage = useCallback(\n (page: number) => {\n const pdfViewer = pdfViewerRef.current;\n if (pdfViewer != null) {\n pdfViewer.currentPageNumber = page;\n }\n },\n [pdfViewerRef],\n );\n\n return { scrollToPage };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,SAASA,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACtD,SAASC,mBAAmB,EAAEC,oBAAoB,QAAQ,iBAAiB;AAW3E,OAAO,SAASC,gBAAgBA,CAAC;EAC/BC,YAAY;EACZC,WAAW;EACXC,QAAQ;EACRC,KAAK;EACLC,aAAa;EACbC;AACuB,CAAC,EAExB;EACA,MAAMC,YAAY,GAAGV,MAAM,CAACO,KAAK,CAAC;;EAElC;EACAR,SAAS,CAAC,YAA6B;IACrC,MAAMY,SAAS,GAAGP,YAAY,CAACQ,OAAO;IACtC,IAAID,SAAS,IAAI,IAAI,EAAE;MACrB;IACF;IACA,IAAIE,IAAI,CAACC,GAAG,CAACJ,YAAY,CAACE,OAAO,GAAGL,KAAK,CAAC,GAAG,KAAK,EAAE;MAClDG,YAAY,CAACE,OAAO,GAAGL,KAAK;MAC5BI,SAAS,CAACI,YAAY,GAAGR,KAAK;IAChC;EACF,CAAC,EAAE,CAACH,YAAY,EAAEG,KAAK,CAAC,CAAC;;EAEzB;EACAR,SAAS,CAAC,YAAiC;IACzC,MAAMiB,QAAQ,GAAGX,WAAW,CAACO,OAAO;IACpC,IAAII,QAAQ,IAAI,IAAI,EAAE;MACpB;IACF;IAEA,MAAMC,kBAAkB,GAAIC,GAA2B,IAAK;MAC1DT,YAAY,CAACS,GAAG,CAACC,UAAU,CAAC;IAC9B,CAAC;IAED,MAAMC,mBAAmB,GAAIF,GAAsB,IAAK;MACtDR,YAAY,CAACE,OAAO,GAAGM,GAAG,CAACX,KAAK;MAChCC,aAAa,CAACU,GAAG,CAACX,KAAK,CAAC;IAC1B,CAAC;IAEDS,QAAQ,CAACK,EAAE,CAACpB,mBAAmB,EAAEgB,kBAAkB,CAAC;IACpDD,QAAQ,CAACK,EAAE,CAACnB,oBAAoB,EAAEkB,mBAAmB,CAAC;IAEtD,OAAO,MAAM;MACXJ,QAAQ,CAACM,GAAG,CAACrB,mBAAmB,EAAEgB,kBAAkB,CAAC;MACrDD,QAAQ,CAACM,GAAG,CAACpB,oBAAoB,EAAEkB,mBAAmB,CAAC;IACzD,CAAC;EACH,CAAC,EAAE,CAACf,WAAW,EAAEC,QAAQ,EAAEG,YAAY,EAAED,aAAa,CAAC,CAAC;EAExD,MAAMe,YAAY,GAAGzB,WAAW,CAC7B0B,IAAY,IAAK;IAChB,MAAMb,SAAS,GAAGP,YAAY,CAACQ,OAAO;IACtC,IAAID,SAAS,IAAI,IAAI,EAAE;MACrBA,SAAS,CAACc,iBAAiB,GAAGD,IAAI;IACpC;EACF,CAAC,EACD,CAACpB,YAAY,CACf,CAAC;EAED,OAAO;IAAEmB;EAAa,CAAC;AACzB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["types.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\nimport type React from \"react\";\n\n/** Which sidebar panel to display when the sidebar is open. */\nexport type SidebarMode = \"thumbnails\" | \"outline\";\n\n/** A single item in the PDF document outline (table of contents). */\nexport interface OutlineItem {\n title: string;\n depth: number;\n pageNumber: number;\n bold: boolean;\n italic: boolean;\n}\n\n/** The visual style of an annotation rendered on the PDF. */\nexport type AnnotationType =\n | \"highlight\"\n | \"underline\"\n | \"comment\"\n | \"pin\"\n | \"custom\";\n\n/** A rectangle in PDF coordinate space (origin: bottom-left of page). */\nexport interface PdfRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\n/** Props passed to a custom annotation renderer. */\nexport interface PdfAnnotationRenderProps {\n annotation: PdfAnnotation;\n scale: number;\n pageHeight: number;\n}\n\n/** Common fields shared by all annotation types. */\ninterface PdfAnnotationBase {\n /** Unique identifier for this annotation */\n id: string;\n /** Page number (1-indexed) */\n page: number;\n /** Coordinates in PDF points (origin: bottom-left of page) */\n rect: PdfRect;\n /** Additional rects for multi-line text highlights. When present, all rects are rendered. */\n rects?: PdfRect[];\n /** Optional label or tooltip text */\n label?: string;\n /** Optional color override (CSS color string) */\n color?: string;\n}\n\n/** A built-in annotation type (highlight, underline, comment, pin). */\ninterface PdfStandardAnnotation extends PdfAnnotationBase {\n /** The type of annotation to render */\n type: \"highlight\" | \"underline\" | \"comment\" | \"pin\";\n}\n\n/** A custom annotation with a user-provided renderer. */\nexport interface PdfCustomAnnotation extends PdfAnnotationBase {\n /** Must be \"custom\" for custom-rendered annotations */\n type: \"custom\";\n /** Render function for the custom annotation content (required for custom type) */\n render: (props: PdfAnnotationRenderProps) => React.ReactNode;\n}\n\n/** A single annotation positioned on a specific page of the PDF. */\nexport type PdfAnnotation = PdfStandardAnnotation | PdfCustomAnnotation;\n\n/** Result passed to the {@link PdfViewerProps.onDownload} callback. */\nexport type PdfDownloadResult =\n | { success: true; filename: string }\n | { success: false; error: Error };\n\n/** Possible values for a PDF form field. */\nexport type PdfFormFieldValue = string | boolean | string[];\n\n/** Data emitted when the user creates a text highlight via the highlight editor. */\nexport interface PdfTextHighlightEvent {\n /** Internal PDF.js editor ID. Use with `deleteHighlight` to programmatically remove. */\n editorId: string;\n /** Page number (1-indexed) */\n page: number;\n /** Bounding rects in PDF coordinate space (bottom-left origin) */\n rects: PdfRect[];\n /** The selected text content */\n selectedText: string;\n /** Highlight color as CSS color string */\n color: string;\n}\n\n/** Imperative handle for programmatic control of a {@link PdfViewer} or {@link BasePdfViewer}. */\nexport interface PdfViewerHandle {\n /** Scroll the viewer to the given page number (1-indexed). */\n scrollToPage: (page: number) => void;\n /** Programmatically delete a highlight by its `editorId` (from {@link PdfTextHighlightEvent}). */\n deleteHighlight: (editorId: string) => void;\n}\n\n/**\n * Options for {@link usePdfViewerInstance}.\n * Equivalent to {@link PdfViewerProps} minus the `className` rendering concern.\n */\nexport interface PdfViewerInstanceOptions {\n /** PDF source — URL string or ArrayBuffer */\n src: string | ArrayBuffer;\n /** Annotations to overlay on the PDF */\n annotations?: PdfAnnotation[];\n /** Callback fired when an annotation is clicked */\n onAnnotationClick?: (annotation: PdfAnnotation) => void;\n /** Callback fired when a download completes or fails */\n onDownload?: (result: PdfDownloadResult) => void;\n /** Whether the highlight toggle button is shown in the toolbar */\n highlightEnabled?: boolean;\n /** Callback fired when the user creates a text highlight */\n onTextHighlight?: (event: PdfTextHighlightEvent) => void;\n /** Callback fired when the user deletes a highlight */\n onHighlightDelete?: (event: PdfTextHighlightEvent) => void;\n /** Initial form field values keyed by field name */\n formData?: Record<string, PdfFormFieldValue>;\n /** Callback fired when the user clicks the save button */\n onFormSubmit?: (data: Record<string, PdfFormFieldValue>) => void;\n /** Callback fired when any form field value changes */\n onFormChange?: (fieldName: string, value: PdfFormFieldValue) => void;\n /** Initial page number (1-indexed, default 1) */\n initialPage?: number;\n /** Initial zoom scale (default 1.0) */\n initialScale?: number;\n /** Whether the sidebar is initially open (default false) */\n initialSidebarOpen?: boolean;\n /** Whether the download button is shown in the toolbar */\n enableDownload?: boolean;\n /** Which sidebar panel to show: thumbnails or document outline */\n sidebarMode?: SidebarMode;\n /** Custom icon components for each outline depth level (0-indexed) */\n outlineIcons?: Partial<Record<number, React.ComponentType>>;\n}\n\n/** Props for the {@link PdfViewer} component. */\nexport interface PdfViewerProps {\n /** PDF source — URL string or ArrayBuffer */\n src: string | ArrayBuffer;\n /** Annotations to overlay on the PDF */\n annotations?: PdfAnnotation[];\n /**\n * Callback fired when an annotation is clicked.\n *\n * @param annotation - The annotation that was clicked\n * @returns void\n */\n onAnnotationClick?: (annotation: PdfAnnotation) => void;\n /**\n * Callback fired when a download completes or fails.\n *\n * @param result - The download result indicating success with the filename, or failure with an error\n * @returns void\n */\n onDownload?: (result: PdfDownloadResult) => void;\n /**\n * Whether the highlight toggle button is shown in the toolbar.\n * @default false\n */\n enableHighlight?: boolean;\n /**\n * Callback fired when the user creates a text highlight.\n * Only fires when highlight mode is active.\n *\n * @param event - The highlight event with page, rects, text, and color\n * @returns void\n */\n onTextHighlight?: (event: PdfTextHighlightEvent) => void;\n /**\n * Callback fired when the user deletes a highlight via the PDF.js editor UI.\n *\n * @param event - The highlight event that was deleted\n * @returns void\n */\n onHighlightDelete?: (event: PdfTextHighlightEvent) => void;\n /** Initial page number (1-indexed, default 1) */\n initialPage?: number;\n /** Initial zoom scale (default 1.0) */\n initialScale?: number;\n /** Whether the sidebar is initially open (default false) */\n initialSidebarOpen?: boolean;\n /**\n * Whether the download button is shown in the toolbar.\n * @default false\n */\n enableDownload?: boolean;\n /**\n * Which sidebar panel to show: thumbnails or document outline.\n * @default \"thumbnails\"\n */\n sidebarMode?: SidebarMode;\n /**\n * Custom icon components for each outline depth level (0-indexed).\n * Key 0 = top-level items, 1 = first nesting level, etc.\n * If omitted, no icons are rendered.\n */\n outlineIcons?: Partial<Record<number, React.ComponentType>>;\n /**\n * Initial form field values keyed by field name. Applied when the document loads.\n * Use this to pre-populate form fields when resuming a previously edited PDF.\n */\n formData?: Record<string, PdfFormFieldValue>;\n /**\n * Callback fired when the user clicks the save button in the toolbar.\n * Receives all current form field values keyed by field name.\n *\n * @param data - All form field values keyed by field name\n * @returns void\n */\n onFormSubmit?: (data: Record<string, PdfFormFieldValue>) => void;\n /**\n * Callback fired when any form field value changes.\n *\n * @param fieldName - The name of the field that changed\n * @param value - The new value\n * @returns void\n */\n onFormChange?: (fieldName: string, value: PdfFormFieldValue) => void;\n /** Additional CSS class name for the root element */\n className?: string;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
export { BaseFilterList } from "../filter-list/base/BaseFilterList.js";
|
|
18
|
+
export { FilterList } from "../filter-list/FilterList.js";
|
|
19
|
+
export { deserializeFilterStates, serializeFilterStates } from "../filter-list/utils/filterStateSerialization.js";
|
|
20
|
+
|
|
17
21
|
// ObjectTable that loads and displays data for a given objectSet
|
|
18
22
|
export { ObjectTable } from "../object-table/ObjectTable.js";
|
|
19
23
|
|
|
@@ -21,4 +25,34 @@ export { ObjectTable } from "../object-table/ObjectTable.js";
|
|
|
21
25
|
|
|
22
26
|
export { BaseTable } from "../object-table/Table.js";
|
|
23
27
|
export { ColumnConfigDialog } from "../object-table/ColumnConfigDialog.js";
|
|
28
|
+
// PdfViewer
|
|
29
|
+
export { BasePdfViewer } from "../pdf-viewer/PdfViewer.js";
|
|
30
|
+
// PdfViewer building blocks
|
|
31
|
+
export { PdfViewerAnnotationLayer } from "../pdf-viewer/components/PdfViewerAnnotationLayer.js";
|
|
32
|
+
export { PdfViewerContent } from "../pdf-viewer/components/PdfViewerContent.js";
|
|
33
|
+
export { PdfViewerOutlineSidebar } from "../pdf-viewer/components/PdfViewerOutlineSidebar.js";
|
|
34
|
+
export { PdfViewerSearchBar } from "../pdf-viewer/components/PdfViewerSearchBar.js";
|
|
35
|
+
export { PdfViewerSidebar } from "../pdf-viewer/components/PdfViewerSidebar.js";
|
|
36
|
+
export { PdfViewerToolbar } from "../pdf-viewer/components/PdfViewerToolbar.js";
|
|
37
|
+
|
|
38
|
+
// PdfViewer hooks — primitive
|
|
39
|
+
export { usePdfAnnotationPortals } from "../pdf-viewer/hooks/usePdfAnnotationPortals.js";
|
|
40
|
+
export { usePdfAnnotationsByPage } from "../pdf-viewer/hooks/usePdfAnnotationsByPage.js";
|
|
41
|
+
export { usePdfDocument } from "../pdf-viewer/hooks/usePdfDocument.js";
|
|
42
|
+
export { usePdfFormFields } from "../pdf-viewer/hooks/usePdfFormFields.js";
|
|
43
|
+
export { usePdfHighlightMode } from "../pdf-viewer/hooks/usePdfHighlightMode.js";
|
|
44
|
+
export { usePdfOutline } from "../pdf-viewer/hooks/usePdfOutline.js";
|
|
45
|
+
export { usePdfViewer } from "../pdf-viewer/hooks/usePdfViewer.js";
|
|
46
|
+
export { usePdfViewerSearch } from "../pdf-viewer/hooks/usePdfViewerSearch.js";
|
|
47
|
+
export { usePdfViewerSync } from "../pdf-viewer/hooks/usePdfViewerSync.js";
|
|
48
|
+
// PdfViewer context
|
|
49
|
+
export { PdfViewerProvider, usePdfViewerContext, usePdfViewerInstance } from "../pdf-viewer/PdfViewerContext.js";
|
|
50
|
+
// PdfViewer hooks — composition
|
|
51
|
+
export { usePdfViewerCore } from "../pdf-viewer/hooks/usePdfViewerCore.js";
|
|
52
|
+
export { usePdfViewerState } from "../pdf-viewer/hooks/usePdfViewerState.js";
|
|
53
|
+
|
|
54
|
+
// PdfViewer (Media wrapper)
|
|
55
|
+
export { PdfViewer } from "../pdf-viewer/PdfRenderer.js";
|
|
56
|
+
export { ActionForm } from "../action-form/ActionForm.js";
|
|
57
|
+
export { BaseForm } from "../action-form/BaseForm.js";
|
|
24
58
|
//# sourceMappingURL=experimental.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experimental.js","names":["ObjectTable","BaseTable","ColumnConfigDialog"],"sources":["experimental.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\nexport type {\n FilterDefinitionUnion,\n FilterListProps,\n} from \"../filter-list/FilterListApi.js\";\nexport type {\n FilterComponentType,\n FilterListItemProps,\n FilterState,\n PropertyFilterDefinition,\n} from \"../filter-list/FilterListItemApi.js\";\n\n// ObjectTable that loads and displays data for a given objectSet\nexport { ObjectTable } from \"../object-table/ObjectTable.js\";\nexport type {\n ColumnDefinition,\n ColumnDefinitionLocator,\n ObjectTableProps,\n} from \"../object-table/ObjectTableApi.js\";\nexport type {
|
|
1
|
+
{"version":3,"file":"experimental.js","names":["BaseFilterList","FilterList","deserializeFilterStates","serializeFilterStates","ObjectTable","BaseTable","ColumnConfigDialog","BasePdfViewer","PdfViewerAnnotationLayer","PdfViewerContent","PdfViewerOutlineSidebar","PdfViewerSearchBar","PdfViewerSidebar","PdfViewerToolbar","usePdfAnnotationPortals","usePdfAnnotationsByPage","usePdfDocument","usePdfFormFields","usePdfHighlightMode","usePdfOutline","usePdfViewer","usePdfViewerSearch","usePdfViewerSync","PdfViewerProvider","usePdfViewerContext","usePdfViewerInstance","usePdfViewerCore","usePdfViewerState","PdfViewer","ActionForm","BaseForm"],"sources":["experimental.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\nexport { BaseFilterList } from \"../filter-list/base/BaseFilterList.js\";\nexport type {\n BaseFilterListProps,\n RenderFilterInput,\n} from \"../filter-list/base/BaseFilterListApi.js\";\nexport { FilterList } from \"../filter-list/FilterList.js\";\n\nexport type {\n FilterDefinitionUnion,\n FilterListProps,\n} from \"../filter-list/FilterListApi.js\";\nexport type {\n FilterComponentType,\n FilterListItemProps,\n FilterState,\n PropertyFilterDefinition,\n} from \"../filter-list/FilterListItemApi.js\";\nexport {\n deserializeFilterStates,\n serializeFilterStates,\n} from \"../filter-list/utils/filterStateSerialization.js\";\n\n// ObjectTable that loads and displays data for a given objectSet\nexport { ObjectTable } from \"../object-table/ObjectTable.js\";\nexport type {\n ColumnDefinition,\n ColumnDefinitionLocator,\n CustomColumnLocator,\n FunctionColumnLocator,\n ObjectTableProps,\n PropertyColumnLocator,\n RdpColumnLocator,\n} from \"../object-table/ObjectTableApi.js\";\nexport type { CellEditInfo } from \"../object-table/utils/types.js\";\n\n// BaseTable that does not handle data fetching\nexport type { BaseTableProps } from \"../object-table/Table.js\";\nexport { BaseTable } from \"../object-table/Table.js\";\n\nexport { ColumnConfigDialog } from \"../object-table/ColumnConfigDialog.js\";\nexport type {\n ColumnConfigDialogProps,\n ColumnConfigOptions,\n} from \"../object-table/ColumnConfigDialog.js\";\n\n// PdfViewer\nexport { BasePdfViewer } from \"../pdf-viewer/PdfViewer.js\";\nexport type {\n AnnotationType,\n PdfAnnotation,\n PdfAnnotationRenderProps,\n PdfCustomAnnotation,\n PdfDownloadResult,\n PdfFormFieldValue,\n PdfRect,\n PdfTextHighlightEvent,\n PdfViewerProps,\n SidebarMode,\n} from \"../pdf-viewer/types.js\";\n\n// PdfViewer building blocks\nexport {\n PdfViewerAnnotationLayer,\n type PdfViewerAnnotationLayerProps,\n} from \"../pdf-viewer/components/PdfViewerAnnotationLayer.js\";\nexport {\n PdfViewerContent,\n type PdfViewerContentProps,\n} from \"../pdf-viewer/components/PdfViewerContent.js\";\nexport {\n PdfViewerOutlineSidebar,\n type PdfViewerOutlineSidebarProps,\n} from \"../pdf-viewer/components/PdfViewerOutlineSidebar.js\";\nexport {\n PdfViewerSearchBar,\n type PdfViewerSearchBarProps,\n} from \"../pdf-viewer/components/PdfViewerSearchBar.js\";\nexport {\n PdfViewerSidebar,\n type PdfViewerSidebarProps,\n} from \"../pdf-viewer/components/PdfViewerSidebar.js\";\nexport {\n PdfViewerToolbar,\n type PdfViewerToolbarProps,\n} from \"../pdf-viewer/components/PdfViewerToolbar.js\";\n\n// PdfViewer hooks — primitive\nexport {\n type AnnotationPortalTarget,\n usePdfAnnotationPortals,\n} from \"../pdf-viewer/hooks/usePdfAnnotationPortals.js\";\nexport { usePdfAnnotationsByPage } from \"../pdf-viewer/hooks/usePdfAnnotationsByPage.js\";\nexport { usePdfDocument } from \"../pdf-viewer/hooks/usePdfDocument.js\";\nexport {\n usePdfFormFields,\n type UsePdfFormFieldsOptions,\n type UsePdfFormFieldsResult,\n} from \"../pdf-viewer/hooks/usePdfFormFields.js\";\nexport {\n usePdfHighlightMode,\n type UsePdfHighlightModeOptions,\n type UsePdfHighlightModeResult,\n} from \"../pdf-viewer/hooks/usePdfHighlightMode.js\";\nexport { usePdfOutline } from \"../pdf-viewer/hooks/usePdfOutline.js\";\nexport {\n usePdfViewer,\n type UsePdfViewerResult,\n} from \"../pdf-viewer/hooks/usePdfViewer.js\";\nexport {\n usePdfViewerSearch,\n type UsePdfViewerSearchResult,\n} from \"../pdf-viewer/hooks/usePdfViewerSearch.js\";\nexport { usePdfViewerSync } from \"../pdf-viewer/hooks/usePdfViewerSync.js\";\nexport { type OutlineItem } from \"../pdf-viewer/types.js\";\n\n// PdfViewer context\nexport {\n type PdfViewerContextValue,\n PdfViewerProvider,\n usePdfViewerContext,\n usePdfViewerInstance,\n} from \"../pdf-viewer/PdfViewerContext.js\";\nexport type {\n PdfViewerHandle,\n PdfViewerInstanceOptions,\n} from \"../pdf-viewer/types.js\";\n\n// PdfViewer hooks — composition\nexport {\n usePdfViewerCore,\n type UsePdfViewerCoreOptions,\n type UsePdfViewerCoreResult,\n} from \"../pdf-viewer/hooks/usePdfViewerCore.js\";\nexport {\n usePdfViewerState,\n type UsePdfViewerStateOptions,\n type UsePdfViewerStateResult,\n} from \"../pdf-viewer/hooks/usePdfViewerState.js\";\n\n// PdfViewer (Media wrapper)\nexport {\n PdfViewer,\n type PdfViewerMediaProps,\n} from \"../pdf-viewer/PdfRenderer.js\";\n\nexport { ActionForm } from \"../action-form/ActionForm.js\";\nexport type {\n ActionFormProps,\n BaseFormProps,\n FormError,\n FormState,\n} from \"../action-form/ActionFormApi.js\";\nexport { BaseForm } from \"../action-form/BaseForm.js\";\nexport type {\n ActionParameters,\n BaseFormFieldProps,\n CustomFieldProps,\n DatetimePickerFieldProps,\n DropdownFieldProps,\n FieldComponent,\n FieldValueType,\n FilePickerProps,\n FormFieldDefinition,\n FormFieldPropsByType,\n NumberInputFieldProps,\n ObjectSetFieldProps,\n Option,\n RadioButtonsFieldProps,\n RendererFieldDefinition,\n TextAreaFieldProps,\n TextInputFieldProps,\n} from \"../action-form/FormFieldApi.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,cAAc,QAAQ,uCAAuC;AAKtE,SAASC,UAAU,QAAQ,8BAA8B;AAYzD,SACEC,uBAAuB,EACvBC,qBAAqB,QAChB,kDAAkD;;AAEzD;AACA,SAASC,WAAW,QAAQ,gCAAgC;;AAY5D;;AAEA,SAASC,SAAS,QAAQ,0BAA0B;AAEpD,SAASC,kBAAkB,QAAQ,uCAAuC;AAM1E;AACA,SAASC,aAAa,QAAQ,4BAA4B;AAc1D;AACA,SACEC,wBAAwB,QAEnB,sDAAsD;AAC7D,SACEC,gBAAgB,QAEX,8CAA8C;AACrD,SACEC,uBAAuB,QAElB,qDAAqD;AAC5D,SACEC,kBAAkB,QAEb,gDAAgD;AACvD,SACEC,gBAAgB,QAEX,8CAA8C;AACrD,SACEC,gBAAgB,QAEX,8CAA8C;;AAErD;AACA,SAEEC,uBAAuB,QAClB,gDAAgD;AACvD,SAASC,uBAAuB,QAAQ,gDAAgD;AACxF,SAASC,cAAc,QAAQ,uCAAuC;AACtE,SACEC,gBAAgB,QAGX,yCAAyC;AAChD,SACEC,mBAAmB,QAGd,4CAA4C;AACnD,SAASC,aAAa,QAAQ,sCAAsC;AACpE,SACEC,YAAY,QAEP,qCAAqC;AAC5C,SACEC,kBAAkB,QAEb,2CAA2C;AAClD,SAASC,gBAAgB,QAAQ,yCAAyC;AAG1E;AACA,SAEEC,iBAAiB,EACjBC,mBAAmB,EACnBC,oBAAoB,QACf,mCAAmC;AAM1C;AACA,SACEC,gBAAgB,QAGX,yCAAyC;AAChD,SACEC,iBAAiB,QAGZ,0CAA0C;;AAEjD;AACA,SACEC,SAAS,QAEJ,8BAA8B;AAErC,SAASC,UAAU,QAAQ,8BAA8B;AAOzD,SAASC,QAAQ,QAAQ,4BAA4B","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 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 { ActionButton } from "../base-components/action-button/ActionButton.js";
|
|
18
|
+
export { Dialog } from "../base-components/dialog/Dialog.js";
|
|
19
|
+
export { Tooltip, TooltipArrow } from "../base-components/tooltip/index.js";
|
|
20
|
+
//# sourceMappingURL=primitives.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitives.js","names":["ActionButton","Dialog","Tooltip","TooltipArrow"],"sources":["primitives.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\nexport {\n ActionButton,\n type ButtonProps,\n} from \"../base-components/action-button/ActionButton.js\";\nexport { Dialog, type DialogProps } from \"../base-components/dialog/Dialog.js\";\nexport {\n Tooltip,\n TooltipArrow,\n type TooltipProps,\n} from \"../base-components/tooltip/index.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,YAAY,QAEP,kDAAkD;AACzD,SAASC,MAAM,QAA0B,qCAAqC;AAC9E,SACEC,OAAO,EACPC,YAAY,QAEP,qCAAqC","ignoreList":[]}
|