@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,341 @@
|
|
|
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, useState } from "react";
|
|
18
|
+
import { ANNOTATION_LAYER_RENDERED_EVENT } from "../constants.js";
|
|
19
|
+
/** Get the viewer's container element (typed loosely by pdf.js). */
|
|
20
|
+
function getViewerContainer(viewer) {
|
|
21
|
+
return viewer.container;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Internal metadata for a single form field annotation. */
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Normalizes a pdf.js field object type string to a simplified form type.
|
|
28
|
+
* @internal Exported for testing.
|
|
29
|
+
*/
|
|
30
|
+
export function normalizeFieldType(type) {
|
|
31
|
+
switch (type) {
|
|
32
|
+
case "checkbox":
|
|
33
|
+
case "radiobutton":
|
|
34
|
+
case "combobox":
|
|
35
|
+
case "listbox":
|
|
36
|
+
return type;
|
|
37
|
+
default:
|
|
38
|
+
return "text";
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Converts a pdf.js annotationStorage value to a consumer-friendly PdfFormFieldValue.
|
|
44
|
+
* @internal Exported for testing.
|
|
45
|
+
*/
|
|
46
|
+
export function toFormFieldValue(storageValue, fieldType) {
|
|
47
|
+
if (fieldType === "checkbox") {
|
|
48
|
+
if (typeof storageValue === "boolean") {
|
|
49
|
+
return storageValue;
|
|
50
|
+
}
|
|
51
|
+
// pdf.js stores checkbox as the export value when checked, "Off" when unchecked
|
|
52
|
+
return storageValue !== "Off" && storageValue !== false;
|
|
53
|
+
}
|
|
54
|
+
if (fieldType === "radiobutton") {
|
|
55
|
+
return typeof storageValue === "string" ? storageValue : "";
|
|
56
|
+
}
|
|
57
|
+
if (typeof storageValue === "string") {
|
|
58
|
+
return storageValue;
|
|
59
|
+
}
|
|
60
|
+
if (Array.isArray(storageValue)) {
|
|
61
|
+
return storageValue.map(String);
|
|
62
|
+
}
|
|
63
|
+
return "";
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Converts a consumer PdfFormFieldValue to a pdf.js annotationStorage value.
|
|
68
|
+
* @internal Exported for testing.
|
|
69
|
+
*/
|
|
70
|
+
export function toStorageValue(formValue, fieldType) {
|
|
71
|
+
if (fieldType === "checkbox") {
|
|
72
|
+
if (typeof formValue === "boolean") {
|
|
73
|
+
return formValue;
|
|
74
|
+
}
|
|
75
|
+
return formValue !== "Off" && formValue !== "";
|
|
76
|
+
}
|
|
77
|
+
return formValue;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Hook that manages interactive PDF form fields.
|
|
82
|
+
* Builds a field metadata map, pre-populates initial values,
|
|
83
|
+
* listens for field changes, and collects values on submit.
|
|
84
|
+
*/
|
|
85
|
+
export function usePdfFormFields({
|
|
86
|
+
pdfViewerRef,
|
|
87
|
+
eventBusRef,
|
|
88
|
+
document,
|
|
89
|
+
formData,
|
|
90
|
+
onFormSubmit,
|
|
91
|
+
onFormChange
|
|
92
|
+
}) {
|
|
93
|
+
const [hasFormFields, setHasFormFields] = useState(false);
|
|
94
|
+
|
|
95
|
+
// Stable refs for callbacks
|
|
96
|
+
const onFormSubmitRef = useRef(onFormSubmit);
|
|
97
|
+
const onFormChangeRef = useRef(onFormChange);
|
|
98
|
+
const formDataRef = useRef(formData);
|
|
99
|
+
useEffect(function () {
|
|
100
|
+
onFormSubmitRef.current = onFormSubmit;
|
|
101
|
+
onFormChangeRef.current = onFormChange;
|
|
102
|
+
formDataRef.current = formData;
|
|
103
|
+
}, [onFormSubmit, onFormChange, formData]);
|
|
104
|
+
|
|
105
|
+
// Map from annotation ID -> field metadata
|
|
106
|
+
const fieldMapRef = useRef(new Map());
|
|
107
|
+
// Reverse map from field name -> annotation IDs
|
|
108
|
+
const nameToIdsRef = useRef(new Map());
|
|
109
|
+
|
|
110
|
+
// Effect 1: Build field metadata map when document loads
|
|
111
|
+
useEffect(function () {
|
|
112
|
+
const doc = document;
|
|
113
|
+
if (doc == null) {
|
|
114
|
+
fieldMapRef.current.clear();
|
|
115
|
+
nameToIdsRef.current.clear();
|
|
116
|
+
setHasFormFields(false);
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
let cancelled = false;
|
|
120
|
+
void doc.getFieldObjects().then(fieldObjects => {
|
|
121
|
+
if (cancelled || fieldObjects == null) {
|
|
122
|
+
setHasFormFields(false);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const fieldMap = new Map();
|
|
126
|
+
const nameToIds = new Map();
|
|
127
|
+
for (const [fieldName, objects] of Object.entries(fieldObjects)) {
|
|
128
|
+
const ids = [];
|
|
129
|
+
for (const obj of objects) {
|
|
130
|
+
const typedObj = obj;
|
|
131
|
+
if (typedObj.id == null) continue;
|
|
132
|
+
const fieldType = normalizeFieldType(typedObj.type ?? "text");
|
|
133
|
+
fieldMap.set(typedObj.id, {
|
|
134
|
+
fieldName,
|
|
135
|
+
fieldType,
|
|
136
|
+
exportValues: typedObj.exportValues,
|
|
137
|
+
page: typedObj.page ?? 0
|
|
138
|
+
});
|
|
139
|
+
ids.push(typedObj.id);
|
|
140
|
+
}
|
|
141
|
+
if (ids.length > 0) {
|
|
142
|
+
nameToIds.set(fieldName, ids);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
fieldMapRef.current = fieldMap;
|
|
146
|
+
nameToIdsRef.current = nameToIds;
|
|
147
|
+
setHasFormFields(fieldMap.size > 0);
|
|
148
|
+
});
|
|
149
|
+
return () => {
|
|
150
|
+
cancelled = true;
|
|
151
|
+
};
|
|
152
|
+
}, [document]);
|
|
153
|
+
|
|
154
|
+
// Populates form fields from formData into both annotation storage and DOM elements.
|
|
155
|
+
// Scoped to the viewer container to avoid conflicts with multiple viewer instances.
|
|
156
|
+
const populateFields = useCallback(() => {
|
|
157
|
+
const data = formDataRef.current;
|
|
158
|
+
const doc = document;
|
|
159
|
+
const pdfViewer = pdfViewerRef.current;
|
|
160
|
+
if (data == null || doc == null || pdfViewer == null) return;
|
|
161
|
+
if (fieldMapRef.current.size === 0) return;
|
|
162
|
+
const storage = doc.annotationStorage;
|
|
163
|
+
const container = getViewerContainer(pdfViewer);
|
|
164
|
+
for (const [fieldName, value] of Object.entries(data)) {
|
|
165
|
+
const ids = nameToIdsRef.current.get(fieldName);
|
|
166
|
+
if (ids == null) continue;
|
|
167
|
+
for (const id of ids) {
|
|
168
|
+
const entry = fieldMapRef.current.get(id);
|
|
169
|
+
if (entry == null) continue;
|
|
170
|
+
|
|
171
|
+
// Also update the DOM element directly (scoped to viewer container)
|
|
172
|
+
const el = container?.querySelector(`[data-element-id="${CSS.escape(id)}"]`);
|
|
173
|
+
if (entry.fieldType === "radiobutton") {
|
|
174
|
+
// Radio buttons: each ID is a separate option. Check the one
|
|
175
|
+
// whose export value matches, uncheck the others.
|
|
176
|
+
// Use exportValues if defined, otherwise fall back to the DOM
|
|
177
|
+
// element's value attribute (mirrors handleFieldChange logic).
|
|
178
|
+
const optionValue = entry.exportValues ?? (el instanceof HTMLInputElement ? el.value : undefined);
|
|
179
|
+
const isSelected = optionValue === String(value);
|
|
180
|
+
storage.setValue(id, {
|
|
181
|
+
value: isSelected ? entry.exportValues ?? String(value) : "Off"
|
|
182
|
+
});
|
|
183
|
+
if (el instanceof HTMLInputElement) {
|
|
184
|
+
el.checked = isSelected;
|
|
185
|
+
}
|
|
186
|
+
} else {
|
|
187
|
+
const storageVal = toStorageValue(value, entry.fieldType);
|
|
188
|
+
storage.setValue(id, {
|
|
189
|
+
value: storageVal
|
|
190
|
+
});
|
|
191
|
+
if (el == null) continue;
|
|
192
|
+
if (entry.fieldType === "checkbox" && el instanceof HTMLInputElement) {
|
|
193
|
+
el.checked = typeof storageVal === "boolean" ? storageVal : storageVal !== "Off";
|
|
194
|
+
} else if (el instanceof HTMLSelectElement) {
|
|
195
|
+
el.value = String(value);
|
|
196
|
+
} else if (el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement) {
|
|
197
|
+
el.value = String(value);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}, [document, pdfViewerRef]);
|
|
203
|
+
|
|
204
|
+
// Effect 2: Populate initial form data when annotation layers render
|
|
205
|
+
useEffect(function () {
|
|
206
|
+
const eventBus = eventBusRef.current;
|
|
207
|
+
if (eventBus == null || document == null || formDataRef.current == null) {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// Attempt population immediately in case the field map was built
|
|
212
|
+
// after the annotation layer already rendered (race condition fix).
|
|
213
|
+
populateFields();
|
|
214
|
+
const onAnnotationLayerRendered = () => {
|
|
215
|
+
populateFields();
|
|
216
|
+
};
|
|
217
|
+
eventBus.on(ANNOTATION_LAYER_RENDERED_EVENT, onAnnotationLayerRendered);
|
|
218
|
+
return () => {
|
|
219
|
+
eventBus.off(ANNOTATION_LAYER_RENDERED_EVENT, onAnnotationLayerRendered);
|
|
220
|
+
};
|
|
221
|
+
}, [eventBusRef, document, hasFormFields, populateFields]);
|
|
222
|
+
|
|
223
|
+
// Effect 3: Listen for field changes via MutationObserver + event listeners
|
|
224
|
+
useEffect(function () {
|
|
225
|
+
const pdfViewer = pdfViewerRef.current;
|
|
226
|
+
if (pdfViewer == null || document == null) {
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// Get the viewer's container element
|
|
231
|
+
const container = getViewerContainer(pdfViewer);
|
|
232
|
+
if (container == null) return;
|
|
233
|
+
const listeners = new Map();
|
|
234
|
+
function handleFieldChange(el) {
|
|
235
|
+
const id = el.getAttribute("data-element-id");
|
|
236
|
+
if (id == null) return;
|
|
237
|
+
const entry = fieldMapRef.current.get(id);
|
|
238
|
+
if (entry == null) return;
|
|
239
|
+
let value;
|
|
240
|
+
if (entry.fieldType === "checkbox" && el instanceof HTMLInputElement) {
|
|
241
|
+
value = el.checked;
|
|
242
|
+
} else if (entry.fieldType === "radiobutton" && el instanceof HTMLInputElement) {
|
|
243
|
+
// For radio buttons, the value is the button's export value when selected
|
|
244
|
+
value = el.checked ? entry.exportValues ?? el.value : "";
|
|
245
|
+
} else {
|
|
246
|
+
value = el.value;
|
|
247
|
+
}
|
|
248
|
+
onFormChangeRef.current?.(entry.fieldName, value);
|
|
249
|
+
}
|
|
250
|
+
function attachListeners(root) {
|
|
251
|
+
const elements = root.querySelectorAll?.(".annotationLayer input, .annotationLayer select, .annotationLayer textarea");
|
|
252
|
+
if (elements == null) return;
|
|
253
|
+
for (const el of elements) {
|
|
254
|
+
if (listeners.has(el)) continue;
|
|
255
|
+
const handler = () => {
|
|
256
|
+
handleFieldChange(el);
|
|
257
|
+
};
|
|
258
|
+
el.addEventListener("input", handler);
|
|
259
|
+
el.addEventListener("change", handler);
|
|
260
|
+
listeners.set(el, handler);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// Attach to any elements already in the DOM
|
|
265
|
+
attachListeners(container);
|
|
266
|
+
|
|
267
|
+
// Watch for new form elements being added (pages render lazily)
|
|
268
|
+
const observer = new MutationObserver(mutations => {
|
|
269
|
+
for (const mutation of mutations) {
|
|
270
|
+
for (const node of mutation.addedNodes) {
|
|
271
|
+
if (node instanceof Element) {
|
|
272
|
+
attachListeners(node);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
observer.observe(container, {
|
|
278
|
+
childList: true,
|
|
279
|
+
subtree: true
|
|
280
|
+
});
|
|
281
|
+
return () => {
|
|
282
|
+
observer.disconnect();
|
|
283
|
+
for (const [el, handler] of listeners) {
|
|
284
|
+
el.removeEventListener("input", handler);
|
|
285
|
+
el.removeEventListener("change", handler);
|
|
286
|
+
}
|
|
287
|
+
listeners.clear();
|
|
288
|
+
};
|
|
289
|
+
}, [pdfViewerRef, document]);
|
|
290
|
+
|
|
291
|
+
// Callback: collect all form data and invoke onFormSubmit
|
|
292
|
+
const submitFormData = useCallback(() => {
|
|
293
|
+
const doc = document;
|
|
294
|
+
if (doc == null) return;
|
|
295
|
+
const storage = doc.annotationStorage;
|
|
296
|
+
const allValues = storage.getAll();
|
|
297
|
+
const result = {};
|
|
298
|
+
|
|
299
|
+
// Track which radio group has been resolved
|
|
300
|
+
const resolvedRadios = new Set();
|
|
301
|
+
for (const [id, entry] of fieldMapRef.current) {
|
|
302
|
+
const {
|
|
303
|
+
fieldName,
|
|
304
|
+
fieldType
|
|
305
|
+
} = entry;
|
|
306
|
+
|
|
307
|
+
// For radio buttons, only process each group once
|
|
308
|
+
if (fieldType === "radiobutton") {
|
|
309
|
+
if (resolvedRadios.has(fieldName)) continue;
|
|
310
|
+
resolvedRadios.add(fieldName);
|
|
311
|
+
|
|
312
|
+
// Find the selected radio in the group
|
|
313
|
+
const groupIds = nameToIdsRef.current.get(fieldName) ?? [];
|
|
314
|
+
let selectedValue = "";
|
|
315
|
+
for (const radioId of groupIds) {
|
|
316
|
+
const stored = allValues?.[radioId];
|
|
317
|
+
const val = stored != null && typeof stored === "object" && "value" in stored ? stored.value : stored;
|
|
318
|
+
if (val === true || typeof val === "string" && val !== "Off") {
|
|
319
|
+
const radioEntry = fieldMapRef.current.get(radioId);
|
|
320
|
+
selectedValue = radioEntry?.exportValues ?? String(val);
|
|
321
|
+
break;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
result[fieldName] = selectedValue;
|
|
325
|
+
continue;
|
|
326
|
+
}
|
|
327
|
+
const stored = allValues?.[id];
|
|
328
|
+
const rawValue = stored != null && typeof stored === "object" && "value" in stored ? stored.value : stored;
|
|
329
|
+
|
|
330
|
+
// Skip if we already have a value for this field name (e.g. duplicate IDs)
|
|
331
|
+
if (fieldName in result) continue;
|
|
332
|
+
result[fieldName] = toFormFieldValue(rawValue, fieldType);
|
|
333
|
+
}
|
|
334
|
+
onFormSubmitRef.current?.(result);
|
|
335
|
+
}, [document]);
|
|
336
|
+
return {
|
|
337
|
+
hasFormFields,
|
|
338
|
+
submitFormData
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
//# sourceMappingURL=usePdfFormFields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePdfFormFields.js","names":["useCallback","useEffect","useRef","useState","ANNOTATION_LAYER_RENDERED_EVENT","getViewerContainer","viewer","container","normalizeFieldType","type","toFormFieldValue","storageValue","fieldType","Array","isArray","map","String","toStorageValue","formValue","usePdfFormFields","pdfViewerRef","eventBusRef","document","formData","onFormSubmit","onFormChange","hasFormFields","setHasFormFields","onFormSubmitRef","onFormChangeRef","formDataRef","current","fieldMapRef","Map","nameToIdsRef","doc","clear","cancelled","getFieldObjects","then","fieldObjects","fieldMap","nameToIds","fieldName","objects","Object","entries","ids","obj","typedObj","id","set","exportValues","page","push","length","size","populateFields","data","pdfViewer","storage","annotationStorage","value","get","entry","el","querySelector","CSS","escape","optionValue","HTMLInputElement","undefined","isSelected","setValue","checked","storageVal","HTMLSelectElement","HTMLTextAreaElement","eventBus","onAnnotationLayerRendered","on","off","listeners","handleFieldChange","getAttribute","attachListeners","root","elements","querySelectorAll","has","handler","addEventListener","observer","MutationObserver","mutations","mutation","node","addedNodes","Element","observe","childList","subtree","disconnect","removeEventListener","submitFormData","allValues","getAll","result","resolvedRadios","Set","add","groupIds","selectedValue","radioId","stored","val","radioEntry","rawValue"],"sources":["usePdfFormFields.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, useState } from \"react\";\nimport { ANNOTATION_LAYER_RENDERED_EVENT } from \"../constants.js\";\nimport type { PdfFormFieldValue } from \"../types.js\";\n\n/** Get the viewer's container element (typed loosely by pdf.js). */\nfunction getViewerContainer(viewer: PDFViewer): HTMLElement | undefined {\n return (viewer as { container?: HTMLElement }).container;\n}\n\n/** Internal metadata for a single form field annotation. */\ninterface FieldEntry {\n fieldName: string;\n fieldType: \"text\" | \"checkbox\" | \"radiobutton\" | \"combobox\" | \"listbox\";\n exportValues: string | undefined;\n page: number;\n}\n\nexport interface UsePdfFormFieldsOptions {\n pdfViewerRef: RefObject<PDFViewer | null>;\n eventBusRef: RefObject<EventBus | null>;\n document: PDFDocumentProxy | undefined;\n formData?: Record<string, PdfFormFieldValue>;\n onFormSubmit?: (data: Record<string, PdfFormFieldValue>) => void;\n onFormChange?: (fieldName: string, value: PdfFormFieldValue) => void;\n}\n\nexport interface UsePdfFormFieldsResult {\n /** Whether the loaded PDF contains interactive form fields. */\n hasFormFields: boolean;\n /** Collect all current form field values and invoke onFormSubmit. */\n submitFormData: () => void;\n}\n\n/**\n * Normalizes a pdf.js field object type string to a simplified form type.\n * @internal Exported for testing.\n */\nexport function normalizeFieldType(\n type: string,\n): \"text\" | \"checkbox\" | \"radiobutton\" | \"combobox\" | \"listbox\" {\n switch (type) {\n case \"checkbox\":\n case \"radiobutton\":\n case \"combobox\":\n case \"listbox\":\n return type;\n default:\n return \"text\";\n }\n}\n\n/**\n * Converts a pdf.js annotationStorage value to a consumer-friendly PdfFormFieldValue.\n * @internal Exported for testing.\n */\nexport function toFormFieldValue(\n storageValue: unknown,\n fieldType: \"text\" | \"checkbox\" | \"radiobutton\" | \"combobox\" | \"listbox\",\n): PdfFormFieldValue {\n if (fieldType === \"checkbox\") {\n if (typeof storageValue === \"boolean\") {\n return storageValue;\n }\n // pdf.js stores checkbox as the export value when checked, \"Off\" when unchecked\n return storageValue !== \"Off\" && storageValue !== false;\n }\n if (fieldType === \"radiobutton\") {\n return typeof storageValue === \"string\" ? storageValue : \"\";\n }\n if (typeof storageValue === \"string\") {\n return storageValue;\n }\n if (Array.isArray(storageValue)) {\n return storageValue.map(String);\n }\n return \"\";\n}\n\n/**\n * Converts a consumer PdfFormFieldValue to a pdf.js annotationStorage value.\n * @internal Exported for testing.\n */\nexport function toStorageValue(\n formValue: PdfFormFieldValue,\n fieldType: \"text\" | \"checkbox\" | \"radiobutton\" | \"combobox\" | \"listbox\",\n): unknown {\n if (fieldType === \"checkbox\") {\n if (typeof formValue === \"boolean\") {\n return formValue;\n }\n return formValue !== \"Off\" && formValue !== \"\";\n }\n return formValue;\n}\n\n/**\n * Hook that manages interactive PDF form fields.\n * Builds a field metadata map, pre-populates initial values,\n * listens for field changes, and collects values on submit.\n */\nexport function usePdfFormFields({\n pdfViewerRef,\n eventBusRef,\n document,\n formData,\n onFormSubmit,\n onFormChange,\n}: UsePdfFormFieldsOptions): UsePdfFormFieldsResult {\n const [hasFormFields, setHasFormFields] = useState(false);\n\n // Stable refs for callbacks\n const onFormSubmitRef = useRef(onFormSubmit);\n const onFormChangeRef = useRef(onFormChange);\n const formDataRef = useRef(formData);\n\n useEffect(function syncCallbackRefs() {\n onFormSubmitRef.current = onFormSubmit;\n onFormChangeRef.current = onFormChange;\n formDataRef.current = formData;\n }, [onFormSubmit, onFormChange, formData]);\n\n // Map from annotation ID -> field metadata\n const fieldMapRef = useRef<Map<string, FieldEntry>>(new Map());\n // Reverse map from field name -> annotation IDs\n const nameToIdsRef = useRef<Map<string, string[]>>(new Map());\n\n // Effect 1: Build field metadata map when document loads\n useEffect(function buildFieldMap() {\n const doc = document;\n if (doc == null) {\n fieldMapRef.current.clear();\n nameToIdsRef.current.clear();\n setHasFormFields(false);\n return;\n }\n\n let cancelled = false;\n\n void doc.getFieldObjects().then((fieldObjects) => {\n if (cancelled || fieldObjects == null) {\n setHasFormFields(false);\n return;\n }\n\n const fieldMap = new Map<string, FieldEntry>();\n const nameToIds = new Map<string, string[]>();\n\n for (const [fieldName, objects] of Object.entries(fieldObjects)) {\n const ids: string[] = [];\n for (const obj of objects) {\n const typedObj = obj as {\n id?: string;\n type?: string;\n exportValues?: string;\n page?: number;\n };\n if (typedObj.id == null) continue;\n\n const fieldType = normalizeFieldType(typedObj.type ?? \"text\");\n fieldMap.set(typedObj.id, {\n fieldName,\n fieldType,\n exportValues: typedObj.exportValues,\n page: typedObj.page ?? 0,\n });\n ids.push(typedObj.id);\n }\n if (ids.length > 0) {\n nameToIds.set(fieldName, ids);\n }\n }\n\n fieldMapRef.current = fieldMap;\n nameToIdsRef.current = nameToIds;\n setHasFormFields(fieldMap.size > 0);\n });\n\n return () => {\n cancelled = true;\n };\n }, [document]);\n\n // Populates form fields from formData into both annotation storage and DOM elements.\n // Scoped to the viewer container to avoid conflicts with multiple viewer instances.\n const populateFields = useCallback(() => {\n const data = formDataRef.current;\n const doc = document;\n const pdfViewer = pdfViewerRef.current;\n if (data == null || doc == null || pdfViewer == null) return;\n if (fieldMapRef.current.size === 0) return;\n\n const storage = doc.annotationStorage;\n const container = getViewerContainer(pdfViewer);\n\n for (const [fieldName, value] of Object.entries(data)) {\n const ids = nameToIdsRef.current.get(fieldName);\n if (ids == null) continue;\n\n for (const id of ids) {\n const entry = fieldMapRef.current.get(id);\n if (entry == null) continue;\n\n // Also update the DOM element directly (scoped to viewer container)\n const el = container?.querySelector(\n `[data-element-id=\"${CSS.escape(id)}\"]`,\n );\n\n if (entry.fieldType === \"radiobutton\") {\n // Radio buttons: each ID is a separate option. Check the one\n // whose export value matches, uncheck the others.\n // Use exportValues if defined, otherwise fall back to the DOM\n // element's value attribute (mirrors handleFieldChange logic).\n const optionValue = entry.exportValues\n ?? (el instanceof HTMLInputElement ? el.value : undefined);\n const isSelected = optionValue === String(value);\n storage.setValue(id, {\n value: isSelected ? (entry.exportValues ?? String(value)) : \"Off\",\n });\n if (el instanceof HTMLInputElement) {\n el.checked = isSelected;\n }\n } else {\n const storageVal = toStorageValue(value, entry.fieldType);\n storage.setValue(id, { value: storageVal });\n\n if (el == null) continue;\n\n if (\n entry.fieldType === \"checkbox\" && el instanceof HTMLInputElement\n ) {\n el.checked = typeof storageVal === \"boolean\"\n ? storageVal\n : storageVal !== \"Off\";\n } else if (el instanceof HTMLSelectElement) {\n el.value = String(value);\n } else if (\n el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement\n ) {\n el.value = String(value);\n }\n }\n }\n }\n }, [document, pdfViewerRef]);\n\n // Effect 2: Populate initial form data when annotation layers render\n useEffect(function populateFormData() {\n const eventBus = eventBusRef.current;\n if (eventBus == null || document == null || formDataRef.current == null) {\n return;\n }\n\n // Attempt population immediately in case the field map was built\n // after the annotation layer already rendered (race condition fix).\n populateFields();\n\n const onAnnotationLayerRendered = () => {\n populateFields();\n };\n\n eventBus.on(ANNOTATION_LAYER_RENDERED_EVENT, onAnnotationLayerRendered);\n\n return () => {\n eventBus.off(ANNOTATION_LAYER_RENDERED_EVENT, onAnnotationLayerRendered);\n };\n }, [eventBusRef, document, hasFormFields, populateFields]);\n\n // Effect 3: Listen for field changes via MutationObserver + event listeners\n useEffect(function listenForFieldChanges() {\n const pdfViewer = pdfViewerRef.current;\n if (pdfViewer == null || document == null) {\n return;\n }\n\n // Get the viewer's container element\n const container = getViewerContainer(pdfViewer);\n if (container == null) return;\n\n const listeners = new Map<Element, () => void>();\n\n function handleFieldChange(\n el: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement,\n ) {\n const id = el.getAttribute(\"data-element-id\");\n if (id == null) return;\n\n const entry = fieldMapRef.current.get(id);\n if (entry == null) return;\n\n let value: PdfFormFieldValue;\n if (entry.fieldType === \"checkbox\" && el instanceof HTMLInputElement) {\n value = el.checked;\n } else if (\n entry.fieldType === \"radiobutton\" && el instanceof HTMLInputElement\n ) {\n // For radio buttons, the value is the button's export value when selected\n value = el.checked ? (entry.exportValues ?? el.value) : \"\";\n } else {\n value = el.value;\n }\n\n onFormChangeRef.current?.(entry.fieldName, value);\n }\n\n function attachListeners(root: Node) {\n const elements = (root as Element).querySelectorAll?.(\n \".annotationLayer input, .annotationLayer select, .annotationLayer textarea\",\n );\n if (elements == null) return;\n\n for (const el of elements) {\n if (listeners.has(el)) continue;\n\n const handler = () => {\n handleFieldChange(\n el as HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement,\n );\n };\n el.addEventListener(\"input\", handler);\n el.addEventListener(\"change\", handler);\n listeners.set(el, handler);\n }\n }\n\n // Attach to any elements already in the DOM\n attachListeners(container);\n\n // Watch for new form elements being added (pages render lazily)\n const observer = new MutationObserver((mutations) => {\n for (const mutation of mutations) {\n for (const node of mutation.addedNodes) {\n if (node instanceof Element) {\n attachListeners(node);\n }\n }\n }\n });\n\n observer.observe(container, { childList: true, subtree: true });\n\n return () => {\n observer.disconnect();\n for (const [el, handler] of listeners) {\n el.removeEventListener(\"input\", handler);\n el.removeEventListener(\"change\", handler);\n }\n listeners.clear();\n };\n }, [pdfViewerRef, document]);\n\n // Callback: collect all form data and invoke onFormSubmit\n const submitFormData = useCallback(() => {\n const doc = document;\n if (doc == null) return;\n\n const storage = doc.annotationStorage;\n const allValues = storage.getAll() as Record<string, unknown> | null;\n const result: Record<string, PdfFormFieldValue> = {};\n\n // Track which radio group has been resolved\n const resolvedRadios = new Set<string>();\n\n for (const [id, entry] of fieldMapRef.current) {\n const { fieldName, fieldType } = entry;\n\n // For radio buttons, only process each group once\n if (fieldType === \"radiobutton\") {\n if (resolvedRadios.has(fieldName)) continue;\n resolvedRadios.add(fieldName);\n\n // Find the selected radio in the group\n const groupIds = nameToIdsRef.current.get(fieldName) ?? [];\n let selectedValue = \"\";\n for (const radioId of groupIds) {\n const stored = allValues?.[radioId];\n const val =\n stored != null && typeof stored === \"object\" && \"value\" in stored\n ? (stored as { value: unknown }).value\n : stored;\n if (val === true || (typeof val === \"string\" && val !== \"Off\")) {\n const radioEntry = fieldMapRef.current.get(radioId);\n selectedValue = radioEntry?.exportValues ?? String(val);\n break;\n }\n }\n result[fieldName] = selectedValue;\n continue;\n }\n\n const stored = allValues?.[id];\n const rawValue =\n stored != null && typeof stored === \"object\" && \"value\" in stored\n ? (stored as { value: unknown }).value\n : stored;\n\n // Skip if we already have a value for this field name (e.g. duplicate IDs)\n if (fieldName in result) continue;\n\n result[fieldName] = toFormFieldValue(rawValue, fieldType);\n }\n\n onFormSubmitRef.current?.(result);\n }, [document]);\n\n return {\n hasFormFields,\n submitFormData,\n };\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,EAAEC,QAAQ,QAAQ,OAAO;AAChE,SAASC,+BAA+B,QAAQ,iBAAiB;AAGjE;AACA,SAASC,kBAAkBA,CAACC,MAAiB,EAA2B;EACtE,OAAQA,MAAM,CAAiCC,SAAS;AAC1D;;AAEA;;AAwBA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAChCC,IAAY,EACkD;EAC9D,QAAQA,IAAI;IACV,KAAK,UAAU;IACf,KAAK,aAAa;IAClB,KAAK,UAAU;IACf,KAAK,SAAS;MACZ,OAAOA,IAAI;IACb;MACE,OAAO,MAAM;EACjB;AACF;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAC9BC,YAAqB,EACrBC,SAAuE,EACpD;EACnB,IAAIA,SAAS,KAAK,UAAU,EAAE;IAC5B,IAAI,OAAOD,YAAY,KAAK,SAAS,EAAE;MACrC,OAAOA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AAC;EAEd,OAAO;IACLI,aAAa;IACb8E;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,227 @@
|
|
|
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 { AnnotationEditorType } from "pdfjs-dist";
|
|
18
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
19
|
+
/**
|
|
20
|
+
* Converts an RGB array (0.0–1.0 per channel) to a CSS hex color string.
|
|
21
|
+
*/
|
|
22
|
+
export function rgbArrayToHex(color) {
|
|
23
|
+
const r = Math.round(color[0] * 255);
|
|
24
|
+
const g = Math.round(color[1] * 255);
|
|
25
|
+
const b = Math.round(color[2] * 255);
|
|
26
|
+
return `#${r.toString(16).padStart(2, "0")}${g.toString(16).padStart(2, "0")}${b.toString(16).padStart(2, "0")}`;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Converts quadPoints (PDF spec format) back to PdfRect[].
|
|
31
|
+
* QuadPoints are 8 values per quad: [x1,y1, x2,y2, x3,y3, x4,y4]
|
|
32
|
+
* representing the four corners of each highlight rect.
|
|
33
|
+
*
|
|
34
|
+
* PDF.js highlight editor produces axis-aligned quads with ordering:
|
|
35
|
+
* (x1,y1)=top-left, (x2,y2)=top-right, (x3,y3)=bottom-left, (x4,y4)=bottom-right
|
|
36
|
+
* We derive the bounding rect from x1, y1 (top), x2 (right edge), y3 (bottom).
|
|
37
|
+
*/
|
|
38
|
+
export function quadPointsToRects(quadPoints) {
|
|
39
|
+
const rects = [];
|
|
40
|
+
for (let i = 0; i < quadPoints.length; i += 8) {
|
|
41
|
+
const x1 = quadPoints[i];
|
|
42
|
+
const y1 = quadPoints[i + 1];
|
|
43
|
+
const x2 = quadPoints[i + 2];
|
|
44
|
+
const y3 = quadPoints[i + 5];
|
|
45
|
+
const x = Math.min(x1, x2);
|
|
46
|
+
const y = Math.min(y1, y3);
|
|
47
|
+
const width = Math.abs(x2 - x1);
|
|
48
|
+
const height = Math.abs(y1 - y3);
|
|
49
|
+
rects.push({
|
|
50
|
+
x,
|
|
51
|
+
y,
|
|
52
|
+
width,
|
|
53
|
+
height
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return rects;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Hook that manages the PDF.js built-in highlight annotation editor mode.
|
|
61
|
+
* When active, users can select text to create highlights.
|
|
62
|
+
* A callback fires with the annotation details for persistence.
|
|
63
|
+
*/
|
|
64
|
+
export function usePdfHighlightMode({
|
|
65
|
+
pdfViewerRef,
|
|
66
|
+
document,
|
|
67
|
+
enabled,
|
|
68
|
+
onTextHighlight,
|
|
69
|
+
onHighlightDelete
|
|
70
|
+
}) {
|
|
71
|
+
const [highlightModeActive, setHighlightModeActive] = useState(false);
|
|
72
|
+
const onTextHighlightRef = useRef(onTextHighlight);
|
|
73
|
+
const onHighlightDeleteRef = useRef(onHighlightDelete);
|
|
74
|
+
const knownEditorIdsRef = useRef(new Set());
|
|
75
|
+
const editorEventsRef = useRef(new Map());
|
|
76
|
+
|
|
77
|
+
// Keep callback refs in sync
|
|
78
|
+
useEffect(function () {
|
|
79
|
+
onTextHighlightRef.current = onTextHighlight;
|
|
80
|
+
onHighlightDeleteRef.current = onHighlightDelete;
|
|
81
|
+
}, [onTextHighlight, onHighlightDelete]);
|
|
82
|
+
|
|
83
|
+
// Toggle the PDF.js annotation editor mode
|
|
84
|
+
useEffect(function () {
|
|
85
|
+
const pdfViewer = pdfViewerRef.current;
|
|
86
|
+
if (pdfViewer == null || document == null) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
try {
|
|
90
|
+
if (highlightModeActive && enabled) {
|
|
91
|
+
pdfViewer.annotationEditorMode = {
|
|
92
|
+
mode: AnnotationEditorType.HIGHLIGHT
|
|
93
|
+
};
|
|
94
|
+
} else {
|
|
95
|
+
pdfViewer.annotationEditorMode = {
|
|
96
|
+
mode: AnnotationEditorType.NONE
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
} catch {
|
|
100
|
+
// AnnotationEditorUIManager may not be initialized yet
|
|
101
|
+
}
|
|
102
|
+
}, [pdfViewerRef, document, highlightModeActive, enabled]);
|
|
103
|
+
|
|
104
|
+
// Deactivate highlight mode when the feature is disabled
|
|
105
|
+
useEffect(function () {
|
|
106
|
+
if (!enabled) {
|
|
107
|
+
setHighlightModeActive(false);
|
|
108
|
+
}
|
|
109
|
+
}, [enabled]);
|
|
110
|
+
|
|
111
|
+
// Clear tracked editors when the document changes (but not on highlight toggle)
|
|
112
|
+
const prevDocumentRef = useRef(undefined);
|
|
113
|
+
useEffect(function () {
|
|
114
|
+
if (document !== prevDocumentRef.current) {
|
|
115
|
+
knownEditorIdsRef.current.clear();
|
|
116
|
+
editorEventsRef.current.clear();
|
|
117
|
+
prevDocumentRef.current = document;
|
|
118
|
+
}
|
|
119
|
+
}, [document]);
|
|
120
|
+
|
|
121
|
+
// Listen for new highlights being added to annotation storage
|
|
122
|
+
useEffect(function () {
|
|
123
|
+
if (document == null || !highlightModeActive || !enabled) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const storage = document.annotationStorage;
|
|
127
|
+
const previousOnAnnotationEditor = storage.onAnnotationEditor;
|
|
128
|
+
|
|
129
|
+
// Monkey-patch storage.remove to detect highlight deletions.
|
|
130
|
+
// This is fragile but necessary because PDF.js does not emit events
|
|
131
|
+
// when editors are removed. Restore the original on cleanup.
|
|
132
|
+
const originalRemove = storage.remove.bind(storage);
|
|
133
|
+
storage.remove = key => {
|
|
134
|
+
const savedEvent = editorEventsRef.current.get(key);
|
|
135
|
+
if (savedEvent != null) {
|
|
136
|
+
editorEventsRef.current.delete(key);
|
|
137
|
+
knownEditorIdsRef.current.delete(key);
|
|
138
|
+
onHighlightDeleteRef.current?.(savedEvent);
|
|
139
|
+
}
|
|
140
|
+
originalRemove(key);
|
|
141
|
+
};
|
|
142
|
+
storage.onAnnotationEditor = type => {
|
|
143
|
+
// onAnnotationEditor fires with the editor's static _type (string "highlight")
|
|
144
|
+
if (type !== "highlight") {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Find new editors in storage
|
|
149
|
+
const allEntries = storage.getAll();
|
|
150
|
+
if (allEntries == null) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
for (const [id, entry] of Object.entries(allEntries)) {
|
|
154
|
+
if (knownEditorIdsRef.current.has(id)) {
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Check if this is a highlight editor with serializable data
|
|
159
|
+
if (typeof entry === "object" && entry != null && "serialize" in entry && typeof entry.serialize === "function") {
|
|
160
|
+
knownEditorIdsRef.current.add(id);
|
|
161
|
+
const serialized = entry.serialize(false);
|
|
162
|
+
if (serialized == null || serialized.annotationType !== AnnotationEditorType.HIGHLIGHT) {
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
const rects = serialized.quadPoints != null ? quadPointsToRects(serialized.quadPoints) : [];
|
|
166
|
+
if (rects.length === 0) {
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
const color = Array.isArray(serialized.color) ? rgbArrayToHex(serialized.color) : "#fff066";
|
|
170
|
+
|
|
171
|
+
// Extract text from the editor's aria-label (stores selected text)
|
|
172
|
+
const selectedText = typeof entry.div?.getAttribute === "function" ? entry.div.getAttribute("aria-label") ?? "" : "";
|
|
173
|
+
const event = {
|
|
174
|
+
editorId: id,
|
|
175
|
+
page: serialized.pageIndex + 1,
|
|
176
|
+
rects,
|
|
177
|
+
selectedText,
|
|
178
|
+
color
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
// Store the event so we can provide it back on delete
|
|
182
|
+
editorEventsRef.current.set(id, event);
|
|
183
|
+
onTextHighlightRef.current?.(event);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
return () => {
|
|
188
|
+
storage.onAnnotationEditor = previousOnAnnotationEditor;
|
|
189
|
+
storage.remove = originalRemove;
|
|
190
|
+
};
|
|
191
|
+
}, [document, highlightModeActive, enabled]);
|
|
192
|
+
const toggleHighlightMode = useCallback(() => {
|
|
193
|
+
setHighlightModeActive(prev => !prev);
|
|
194
|
+
}, []);
|
|
195
|
+
const deleteHighlight = useCallback(editorId => {
|
|
196
|
+
if (document == null) return;
|
|
197
|
+
const storage = document.annotationStorage;
|
|
198
|
+
|
|
199
|
+
// Fire the delete callback directly. The monkey-patch on storage.remove
|
|
200
|
+
// only exists while highlight mode is active, so we handle it here to
|
|
201
|
+
// ensure the callback fires regardless of highlight mode state.
|
|
202
|
+
// Clean up refs first so the monkey-patch (if active) won't double-fire.
|
|
203
|
+
const savedEvent = editorEventsRef.current.get(editorId);
|
|
204
|
+
if (savedEvent != null) {
|
|
205
|
+
editorEventsRef.current.delete(editorId);
|
|
206
|
+
knownEditorIdsRef.current.delete(editorId);
|
|
207
|
+
onHighlightDeleteRef.current?.(savedEvent);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Remove the editor's DOM element if it exists
|
|
211
|
+
const allEntries = storage.getAll();
|
|
212
|
+
const entry = allEntries?.[editorId];
|
|
213
|
+
if (hasDiv(entry) && entry.div instanceof HTMLElement) {
|
|
214
|
+
entry.div.remove();
|
|
215
|
+
}
|
|
216
|
+
storage.remove(editorId);
|
|
217
|
+
}, [document]);
|
|
218
|
+
return {
|
|
219
|
+
highlightModeActive,
|
|
220
|
+
toggleHighlightMode,
|
|
221
|
+
deleteHighlight
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
function hasDiv(obj) {
|
|
225
|
+
return obj != null && typeof obj === "object" && "div" in obj;
|
|
226
|
+
}
|
|
227
|
+
//# sourceMappingURL=usePdfHighlightMode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePdfHighlightMode.js","names":["AnnotationEditorType","useCallback","useEffect","useRef","useState","rgbArrayToHex","color","r","Math","round","g","b","toString","padStart","quadPointsToRects","quadPoints","rects","i","length","x1","y1","x2","y3","x","min","y","width","abs","height","push","usePdfHighlightMode","pdfViewerRef","document","enabled","onTextHighlight","onHighlightDelete","highlightModeActive","setHighlightModeActive","onTextHighlightRef","onHighlightDeleteRef","knownEditorIdsRef","Set","editorEventsRef","Map","current","pdfViewer","annotationEditorMode","mode","HIGHLIGHT","NONE","prevDocumentRef","undefined","clear","storage","annotationStorage","previousOnAnnotationEditor","onAnnotationEditor","originalRemove","remove","bind","key","savedEvent","get","delete","type","allEntries","getAll","id","entry","Object","entries","has","serialize","add","serialized","annotationType","Array","isArray","selectedText","div","getAttribute","event","editorId","page","pageIndex","set","toggleHighlightMode","prev","deleteHighlight","hasDiv","HTMLElement","obj"],"sources":["usePdfHighlightMode.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 type { PDFViewer } from \"pdfjs-dist/web/pdf_viewer.mjs\";\nimport type { RefObject } from \"react\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { PdfRect, PdfTextHighlightEvent } from \"../types.js\";\n\nexport interface UsePdfHighlightModeOptions {\n pdfViewerRef: RefObject<PDFViewer | null>;\n document: PDFDocumentProxy | undefined;\n enabled: boolean;\n onTextHighlight?: (event: PdfTextHighlightEvent) => void;\n onHighlightDelete?: (event: PdfTextHighlightEvent) => void;\n}\n\nexport interface UsePdfHighlightModeResult {\n highlightModeActive: boolean;\n toggleHighlightMode: () => void;\n deleteHighlight: (editorId: string) => void;\n}\n\n/**\n * Converts an RGB array (0.0–1.0 per channel) to a CSS hex color string.\n */\nexport function rgbArrayToHex(color: number[]): string {\n const r = Math.round(color[0] * 255);\n const g = Math.round(color[1] * 255);\n const b = Math.round(color[2] * 255);\n return `#${r.toString(16).padStart(2, \"0\")}${\n g.toString(16).padStart(2, \"0\")\n }${b.toString(16).padStart(2, \"0\")}`;\n}\n\n/**\n * Converts quadPoints (PDF spec format) back to PdfRect[].\n * QuadPoints are 8 values per quad: [x1,y1, x2,y2, x3,y3, x4,y4]\n * representing the four corners of each highlight rect.\n *\n * PDF.js highlight editor produces axis-aligned quads with ordering:\n * (x1,y1)=top-left, (x2,y2)=top-right, (x3,y3)=bottom-left, (x4,y4)=bottom-right\n * We derive the bounding rect from x1, y1 (top), x2 (right edge), y3 (bottom).\n */\nexport function quadPointsToRects(\n quadPoints: Float32Array,\n): PdfRect[] {\n const rects: PdfRect[] = [];\n for (let i = 0; i < quadPoints.length; i += 8) {\n const x1 = quadPoints[i];\n const y1 = quadPoints[i + 1];\n const x2 = quadPoints[i + 2];\n const y3 = quadPoints[i + 5];\n\n const x = Math.min(x1, x2);\n const y = Math.min(y1, y3);\n const width = Math.abs(x2 - x1);\n const height = Math.abs(y1 - y3);\n\n rects.push({ x, y, width, height });\n }\n return rects;\n}\n\n/**\n * Hook that manages the PDF.js built-in highlight annotation editor mode.\n * When active, users can select text to create highlights.\n * A callback fires with the annotation details for persistence.\n */\nexport function usePdfHighlightMode({\n pdfViewerRef,\n document,\n enabled,\n onTextHighlight,\n onHighlightDelete,\n}: UsePdfHighlightModeOptions): UsePdfHighlightModeResult {\n const [highlightModeActive, setHighlightModeActive] = useState(false);\n const onTextHighlightRef = useRef(onTextHighlight);\n const onHighlightDeleteRef = useRef(onHighlightDelete);\n const knownEditorIdsRef = useRef<Set<string>>(new Set());\n const editorEventsRef = useRef<Map<string, PdfTextHighlightEvent>>(new Map());\n\n // Keep callback refs in sync\n useEffect(function syncCallbackRef() {\n onTextHighlightRef.current = onTextHighlight;\n onHighlightDeleteRef.current = onHighlightDelete;\n }, [onTextHighlight, onHighlightDelete]);\n\n // Toggle the PDF.js annotation editor mode\n useEffect(function syncHighlightMode() {\n const pdfViewer = pdfViewerRef.current;\n if (pdfViewer == null || document == null) {\n return;\n }\n\n try {\n if (highlightModeActive && enabled) {\n pdfViewer.annotationEditorMode = {\n mode: AnnotationEditorType.HIGHLIGHT,\n };\n } else {\n pdfViewer.annotationEditorMode = {\n mode: AnnotationEditorType.NONE,\n };\n }\n } catch {\n // AnnotationEditorUIManager may not be initialized yet\n }\n }, [pdfViewerRef, document, highlightModeActive, enabled]);\n\n // Deactivate highlight mode when the feature is disabled\n useEffect(function deactivateOnDisable() {\n if (!enabled) {\n setHighlightModeActive(false);\n }\n }, [enabled]);\n\n // Clear tracked editors when the document changes (but not on highlight toggle)\n const prevDocumentRef = useRef<PDFDocumentProxy | undefined>(undefined);\n useEffect(function clearOnDocumentChange() {\n if (document !== prevDocumentRef.current) {\n knownEditorIdsRef.current.clear();\n editorEventsRef.current.clear();\n prevDocumentRef.current = document;\n }\n }, [document]);\n\n // Listen for new highlights being added to annotation storage\n useEffect(function listenForHighlights() {\n if (document == null || !highlightModeActive || !enabled) {\n return;\n }\n\n const storage = document.annotationStorage;\n const previousOnAnnotationEditor = storage.onAnnotationEditor;\n\n // Monkey-patch storage.remove to detect highlight deletions.\n // This is fragile but necessary because PDF.js does not emit events\n // when editors are removed. Restore the original on cleanup.\n const originalRemove = storage.remove.bind(storage);\n storage.remove = (key: string) => {\n const savedEvent = editorEventsRef.current.get(key);\n if (savedEvent != null) {\n editorEventsRef.current.delete(key);\n knownEditorIdsRef.current.delete(key);\n onHighlightDeleteRef.current?.(savedEvent);\n }\n originalRemove(key);\n };\n\n storage.onAnnotationEditor = (type: string | number | null) => {\n // onAnnotationEditor fires with the editor's static _type (string \"highlight\")\n if (type !== \"highlight\") {\n return;\n }\n\n // Find new editors in storage\n const allEntries = storage.getAll();\n if (allEntries == null) {\n return;\n }\n\n for (const [id, entry] of Object.entries(allEntries)) {\n if (knownEditorIdsRef.current.has(id)) {\n continue;\n }\n\n // Check if this is a highlight editor with serializable data\n if (\n typeof entry === \"object\" && entry != null\n && \"serialize\" in entry\n && typeof entry.serialize === \"function\"\n ) {\n knownEditorIdsRef.current.add(id);\n const serialized = entry.serialize(false);\n if (\n serialized == null\n || serialized.annotationType !== AnnotationEditorType.HIGHLIGHT\n ) {\n continue;\n }\n\n const rects = serialized.quadPoints != null\n ? quadPointsToRects(serialized.quadPoints)\n : [];\n\n if (rects.length === 0) {\n continue;\n }\n\n const color = Array.isArray(serialized.color)\n ? rgbArrayToHex(serialized.color)\n : \"#fff066\";\n\n // Extract text from the editor's aria-label (stores selected text)\n const selectedText = typeof entry.div?.getAttribute === \"function\"\n ? entry.div.getAttribute(\"aria-label\") ?? \"\"\n : \"\";\n\n const event: PdfTextHighlightEvent = {\n editorId: id,\n page: serialized.pageIndex + 1,\n rects,\n selectedText,\n color,\n };\n\n // Store the event so we can provide it back on delete\n editorEventsRef.current.set(id, event);\n\n onTextHighlightRef.current?.(event);\n }\n }\n };\n\n return () => {\n storage.onAnnotationEditor = previousOnAnnotationEditor;\n storage.remove = originalRemove;\n };\n }, [document, highlightModeActive, enabled]);\n\n const toggleHighlightMode = useCallback(() => {\n setHighlightModeActive((prev) => !prev);\n }, []);\n\n const deleteHighlight = useCallback((editorId: string) => {\n if (document == null) return;\n const storage = document.annotationStorage;\n\n // Fire the delete callback directly. The monkey-patch on storage.remove\n // only exists while highlight mode is active, so we handle it here to\n // ensure the callback fires regardless of highlight mode state.\n // Clean up refs first so the monkey-patch (if active) won't double-fire.\n const savedEvent = editorEventsRef.current.get(editorId);\n if (savedEvent != null) {\n editorEventsRef.current.delete(editorId);\n knownEditorIdsRef.current.delete(editorId);\n onHighlightDeleteRef.current?.(savedEvent);\n }\n\n // Remove the editor's DOM element if it exists\n const allEntries = storage.getAll() as Record<string, unknown> | null;\n const entry = allEntries?.[editorId];\n if (hasDiv(entry) && entry.div instanceof HTMLElement) {\n entry.div.remove();\n }\n\n storage.remove(editorId);\n }, [document]);\n\n return {\n highlightModeActive,\n toggleHighlightMode,\n deleteHighlight,\n };\n}\n\nfunction hasDiv(obj: unknown): obj is { div: unknown } {\n return obj != null && typeof obj === \"object\" && \"div\" in obj;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,oBAAoB,QAAQ,YAAY;AAIjD,SAASC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAiBhE;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAACC,KAAe,EAAU;EACrD,MAAMC,CAAC,GAAGC,IAAI,CAACC,KAAK,CAACH,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;EACpC,MAAMI,CAAC,GAAGF,IAAI,CAACC,KAAK,CAACH,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;EACpC,MAAMK,CAAC,GAAGH,IAAI,CAACC,KAAK,CAACH,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;EACpC,OAAO,IAAIC,CAAC,CAACK,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