@semiont/react-ui 0.5.4 → 0.5.6
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/README.md +59 -55
- package/dist/{PdfAnnotationCanvas.client-CN3C3S55.js → PdfAnnotationCanvas.client-NIMALXNZ.js} +7 -27
- package/dist/PdfAnnotationCanvas.client-NIMALXNZ.js.map +1 -0
- package/dist/index.css +6 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +3704 -149
- package/dist/index.js +539 -405
- package/dist/index.js.map +1 -1
- package/dist/test-utils.d.ts +34 -16
- package/package.json +19 -13
- package/src/components/Button/__tests__/Button.test.tsx +0 -2
- package/src/components/CodeMirrorRenderer.tsx +2 -0
- package/src/components/ErrorBoundary.tsx +0 -9
- package/src/components/ProtectedErrorBoundary.tsx +6 -2
- package/src/components/__tests__/AnnotateReferencesProgressWidget.test.tsx +0 -1
- package/src/components/__tests__/ErrorBoundary.test.tsx +20 -13
- package/src/components/__tests__/LiveRegion.hooks.test.tsx +1 -1
- package/src/components/__tests__/ProtectedErrorBoundary.test.tsx +2 -1
- package/src/components/__tests__/ResizeHandle.test.tsx +0 -1
- package/src/components/__tests__/SessionExpiryBanner.test.tsx +0 -1
- package/src/components/__tests__/StatusDisplay.test.tsx +0 -1
- package/src/components/__tests__/Toast.test.tsx +2 -3
- package/src/components/__tests__/Toolbar.test.tsx +0 -1
- package/src/components/annotation/annotations.css +14 -0
- package/src/components/annotation-popups/__tests__/JsonLdView.test.tsx +3 -5
- package/src/components/annotation-popups/__tests__/SharedPopupElements.test.tsx +0 -1
- package/src/components/branding/__tests__/SemiontBranding.test.tsx +1 -2
- package/src/components/layout/__tests__/LeftSidebar.test.tsx +5 -6
- package/src/components/layout/__tests__/PageLayout.test.tsx +1 -3
- package/src/components/layout/__tests__/SkipLinks.a11y.test.tsx +8 -8
- package/src/components/layout/__tests__/UnifiedHeader.test.tsx +12 -1
- package/src/components/modals/__tests__/KeyboardShortcutsHelpModal.test.tsx +0 -1
- package/src/components/modals/__tests__/PermissionDeniedModal.test.tsx +3 -4
- package/src/components/modals/__tests__/ResourceSearchModal.test.tsx +0 -1
- package/src/components/modals/__tests__/SearchModal.basic.test.tsx +1 -1
- package/src/components/modals/__tests__/SearchModal.keyboard.test.tsx +0 -5
- package/src/components/modals/__tests__/SearchModal.search-wiring.test.tsx +0 -1
- package/src/components/modals/__tests__/SearchModal.visual.test.tsx +2 -2
- package/src/components/modals/__tests__/SessionExpiredModal.test.tsx +0 -1
- package/src/components/navigation/NavigationMenu.tsx +1 -1
- package/src/components/navigation/__tests__/Footer.a11y.test.tsx +4 -0
- package/src/components/navigation/__tests__/Footer.test.tsx +3 -6
- package/src/components/navigation/__tests__/NavigationMenu.a11y.test.tsx +1 -1
- package/src/components/navigation/__tests__/NavigationMenu.test.tsx +7 -9
- package/src/components/navigation/__tests__/ObservableLink.test.tsx +0 -1
- package/src/components/navigation/__tests__/SimpleNavigation.test.tsx +1 -2
- package/src/components/navigation/__tests__/SortableResourceTab.test.tsx +0 -1
- package/src/components/pdf-annotation/PdfAnnotationCanvas.tsx +6 -4
- package/src/components/pdf-annotation/__tests__/PdfAnnotationCanvas.test.tsx +10 -19
- package/src/components/resource/__tests__/BrowseView.test.tsx +8 -6
- package/src/components/resource/__tests__/HistoryEvent.test.tsx +0 -4
- package/src/components/resource/__tests__/ResourceViewer.mode-switch.test.tsx +4 -6
- package/src/components/resource/panels/ReferencesPanel.tsx +1 -1
- package/src/components/resource/panels/__tests__/AssessmentEntry.test.tsx +3 -4
- package/src/components/resource/panels/__tests__/AssessmentPanel.test.tsx +7 -6
- package/src/components/resource/panels/__tests__/AssistSection.test.tsx +14 -10
- package/src/components/resource/panels/__tests__/CollaborationPanel.test.tsx +0 -1
- package/src/components/resource/panels/__tests__/CommentEntry.test.tsx +30 -17
- package/src/components/resource/panels/__tests__/CommentsPanel.test.tsx +6 -5
- package/src/components/resource/panels/__tests__/HighlightEntry.test.tsx +4 -5
- package/src/components/resource/panels/__tests__/HighlightPanel.annotationProgress.test.tsx +19 -13
- package/src/components/resource/panels/__tests__/JsonLdPanel.test.tsx +1 -3
- package/src/components/resource/panels/__tests__/PanelHeader.test.tsx +0 -1
- package/src/components/resource/panels/__tests__/ReferenceEntry.test.tsx +5 -5
- package/src/components/resource/panels/__tests__/ReferencesPanel.test.tsx +40 -7
- package/src/components/resource/panels/__tests__/ResourceInfoPanel.test.tsx +3 -3
- package/src/components/resource/panels/__tests__/StatisticsPanel.test.tsx +30 -32
- package/src/components/resource/panels/__tests__/TagEntry.test.tsx +5 -5
- package/src/components/resource/panels/__tests__/TaggingPanel.test.tsx +6 -5
- package/src/components/settings/__tests__/SettingsPanel.test.tsx +0 -1
- package/src/components/viewers/__tests__/ImageViewer.test.tsx +0 -1
- package/src/features/auth/__tests__/SignInForm.a11y.test.tsx +2 -0
- package/src/features/auth/__tests__/SignUpForm.a11y.test.tsx +11 -12
- package/src/features/auth/__tests__/SignUpForm.test.tsx +3 -3
- package/src/features/moderate-tag-schemas/components/TagSchemasPage.tsx +1 -0
- package/src/features/resource-compose/__tests__/ResourceComposePage.test.tsx +2 -1
- package/src/features/resource-discovery/__tests__/ResourceCard.test.tsx +0 -1
- package/src/features/resource-discovery/__tests__/ResourceDiscoveryPage.test.tsx +33 -35
- package/src/features/resource-discovery/components/ResourceDiscoveryPage.tsx +12 -11
- package/src/features/resource-discovery/state/__tests__/discover-state-unit.test.ts +204 -11
- package/src/features/resource-discovery/state/discover-state-unit.ts +70 -11
- package/src/features/resource-viewer/__tests__/ResourceViewerPage.test.tsx +2 -2
- package/src/features/resource-viewer/components/ResourceViewerPage.tsx +3 -2
- package/src/features/resource-viewer/state/__tests__/resource-viewer-page-state-unit.test.ts +0 -1
- package/src/features/resource-viewer/state/resource-viewer-page-state-unit.ts +5 -2
- package/src/integrations/__tests__/css-modules-helper.test.tsx +2 -3
- package/src/integrations/__tests__/styled-components-theme.test.ts +1 -3
- package/dist/PdfAnnotationCanvas.client-CN3C3S55.js.map +0 -1
- package/dist/assets/favicons/SemiontFavicon.d.ts +0 -9
- package/dist/assets/favicons/SemiontFavicon.d.ts.map +0 -1
- package/dist/assets/favicons/index.d.ts +0 -12
- package/dist/assets/favicons/index.d.ts.map +0 -1
- package/dist/components/AnnotateReferencesProgressWidget.d.ts +0 -15
- package/dist/components/AnnotateReferencesProgressWidget.d.ts.map +0 -1
- package/dist/components/Button/Button.d.ts +0 -69
- package/dist/components/Button/Button.d.ts.map +0 -1
- package/dist/components/CodeMirrorRenderer.d.ts +0 -25
- package/dist/components/CodeMirrorRenderer.d.ts.map +0 -1
- package/dist/components/ErrorBoundary.d.ts +0 -30
- package/dist/components/ErrorBoundary.d.ts.map +0 -1
- package/dist/components/LiveRegion.d.ts +0 -41
- package/dist/components/LiveRegion.d.ts.map +0 -1
- package/dist/components/ProtectedErrorBoundary.d.ts +0 -27
- package/dist/components/ProtectedErrorBoundary.d.ts.map +0 -1
- package/dist/components/ResizeHandle.d.ts +0 -39
- package/dist/components/ResizeHandle.d.ts.map +0 -1
- package/dist/components/ResourceTagsInline.d.ts +0 -10
- package/dist/components/ResourceTagsInline.d.ts.map +0 -1
- package/dist/components/SessionExpiryBanner.d.ts +0 -2
- package/dist/components/SessionExpiryBanner.d.ts.map +0 -1
- package/dist/components/SessionTimer.d.ts +0 -2
- package/dist/components/SessionTimer.d.ts.map +0 -1
- package/dist/components/StatusDisplay.d.ts +0 -9
- package/dist/components/StatusDisplay.d.ts.map +0 -1
- package/dist/components/Toast.d.ts +0 -27
- package/dist/components/Toast.d.ts.map +0 -1
- package/dist/components/Toolbar.d.ts +0 -15
- package/dist/components/Toolbar.d.ts.map +0 -1
- package/dist/components/UserMenuSkeleton.d.ts +0 -2
- package/dist/components/UserMenuSkeleton.d.ts.map +0 -1
- package/dist/components/annotation/AnnotateToolbar.d.ts +0 -29
- package/dist/components/annotation/AnnotateToolbar.d.ts.map +0 -1
- package/dist/components/annotation-popups/JsonLdView.d.ts +0 -8
- package/dist/components/annotation-popups/JsonLdView.d.ts.map +0 -1
- package/dist/components/annotation-popups/SharedPopupElements.d.ts +0 -28
- package/dist/components/annotation-popups/SharedPopupElements.d.ts.map +0 -1
- package/dist/components/branding/SemiontBranding.d.ts +0 -13
- package/dist/components/branding/SemiontBranding.d.ts.map +0 -1
- package/dist/components/error-states/ResourceErrorState.d.ts +0 -11
- package/dist/components/error-states/ResourceErrorState.d.ts.map +0 -1
- package/dist/components/image-annotation/AnnotationOverlay.d.ts +0 -22
- package/dist/components/image-annotation/AnnotationOverlay.d.ts.map +0 -1
- package/dist/components/image-annotation/SvgDrawingCanvas.d.ts +0 -23
- package/dist/components/image-annotation/SvgDrawingCanvas.d.ts.map +0 -1
- package/dist/components/layout/LeftSidebar.d.ts +0 -24
- package/dist/components/layout/LeftSidebar.d.ts.map +0 -1
- package/dist/components/layout/PageLayout.d.ts +0 -21
- package/dist/components/layout/PageLayout.d.ts.map +0 -1
- package/dist/components/layout/SkipLinks.d.ts +0 -8
- package/dist/components/layout/SkipLinks.d.ts.map +0 -1
- package/dist/components/layout/UnifiedHeader.d.ts +0 -21
- package/dist/components/layout/UnifiedHeader.d.ts.map +0 -1
- package/dist/components/loading-states/ComposeLoadingState.d.ts +0 -10
- package/dist/components/loading-states/ComposeLoadingState.d.ts.map +0 -1
- package/dist/components/loading-states/ResourceLoadingState.d.ts +0 -7
- package/dist/components/loading-states/ResourceLoadingState.d.ts.map +0 -1
- package/dist/components/modals/ConfigureGenerationStep.d.ts +0 -36
- package/dist/components/modals/ConfigureGenerationStep.d.ts.map +0 -1
- package/dist/components/modals/ConfigureSearchStep.d.ts +0 -21
- package/dist/components/modals/ConfigureSearchStep.d.ts.map +0 -1
- package/dist/components/modals/ContextSummary.d.ts +0 -14
- package/dist/components/modals/ContextSummary.d.ts.map +0 -1
- package/dist/components/modals/GatherContextStep.d.ts +0 -23
- package/dist/components/modals/GatherContextStep.d.ts.map +0 -1
- package/dist/components/modals/KeyboardShortcutsHelpModal.d.ts +0 -8
- package/dist/components/modals/KeyboardShortcutsHelpModal.d.ts.map +0 -1
- package/dist/components/modals/PermissionDeniedModal.d.ts +0 -12
- package/dist/components/modals/PermissionDeniedModal.d.ts.map +0 -1
- package/dist/components/modals/ReferenceWizardModal.d.ts +0 -64
- package/dist/components/modals/ReferenceWizardModal.d.ts.map +0 -1
- package/dist/components/modals/ResourceSearchModal.d.ts +0 -16
- package/dist/components/modals/ResourceSearchModal.d.ts.map +0 -1
- package/dist/components/modals/SearchModal.d.ts +0 -20
- package/dist/components/modals/SearchModal.d.ts.map +0 -1
- package/dist/components/modals/SearchResultsStep.d.ts +0 -22
- package/dist/components/modals/SearchResultsStep.d.ts.map +0 -1
- package/dist/components/modals/SessionExpiredModal.d.ts +0 -12
- package/dist/components/modals/SessionExpiredModal.d.ts.map +0 -1
- package/dist/components/navigation/CollapsibleResourceNavigation.d.ts +0 -13
- package/dist/components/navigation/CollapsibleResourceNavigation.d.ts.map +0 -1
- package/dist/components/navigation/Footer.d.ts +0 -20
- package/dist/components/navigation/Footer.d.ts.map +0 -1
- package/dist/components/navigation/NavigationMenu.d.ts +0 -18
- package/dist/components/navigation/NavigationMenu.d.ts.map +0 -1
- package/dist/components/navigation/ObservableLink.d.ts +0 -52
- package/dist/components/navigation/ObservableLink.d.ts.map +0 -1
- package/dist/components/navigation/SimpleNavigation.d.ts +0 -35
- package/dist/components/navigation/SimpleNavigation.d.ts.map +0 -1
- package/dist/components/navigation/SortableResourceTab.d.ts +0 -7
- package/dist/components/navigation/SortableResourceTab.d.ts.map +0 -1
- package/dist/components/pdf-annotation/PdfAnnotationCanvas.client.d.ts +0 -8
- package/dist/components/pdf-annotation/PdfAnnotationCanvas.client.d.ts.map +0 -1
- package/dist/components/pdf-annotation/PdfAnnotationCanvas.d.ts +0 -25
- package/dist/components/pdf-annotation/PdfAnnotationCanvas.d.ts.map +0 -1
- package/dist/components/resource/AnnotateView.d.ts +0 -29
- package/dist/components/resource/AnnotateView.d.ts.map +0 -1
- package/dist/components/resource/AnnotationHistory.d.ts +0 -14
- package/dist/components/resource/AnnotationHistory.d.ts.map +0 -1
- package/dist/components/resource/BrowseView.d.ts +0 -28
- package/dist/components/resource/BrowseView.d.ts.map +0 -1
- package/dist/components/resource/HistoryEvent.d.ts +0 -19
- package/dist/components/resource/HistoryEvent.d.ts.map +0 -1
- package/dist/components/resource/ResourceViewer.d.ts +0 -46
- package/dist/components/resource/ResourceViewer.d.ts.map +0 -1
- package/dist/components/resource/event-formatting.d.ts +0 -61
- package/dist/components/resource/event-formatting.d.ts.map +0 -1
- package/dist/components/resource/panels/AssessmentEntry.d.ts +0 -11
- package/dist/components/resource/panels/AssessmentEntry.d.ts.map +0 -1
- package/dist/components/resource/panels/AssessmentPanel.d.ts +0 -32
- package/dist/components/resource/panels/AssessmentPanel.d.ts.map +0 -1
- package/dist/components/resource/panels/AssistSection.d.ts +0 -27
- package/dist/components/resource/panels/AssistSection.d.ts.map +0 -1
- package/dist/components/resource/panels/CollaborationPanel.d.ts +0 -28
- package/dist/components/resource/panels/CollaborationPanel.d.ts.map +0 -1
- package/dist/components/resource/panels/CommentEntry.d.ts +0 -12
- package/dist/components/resource/panels/CommentEntry.d.ts.map +0 -1
- package/dist/components/resource/panels/CommentsPanel.d.ts +0 -32
- package/dist/components/resource/panels/CommentsPanel.d.ts.map +0 -1
- package/dist/components/resource/panels/HighlightEntry.d.ts +0 -11
- package/dist/components/resource/panels/HighlightEntry.d.ts.map +0 -1
- package/dist/components/resource/panels/HighlightPanel.d.ts +0 -30
- package/dist/components/resource/panels/HighlightPanel.d.ts.map +0 -1
- package/dist/components/resource/panels/JsonLdPanel.d.ts +0 -9
- package/dist/components/resource/panels/JsonLdPanel.d.ts.map +0 -1
- package/dist/components/resource/panels/PanelHeader.d.ts +0 -13
- package/dist/components/resource/panels/PanelHeader.d.ts.map +0 -1
- package/dist/components/resource/panels/ReferenceEntry.d.ts +0 -15
- package/dist/components/resource/panels/ReferenceEntry.d.ts.map +0 -1
- package/dist/components/resource/panels/ReferencesPanel.d.ts +0 -43
- package/dist/components/resource/panels/ReferencesPanel.d.ts.map +0 -1
- package/dist/components/resource/panels/ResourceInfoPanel.d.ts +0 -27
- package/dist/components/resource/panels/ResourceInfoPanel.d.ts.map +0 -1
- package/dist/components/resource/panels/StatisticsPanel.d.ts +0 -12
- package/dist/components/resource/panels/StatisticsPanel.d.ts.map +0 -1
- package/dist/components/resource/panels/TagEntry.d.ts +0 -11
- package/dist/components/resource/panels/TagEntry.d.ts.map +0 -1
- package/dist/components/resource/panels/TaggingPanel.d.ts +0 -34
- package/dist/components/resource/panels/TaggingPanel.d.ts.map +0 -1
- package/dist/components/resource/panels/UnifiedAnnotationsPanel.d.ts +0 -52
- package/dist/components/resource/panels/UnifiedAnnotationsPanel.d.ts.map +0 -1
- package/dist/components/resource/panels/agent-label.d.ts +0 -11
- package/dist/components/resource/panels/agent-label.d.ts.map +0 -1
- package/dist/components/settings/SettingsPanel.d.ts +0 -19
- package/dist/components/settings/SettingsPanel.d.ts.map +0 -1
- package/dist/components/viewers/ImageViewer.d.ts +0 -8
- package/dist/components/viewers/ImageViewer.d.ts.map +0 -1
- package/dist/components/viewers/index.d.ts +0 -2
- package/dist/components/viewers/index.d.ts.map +0 -1
- package/dist/contexts/AnnotationContext.d.ts +0 -46
- package/dist/contexts/AnnotationContext.d.ts.map +0 -1
- package/dist/contexts/ResourceAnnotationsContext.d.ts +0 -14
- package/dist/contexts/ResourceAnnotationsContext.d.ts.map +0 -1
- package/dist/contexts/RoutingContext.d.ts +0 -59
- package/dist/contexts/RoutingContext.d.ts.map +0 -1
- package/dist/contexts/ThemeContext.d.ts +0 -15
- package/dist/contexts/ThemeContext.d.ts.map +0 -1
- package/dist/contexts/TranslationContext.d.ts +0 -51
- package/dist/contexts/TranslationContext.d.ts.map +0 -1
- package/dist/contexts/useEventSubscription.d.ts +0 -41
- package/dist/contexts/useEventSubscription.d.ts.map +0 -1
- package/dist/design-tokens/index.d.ts +0 -178
- package/dist/design-tokens/index.d.ts.map +0 -1
- package/dist/features/admin-devops/components/AdminDevOpsPage.d.ts +0 -33
- package/dist/features/admin-devops/components/AdminDevOpsPage.d.ts.map +0 -1
- package/dist/features/admin-exchange/components/AdminExchangePage.d.ts +0 -37
- package/dist/features/admin-exchange/components/AdminExchangePage.d.ts.map +0 -1
- package/dist/features/admin-exchange/components/ExportCard.d.ts +0 -18
- package/dist/features/admin-exchange/components/ExportCard.d.ts.map +0 -1
- package/dist/features/admin-exchange/components/ImportCard.d.ts +0 -32
- package/dist/features/admin-exchange/components/ImportCard.d.ts.map +0 -1
- package/dist/features/admin-exchange/components/ImportProgress.d.ts +0 -26
- package/dist/features/admin-exchange/components/ImportProgress.d.ts.map +0 -1
- package/dist/features/admin-exchange/state/exchange-state-unit.d.ts +0 -31
- package/dist/features/admin-exchange/state/exchange-state-unit.d.ts.map +0 -1
- package/dist/features/admin-security/components/AdminSecurityPage.d.ts +0 -42
- package/dist/features/admin-security/components/AdminSecurityPage.d.ts.map +0 -1
- package/dist/features/admin-security/state/admin-security-state-unit.d.ts +0 -12
- package/dist/features/admin-security/state/admin-security-state-unit.d.ts.map +0 -1
- package/dist/features/admin-users/components/AdminUsersPage.d.ts +0 -88
- package/dist/features/admin-users/components/AdminUsersPage.d.ts.map +0 -1
- package/dist/features/admin-users/state/admin-users-state-unit.d.ts +0 -17
- package/dist/features/admin-users/state/admin-users-state-unit.d.ts.map +0 -1
- package/dist/features/auth/components/AuthErrorDisplay.d.ts +0 -34
- package/dist/features/auth/components/AuthErrorDisplay.d.ts.map +0 -1
- package/dist/features/auth/components/SignInForm.d.ts +0 -80
- package/dist/features/auth/components/SignInForm.d.ts.map +0 -1
- package/dist/features/auth/components/SignUpForm.d.ts +0 -39
- package/dist/features/auth/components/SignUpForm.d.ts.map +0 -1
- package/dist/features/auth-welcome/components/WelcomePage.d.ts +0 -62
- package/dist/features/auth-welcome/components/WelcomePage.d.ts.map +0 -1
- package/dist/features/auth-welcome/state/welcome-state-unit.d.ts +0 -12
- package/dist/features/auth-welcome/state/welcome-state-unit.d.ts.map +0 -1
- package/dist/features/moderate-entity-tags/components/EntityTagsPage.d.ts +0 -32
- package/dist/features/moderate-entity-tags/components/EntityTagsPage.d.ts.map +0 -1
- package/dist/features/moderate-entity-tags/state/entity-tags-state-unit.d.ts +0 -16
- package/dist/features/moderate-entity-tags/state/entity-tags-state-unit.d.ts.map +0 -1
- package/dist/features/moderate-recent/components/RecentDocumentsPage.d.ts +0 -27
- package/dist/features/moderate-recent/components/RecentDocumentsPage.d.ts.map +0 -1
- package/dist/features/moderate-tag-schemas/components/TagSchemasPage.d.ts +0 -25
- package/dist/features/moderate-tag-schemas/components/TagSchemasPage.d.ts.map +0 -1
- package/dist/features/moderation-linked-data/components/LinkedDataPage.d.ts +0 -38
- package/dist/features/moderation-linked-data/components/LinkedDataPage.d.ts.map +0 -1
- package/dist/features/resource-compose/components/ResourceComposePage.d.ts +0 -83
- package/dist/features/resource-compose/components/ResourceComposePage.d.ts.map +0 -1
- package/dist/features/resource-compose/components/UploadProgressBar.d.ts +0 -23
- package/dist/features/resource-compose/components/UploadProgressBar.d.ts.map +0 -1
- package/dist/features/resource-compose/state/compose-page-state-unit.d.ts +0 -59
- package/dist/features/resource-compose/state/compose-page-state-unit.d.ts.map +0 -1
- package/dist/features/resource-discovery/components/ResourceCard.d.ts +0 -17
- package/dist/features/resource-discovery/components/ResourceCard.d.ts.map +0 -1
- package/dist/features/resource-discovery/components/ResourceDiscoveryPage.d.ts +0 -43
- package/dist/features/resource-discovery/components/ResourceDiscoveryPage.d.ts.map +0 -1
- package/dist/features/resource-discovery/state/discover-state-unit.d.ts +0 -15
- package/dist/features/resource-discovery/state/discover-state-unit.d.ts.map +0 -1
- package/dist/features/resource-viewer/components/ResourceViewerPage.d.ts +0 -80
- package/dist/features/resource-viewer/components/ResourceViewerPage.d.ts.map +0 -1
- package/dist/features/resource-viewer/state/resource-loader-state-unit.d.ts +0 -11
- package/dist/features/resource-viewer/state/resource-loader-state-unit.d.ts.map +0 -1
- package/dist/features/resource-viewer/state/resource-viewer-page-state-unit.d.ts +0 -48
- package/dist/features/resource-viewer/state/resource-viewer-page-state-unit.d.ts.map +0 -1
- package/dist/hooks/useDebounce.d.ts +0 -29
- package/dist/hooks/useDebounce.d.ts.map +0 -1
- package/dist/hooks/useDragAnnouncements.d.ts +0 -12
- package/dist/hooks/useDragAnnouncements.d.ts.map +0 -1
- package/dist/hooks/useHoverDelay.d.ts +0 -8
- package/dist/hooks/useHoverDelay.d.ts.map +0 -1
- package/dist/hooks/useHoverEmitter.d.ts +0 -8
- package/dist/hooks/useHoverEmitter.d.ts.map +0 -1
- package/dist/hooks/useKeyboardShortcuts.d.ts +0 -29
- package/dist/hooks/useKeyboardShortcuts.d.ts.map +0 -1
- package/dist/hooks/useLineNumbers.d.ts +0 -8
- package/dist/hooks/useLineNumbers.d.ts.map +0 -1
- package/dist/hooks/useMediaToken.d.ts +0 -7
- package/dist/hooks/useMediaToken.d.ts.map +0 -1
- package/dist/hooks/useObservable.d.ts +0 -23
- package/dist/hooks/useObservable.d.ts.map +0 -1
- package/dist/hooks/useObservableBrowse.d.ts +0 -70
- package/dist/hooks/useObservableBrowse.d.ts.map +0 -1
- package/dist/hooks/usePanelWidth.d.ts +0 -37
- package/dist/hooks/usePanelWidth.d.ts.map +0 -1
- package/dist/hooks/useResourceContent.d.ts +0 -7
- package/dist/hooks/useResourceContent.d.ts.map +0 -1
- package/dist/hooks/useRovingTabIndex.d.ts +0 -13
- package/dist/hooks/useRovingTabIndex.d.ts.map +0 -1
- package/dist/hooks/useSearchAnnouncements.d.ts +0 -10
- package/dist/hooks/useSearchAnnouncements.d.ts.map +0 -1
- package/dist/hooks/useSessionExpiry.d.ts +0 -10
- package/dist/hooks/useSessionExpiry.d.ts.map +0 -1
- package/dist/hooks/useShellStateUnit.d.ts +0 -9
- package/dist/hooks/useShellStateUnit.d.ts.map +0 -1
- package/dist/hooks/useStateUnit.d.ts +0 -3
- package/dist/hooks/useStateUnit.d.ts.map +0 -1
- package/dist/hooks/useUI.d.ts +0 -24
- package/dist/hooks/useUI.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/integrations/css-modules-helper.d.ts +0 -114
- package/dist/integrations/css-modules-helper.d.ts.map +0 -1
- package/dist/integrations/styled-components-theme.d.ts +0 -95
- package/dist/integrations/styled-components-theme.d.ts.map +0 -1
- package/dist/integrations/tailwind-plugin.d.cts +0 -3
- package/dist/integrations/tailwind-plugin.d.cts.map +0 -1
- package/dist/lib/annotation-overlay.d.ts +0 -71
- package/dist/lib/annotation-overlay.d.ts.map +0 -1
- package/dist/lib/annotation-registry.d.ts +0 -62
- package/dist/lib/annotation-registry.d.ts.map +0 -1
- package/dist/lib/browser-pdfjs.d.ts +0 -93
- package/dist/lib/browser-pdfjs.d.ts.map +0 -1
- package/dist/lib/button-styles.d.ts +0 -27
- package/dist/lib/button-styles.d.ts.map +0 -1
- package/dist/lib/codemirror-handlers.d.ts +0 -52
- package/dist/lib/codemirror-handlers.d.ts.map +0 -1
- package/dist/lib/codemirror-json-theme.d.ts +0 -8
- package/dist/lib/codemirror-json-theme.d.ts.map +0 -1
- package/dist/lib/codemirror-logic.d.ts +0 -66
- package/dist/lib/codemirror-logic.d.ts.map +0 -1
- package/dist/lib/codemirror-widgets.d.ts +0 -39
- package/dist/lib/codemirror-widgets.d.ts.map +0 -1
- package/dist/lib/formatTime.d.ts +0 -2
- package/dist/lib/formatTime.d.ts.map +0 -1
- package/dist/lib/media-shapes.d.ts +0 -51
- package/dist/lib/media-shapes.d.ts.map +0 -1
- package/dist/lib/pdf-coordinates.d.ts +0 -69
- package/dist/lib/pdf-coordinates.d.ts.map +0 -1
- package/dist/lib/resource-utils.d.ts +0 -22
- package/dist/lib/resource-utils.d.ts.map +0 -1
- package/dist/lib/scroll-utils.d.ts +0 -20
- package/dist/lib/scroll-utils.d.ts.map +0 -1
- package/dist/lib/text-segmentation.d.ts +0 -25
- package/dist/lib/text-segmentation.d.ts.map +0 -1
- package/dist/lib/text-selection-handler.d.ts +0 -46
- package/dist/lib/text-selection-handler.d.ts.map +0 -1
- package/dist/lib/validation.d.ts +0 -47
- package/dist/lib/validation.d.ts.map +0 -1
- package/dist/session/SemiontProvider.d.ts +0 -28
- package/dist/session/SemiontProvider.d.ts.map +0 -1
- package/dist/session/web-browser-storage.d.ts +0 -19
- package/dist/session/web-browser-storage.d.ts.map +0 -1
- package/dist/state/session-state-unit.d.ts +0 -9
- package/dist/state/session-state-unit.d.ts.map +0 -1
- package/dist/state/shell-state-unit.d.ts +0 -33
- package/dist/state/shell-state-unit.d.ts.map +0 -1
- package/dist/test-utils.d.ts.map +0 -1
- package/dist/types/AnnotationManager.d.ts +0 -53
- package/dist/types/AnnotationManager.d.ts.map +0 -1
- package/dist/types/TranslationManager.d.ts +0 -15
- package/dist/types/TranslationManager.d.ts.map +0 -1
- package/dist/types/annotation-props.d.ts +0 -108
- package/dist/types/annotation-props.d.ts.map +0 -1
- package/dist/types/collapsible-navigation.d.ts +0 -69
- package/dist/types/collapsible-navigation.d.ts.map +0 -1
- package/dist/types/modals.d.ts +0 -77
- package/dist/types/modals.d.ts.map +0 -1
- package/dist/types/navigation.d.ts +0 -35
- package/dist/types/navigation.d.ts.map +0 -1
- package/dist/types/resource-viewer.d.ts +0 -19
- package/dist/types/resource-viewer.d.ts.map +0 -1
- package/dist/types/simple-navigation.d.ts +0 -15
- package/dist/types/simple-navigation.d.ts.map +0 -1
- package/dist/types/translation.d.ts +0 -5
- package/dist/types/translation.d.ts.map +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { render, screen, fireEvent } from '@testing-library/react';
|
|
4
3
|
import '@testing-library/jest-dom';
|
|
5
4
|
import { UnifiedHeader } from '../UnifiedHeader';
|
|
@@ -9,6 +8,7 @@ vi.mock('@/hooks/useUI', () => ({
|
|
|
9
8
|
useDropdown: vi.fn(() => ({
|
|
10
9
|
isOpen: false,
|
|
11
10
|
toggle: vi.fn(),
|
|
11
|
+
open: vi.fn(),
|
|
12
12
|
close: vi.fn(),
|
|
13
13
|
dropdownRef: { current: null },
|
|
14
14
|
})),
|
|
@@ -37,6 +37,7 @@ describe('UnifiedHeader Component', () => {
|
|
|
37
37
|
vi.mocked(useDropdown).mockReturnValue({
|
|
38
38
|
isOpen: false,
|
|
39
39
|
toggle: vi.fn(),
|
|
40
|
+
open: vi.fn(),
|
|
40
41
|
close: vi.fn(),
|
|
41
42
|
dropdownRef: { current: null },
|
|
42
43
|
});
|
|
@@ -216,6 +217,7 @@ describe('UnifiedHeader Component', () => {
|
|
|
216
217
|
vi.mocked(useDropdown).mockReturnValue({
|
|
217
218
|
isOpen: false,
|
|
218
219
|
toggle: mockToggle,
|
|
220
|
+
open: vi.fn(),
|
|
219
221
|
close: vi.fn(),
|
|
220
222
|
dropdownRef: { current: null },
|
|
221
223
|
});
|
|
@@ -239,6 +241,7 @@ describe('UnifiedHeader Component', () => {
|
|
|
239
241
|
vi.mocked(useDropdown).mockReturnValue({
|
|
240
242
|
isOpen: true,
|
|
241
243
|
toggle: vi.fn(),
|
|
244
|
+
open: vi.fn(),
|
|
242
245
|
close: vi.fn(),
|
|
243
246
|
dropdownRef: { current: null },
|
|
244
247
|
});
|
|
@@ -261,6 +264,7 @@ describe('UnifiedHeader Component', () => {
|
|
|
261
264
|
vi.mocked(useDropdown).mockReturnValue({
|
|
262
265
|
isOpen: true,
|
|
263
266
|
toggle: vi.fn(),
|
|
267
|
+
open: vi.fn(),
|
|
264
268
|
close: vi.fn(),
|
|
265
269
|
dropdownRef: { current: null },
|
|
266
270
|
});
|
|
@@ -282,6 +286,7 @@ describe('UnifiedHeader Component', () => {
|
|
|
282
286
|
vi.mocked(useDropdown).mockReturnValue({
|
|
283
287
|
isOpen: false,
|
|
284
288
|
toggle: vi.fn(),
|
|
289
|
+
open: vi.fn(),
|
|
285
290
|
close: vi.fn(),
|
|
286
291
|
dropdownRef: { current: null },
|
|
287
292
|
});
|
|
@@ -304,6 +309,7 @@ describe('UnifiedHeader Component', () => {
|
|
|
304
309
|
vi.mocked(useDropdown).mockReturnValue({
|
|
305
310
|
isOpen: true,
|
|
306
311
|
toggle: vi.fn(),
|
|
312
|
+
open: vi.fn(),
|
|
307
313
|
close: mockClose,
|
|
308
314
|
dropdownRef: { current: null },
|
|
309
315
|
});
|
|
@@ -331,6 +337,7 @@ describe('UnifiedHeader Component', () => {
|
|
|
331
337
|
vi.mocked(useDropdown).mockReturnValue({
|
|
332
338
|
isOpen: false,
|
|
333
339
|
toggle: vi.fn(),
|
|
340
|
+
open: vi.fn(),
|
|
334
341
|
close: vi.fn(),
|
|
335
342
|
dropdownRef: { current: null },
|
|
336
343
|
});
|
|
@@ -366,6 +373,7 @@ describe('UnifiedHeader Component', () => {
|
|
|
366
373
|
vi.mocked(useDropdown).mockReturnValue({
|
|
367
374
|
isOpen: true,
|
|
368
375
|
toggle: vi.fn(),
|
|
376
|
+
open: vi.fn(),
|
|
369
377
|
close: vi.fn(),
|
|
370
378
|
dropdownRef: { current: null },
|
|
371
379
|
});
|
|
@@ -389,6 +397,7 @@ describe('UnifiedHeader Component', () => {
|
|
|
389
397
|
vi.mocked(useDropdown).mockReturnValue({
|
|
390
398
|
isOpen: true,
|
|
391
399
|
toggle: vi.fn(),
|
|
400
|
+
open: vi.fn(),
|
|
392
401
|
close: vi.fn(),
|
|
393
402
|
dropdownRef: { current: null },
|
|
394
403
|
});
|
|
@@ -450,6 +459,7 @@ describe('UnifiedHeader Component', () => {
|
|
|
450
459
|
vi.mocked(useDropdown).mockReturnValue({
|
|
451
460
|
isOpen: true,
|
|
452
461
|
toggle: vi.fn(),
|
|
462
|
+
open: vi.fn(),
|
|
453
463
|
close: vi.fn(),
|
|
454
464
|
dropdownRef: { current: null },
|
|
455
465
|
});
|
|
@@ -471,6 +481,7 @@ describe('UnifiedHeader Component', () => {
|
|
|
471
481
|
vi.mocked(useDropdown).mockReturnValue({
|
|
472
482
|
isOpen: true,
|
|
473
483
|
toggle: vi.fn(),
|
|
484
|
+
open: vi.fn(),
|
|
474
485
|
close: vi.fn(),
|
|
475
486
|
dropdownRef: { current: null },
|
|
476
487
|
});
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
* `acknowledgePermissionDenied()` and navigate the window or history.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
10
|
-
import React from 'react';
|
|
9
|
+
import { describe, it, expect, beforeEach, afterEach, vi, type Mock } from 'vitest';
|
|
11
10
|
import { screen, fireEvent } from '@testing-library/react';
|
|
12
11
|
import '@testing-library/jest-dom';
|
|
13
12
|
import {
|
|
@@ -27,7 +26,7 @@ vi.mock('@headlessui/react', () => ({
|
|
|
27
26
|
const originalLocation = window.location;
|
|
28
27
|
const originalHistoryBack = window.history.back;
|
|
29
28
|
let mockLocation: { href: string; pathname: string };
|
|
30
|
-
let mockHistoryBack:
|
|
29
|
+
let mockHistoryBack: Mock<() => void>;
|
|
31
30
|
|
|
32
31
|
beforeEach(() => {
|
|
33
32
|
mockLocation = { href: '', pathname: '/admin/users' };
|
|
@@ -36,7 +35,7 @@ beforeEach(() => {
|
|
|
36
35
|
writable: true,
|
|
37
36
|
configurable: true,
|
|
38
37
|
});
|
|
39
|
-
mockHistoryBack = vi.fn();
|
|
38
|
+
mockHistoryBack = vi.fn<() => void>();
|
|
40
39
|
window.history.back = mockHistoryBack;
|
|
41
40
|
});
|
|
42
41
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
6
|
-
import { render, screen, fireEvent
|
|
6
|
+
import { render, screen, fireEvent } from '@testing-library/react';
|
|
7
7
|
import userEvent from '@testing-library/user-event';
|
|
8
8
|
import { SearchModal } from '../SearchModal';
|
|
9
9
|
|
|
@@ -52,11 +52,6 @@ describe.skip('SearchModal Component - Keyboard Navigation', () => {
|
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
it('should handle Arrow Down key to navigate results', async () => {
|
|
55
|
-
const mockResults = [
|
|
56
|
-
{ type: 'resource' as const, id: '1', name: 'Resource 1', content: 'Content 1' },
|
|
57
|
-
{ type: 'resource' as const, id: '2', name: 'Resource 2', content: 'Content 2' },
|
|
58
|
-
{ type: 'entity' as const, id: '3', name: 'Entity 1', entityType: 'Person' }
|
|
59
|
-
];
|
|
60
55
|
|
|
61
56
|
// TODO: Mock search results when API is integrated
|
|
62
57
|
render(<SearchModal {...defaultProps} />);
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
15
|
-
import React from 'react';
|
|
16
15
|
import { screen, fireEvent, waitFor, act } from '@testing-library/react';
|
|
17
16
|
import { BehaviorSubject } from 'rxjs';
|
|
18
17
|
import { renderWithProviders } from '../../../test-utils';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
6
|
-
import { render, screen, fireEvent
|
|
6
|
+
import { render, screen, fireEvent } from '@testing-library/react';
|
|
7
7
|
import { SearchModal } from '../SearchModal';
|
|
8
8
|
|
|
9
9
|
// Mock the hooks
|
|
@@ -102,7 +102,7 @@ describe.skip('SearchModal Component - Visual States', () => {
|
|
|
102
102
|
rerender(<SearchModal {...defaultProps} isOpen={false} />);
|
|
103
103
|
rerender(<SearchModal {...defaultProps} isOpen={true} />);
|
|
104
104
|
|
|
105
|
-
const input = screen.getByPlaceholderText('Search resources, entities...');
|
|
105
|
+
const input = screen.getByPlaceholderText<HTMLInputElement>('Search resources, entities...');
|
|
106
106
|
expect(input).toBeInTheDocument();
|
|
107
107
|
expect(input.value).toBe('');
|
|
108
108
|
});
|
|
@@ -8,7 +8,7 @@ type TranslateFn = (key: string, params?: Record<string, any>) => string;
|
|
|
8
8
|
|
|
9
9
|
interface NavigationMenuProps {
|
|
10
10
|
Link: React.ComponentType<LinkComponentProps>;
|
|
11
|
-
routes: RouteBuilder
|
|
11
|
+
routes: Partial<RouteBuilder>;
|
|
12
12
|
t: TranslateFn;
|
|
13
13
|
isAdmin?: boolean;
|
|
14
14
|
isModerator?: boolean;
|
|
@@ -21,6 +21,10 @@ describe('Footer - Accessibility', () => {
|
|
|
21
21
|
));
|
|
22
22
|
|
|
23
23
|
const mockRoutes = {
|
|
24
|
+
resourceDetail: vi.fn((id: string) => `/resource/${id}`),
|
|
25
|
+
userProfile: vi.fn((id: string) => `/user/${id}`),
|
|
26
|
+
search: vi.fn((query: string) => `/search?q=${query}`),
|
|
27
|
+
home: vi.fn(() => '/'),
|
|
24
28
|
about: vi.fn(() => '/about'),
|
|
25
29
|
privacy: vi.fn(() => '/privacy'),
|
|
26
30
|
terms: vi.fn(() => '/terms'),
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { describe, it, expect, vi } from 'vitest';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { render, screen, fireEvent } from '@testing-library/react';
|
|
4
3
|
import '@testing-library/jest-dom';
|
|
5
4
|
import { Footer } from '../Footer';
|
|
@@ -124,7 +123,7 @@ describe('Footer Component', () => {
|
|
|
124
123
|
});
|
|
125
124
|
|
|
126
125
|
it('should render Cookie Preferences button when provided', () => {
|
|
127
|
-
const MockCookiePrefs = ({
|
|
126
|
+
const MockCookiePrefs = ({ }: any) => null;
|
|
128
127
|
|
|
129
128
|
render(
|
|
130
129
|
<Footer
|
|
@@ -139,7 +138,7 @@ describe('Footer Component', () => {
|
|
|
139
138
|
});
|
|
140
139
|
|
|
141
140
|
it('should open Cookie Preferences modal when button clicked', () => {
|
|
142
|
-
const MockCookiePrefs = ({ isOpen
|
|
141
|
+
const MockCookiePrefs = ({ isOpen }: any) => (
|
|
143
142
|
isOpen ? <div data-testid="cookie-modal">Cookie Preferences</div> : null
|
|
144
143
|
);
|
|
145
144
|
|
|
@@ -161,9 +160,7 @@ describe('Footer Component', () => {
|
|
|
161
160
|
});
|
|
162
161
|
|
|
163
162
|
it('should close Cookie Preferences modal when onClose called', () => {
|
|
164
|
-
let closeHandler: (() => void) | null = null;
|
|
165
163
|
const MockCookiePrefs = ({ isOpen, onClose }: any) => {
|
|
166
|
-
closeHandler = onClose;
|
|
167
164
|
return isOpen ? (
|
|
168
165
|
<div data-testid="cookie-modal">
|
|
169
166
|
<button onClick={onClose}>Close</button>
|
|
@@ -387,7 +384,7 @@ describe('Footer Component', () => {
|
|
|
387
384
|
|
|
388
385
|
it('should have proper button elements for interactive features', () => {
|
|
389
386
|
const mockHandler = vi.fn();
|
|
390
|
-
const MockCookiePrefs = ({
|
|
387
|
+
const MockCookiePrefs = ({ }: any) => null;
|
|
391
388
|
|
|
392
389
|
render(
|
|
393
390
|
<Footer
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { render, screen, fireEvent } from '@testing-library/react';
|
|
4
3
|
import '@testing-library/jest-dom';
|
|
5
4
|
import { NavigationMenu } from '../NavigationMenu';
|
|
@@ -287,14 +286,13 @@ describe('NavigationMenu Component', () => {
|
|
|
287
286
|
});
|
|
288
287
|
|
|
289
288
|
it('should not show extra divider after admin link', () => {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
);
|
|
289
|
+
render(
|
|
290
|
+
<NavigationMenu
|
|
291
|
+
Link={mockLink}
|
|
292
|
+
routes={mockRoutes}
|
|
293
|
+
t={mockTranslate}
|
|
294
|
+
isAdmin={true} />
|
|
295
|
+
);
|
|
298
296
|
|
|
299
297
|
const adminLink = screen.getByText('Administer').closest('a');
|
|
300
298
|
const nextSibling = adminLink?.nextElementSibling;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { describe, it, expect, vi } from 'vitest';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { screen, fireEvent } from '@testing-library/react';
|
|
4
3
|
import '@testing-library/jest-dom';
|
|
5
4
|
import { renderWithProviders } from '../../../test-utils';
|
|
@@ -143,7 +142,7 @@ describe('SimpleNavigation', () => {
|
|
|
143
142
|
});
|
|
144
143
|
|
|
145
144
|
it('closes dropdown on outside click', () => {
|
|
146
|
-
const dropdownContent = (
|
|
145
|
+
const dropdownContent = () => (
|
|
147
146
|
<div data-testid="dropdown-content">Dropdown</div>
|
|
148
147
|
);
|
|
149
148
|
|
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
import React, { useRef, useState, useCallback, useEffect, useMemo } from 'react';
|
|
4
4
|
import type { Annotation } from '@semiont/core';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
getTargetSelector,
|
|
7
|
+
createFragmentSelector,
|
|
8
|
+
parseFragmentSelector,
|
|
9
|
+
getPageFromFragment,
|
|
10
|
+
} from '@semiont/core';
|
|
6
11
|
import { createHoverHandlers, type SemiontSession } from '@semiont/sdk';
|
|
7
12
|
import type { SelectionMotivation } from '../annotation/AnnotateToolbar';
|
|
8
13
|
import {
|
|
9
14
|
canvasToPdfCoordinates,
|
|
10
15
|
pdfToCanvasCoordinates,
|
|
11
|
-
createFragmentSelector,
|
|
12
|
-
parseFragmentSelector,
|
|
13
|
-
getPageFromFragment,
|
|
14
16
|
type CanvasRectangle
|
|
15
17
|
} from '../../lib/pdf-coordinates';
|
|
16
18
|
import {
|
|
@@ -11,8 +11,7 @@ import { describe, test, expect, vi, beforeEach } from 'vitest';
|
|
|
11
11
|
import { render, screen, waitFor, fireEvent } from '@testing-library/react';
|
|
12
12
|
import userEvent from '@testing-library/user-event';
|
|
13
13
|
import { PdfAnnotationCanvas } from '../PdfAnnotationCanvas';
|
|
14
|
-
import { resourceId } from '@semiont/core';
|
|
15
|
-
import type { components } from '@semiont/core';
|
|
14
|
+
import { resourceId, annotationId } from '@semiont/core';
|
|
16
15
|
|
|
17
16
|
import type { Annotation } from '@semiont/core';
|
|
18
17
|
|
|
@@ -41,6 +40,7 @@ vi.mock('../../../lib/browser-pdfjs', () => ({
|
|
|
41
40
|
|
|
42
41
|
describe('PdfAnnotationCanvas', () => {
|
|
43
42
|
const mockResourceId = resourceId('123');
|
|
43
|
+
const mockPdfUrl = 'https://example.com/resources/123.pdf';
|
|
44
44
|
|
|
45
45
|
beforeEach(() => {
|
|
46
46
|
vi.clearAllMocks();
|
|
@@ -57,7 +57,7 @@ describe('PdfAnnotationCanvas', () => {
|
|
|
57
57
|
test('renders loading state initially', () => {
|
|
58
58
|
render(
|
|
59
59
|
<PdfAnnotationCanvas
|
|
60
|
-
|
|
60
|
+
pdfUrl={mockPdfUrl}
|
|
61
61
|
drawingMode={null}
|
|
62
62
|
/>
|
|
63
63
|
);
|
|
@@ -68,7 +68,7 @@ describe('PdfAnnotationCanvas', () => {
|
|
|
68
68
|
test('renders page navigation controls after loading', async () => {
|
|
69
69
|
render(
|
|
70
70
|
<PdfAnnotationCanvas
|
|
71
|
-
|
|
71
|
+
pdfUrl={mockPdfUrl}
|
|
72
72
|
drawingMode={null}
|
|
73
73
|
/>
|
|
74
74
|
);
|
|
@@ -84,7 +84,7 @@ describe('PdfAnnotationCanvas', () => {
|
|
|
84
84
|
test('previous button is disabled on first page', async () => {
|
|
85
85
|
render(
|
|
86
86
|
<PdfAnnotationCanvas
|
|
87
|
-
|
|
87
|
+
pdfUrl={mockPdfUrl}
|
|
88
88
|
drawingMode={null}
|
|
89
89
|
/>
|
|
90
90
|
);
|
|
@@ -100,7 +100,7 @@ describe('PdfAnnotationCanvas', () => {
|
|
|
100
100
|
test('next button is disabled on last page', async () => {
|
|
101
101
|
render(
|
|
102
102
|
<PdfAnnotationCanvas
|
|
103
|
-
|
|
103
|
+
pdfUrl={mockPdfUrl}
|
|
104
104
|
drawingMode={null}
|
|
105
105
|
/>
|
|
106
106
|
);
|
|
@@ -129,7 +129,7 @@ describe('PdfAnnotationCanvas', () => {
|
|
|
129
129
|
{
|
|
130
130
|
'@context': 'http://www.w3.org/ns/anno.jsonld',
|
|
131
131
|
type: 'Annotation',
|
|
132
|
-
id: 'ann-1',
|
|
132
|
+
id: annotationId('ann-1'),
|
|
133
133
|
target: {
|
|
134
134
|
source: mockResourceId,
|
|
135
135
|
selector: {
|
|
@@ -145,7 +145,7 @@ describe('PdfAnnotationCanvas', () => {
|
|
|
145
145
|
|
|
146
146
|
render(
|
|
147
147
|
<PdfAnnotationCanvas
|
|
148
|
-
|
|
148
|
+
pdfUrl={mockPdfUrl}
|
|
149
149
|
existingAnnotations={mockAnnotations}
|
|
150
150
|
drawingMode={null}
|
|
151
151
|
/>
|
|
@@ -177,21 +177,12 @@ describe('PdfAnnotationCanvas', () => {
|
|
|
177
177
|
});
|
|
178
178
|
});
|
|
179
179
|
|
|
180
|
-
test('
|
|
181
|
-
const mockSubject = { next: vi.fn(), subscribe: vi.fn() };
|
|
182
|
-
const mockEventBus = {
|
|
183
|
-
emit: vi.fn(),
|
|
184
|
-
on: vi.fn(),
|
|
185
|
-
off: vi.fn(),
|
|
186
|
-
get: vi.fn().mockReturnValue(mockSubject),
|
|
187
|
-
};
|
|
188
|
-
|
|
180
|
+
test('accepts a drawing gesture without throwing when drawing mode is active', async () => {
|
|
189
181
|
render(
|
|
190
182
|
<PdfAnnotationCanvas
|
|
191
|
-
|
|
183
|
+
pdfUrl={mockPdfUrl}
|
|
192
184
|
drawingMode="rectangle"
|
|
193
185
|
selectedMotivation="highlighting"
|
|
194
|
-
eventBus={mockEventBus as any}
|
|
195
186
|
/>
|
|
196
187
|
);
|
|
197
188
|
|
|
@@ -2,10 +2,10 @@ import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
|
|
4
4
|
import { BrowseView } from '../BrowseView';
|
|
5
|
-
import type {
|
|
5
|
+
import type { EventBus } from '@semiont/core';
|
|
6
6
|
import { createTestSemiontWrapper } from '../../../test-utils';
|
|
7
7
|
|
|
8
|
-
import type { Annotation } from '@semiont/core';
|
|
8
|
+
import type { Annotation, AnnotationId } from '@semiont/core';
|
|
9
9
|
|
|
10
10
|
// Mock ResourceAnnotationsContext - keep this simple
|
|
11
11
|
let mockNewAnnotationIds = new Set<string>();
|
|
@@ -151,12 +151,12 @@ const renderWithEventTracking = (
|
|
|
151
151
|
};
|
|
152
152
|
|
|
153
153
|
// Test data fixtures
|
|
154
|
-
const createMockAnnotation = (motivation:
|
|
154
|
+
const createMockAnnotation = (motivation: Annotation['motivation'], id: string): Annotation => ({
|
|
155
155
|
'@context': 'http://www.w3.org/ns/anno.jsonld',
|
|
156
|
-
id,
|
|
156
|
+
id: id as AnnotationId,
|
|
157
157
|
type: 'Annotation',
|
|
158
158
|
motivation,
|
|
159
|
-
creator: { name: 'user@example.com' },
|
|
159
|
+
creator: { '@type': 'Person', name: 'user@example.com' },
|
|
160
160
|
created: '2024-01-01T10:00:00Z',
|
|
161
161
|
target: {
|
|
162
162
|
source: 'resource-1',
|
|
@@ -197,7 +197,9 @@ describe('BrowseView Component', () => {
|
|
|
197
197
|
// Mock querySelector and querySelectorAll
|
|
198
198
|
if (typeof document !== 'undefined') {
|
|
199
199
|
document.querySelector = vi.fn();
|
|
200
|
-
|
|
200
|
+
// Return a real (empty) NodeList so the mock matches the DOM signature.
|
|
201
|
+
const emptyNodeList = document.createDocumentFragment().querySelectorAll('*');
|
|
202
|
+
document.querySelectorAll = vi.fn(() => emptyNodeList);
|
|
201
203
|
}
|
|
202
204
|
});
|
|
203
205
|
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { screen, fireEvent, act } from '@testing-library/react';
|
|
4
3
|
import '@testing-library/jest-dom';
|
|
5
4
|
import { HistoryEvent } from '../HistoryEvent';
|
|
6
5
|
import { renderWithProviders } from '../../../test-utils';
|
|
7
|
-
import type { StoredEvent } from '@semiont/core';
|
|
8
6
|
|
|
9
7
|
// Mock @semiont/core - must use importOriginal to preserve EventBus etc.
|
|
10
8
|
vi.mock('@semiont/core', async (importOriginal) => {
|
|
@@ -37,8 +35,6 @@ vi.mock('../event-formatting', () => ({
|
|
|
37
35
|
import { getAnnotationUriFromEvent } from '@semiont/core';
|
|
38
36
|
import {
|
|
39
37
|
formatEventType,
|
|
40
|
-
getEventEmoji,
|
|
41
|
-
formatRelativeTime,
|
|
42
38
|
getEventDisplayContent,
|
|
43
39
|
getEventEntityTypes,
|
|
44
40
|
getResourceCreationDetails,
|
|
@@ -11,15 +11,13 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
14
|
-
import { render, screen
|
|
14
|
+
import { render, screen } from '@testing-library/react';
|
|
15
15
|
import { BehaviorSubject } from 'rxjs';
|
|
16
16
|
import { ResourceViewer } from '../ResourceViewer';
|
|
17
17
|
import { createTestSemiontWrapper } from '../../../test-utils';
|
|
18
18
|
import { TranslationProvider } from '../../../contexts/TranslationContext';
|
|
19
19
|
import { ResourceAnnotationsProvider } from '../../../contexts/ResourceAnnotationsContext';
|
|
20
|
-
import type {
|
|
21
|
-
|
|
22
|
-
type SemiontResource = components['schemas']['ResourceDescriptor'];
|
|
20
|
+
import type { ResourceDescriptor as SemiontResource, ResourceId } from '@semiont/core';
|
|
23
21
|
|
|
24
22
|
// Mock dependencies
|
|
25
23
|
vi.mock('../../../hooks/useObservableBrowse', () => ({
|
|
@@ -61,7 +59,7 @@ vi.mock('../../../session/SemiontProvider', async () => {
|
|
|
61
59
|
|
|
62
60
|
const mockResource: SemiontResource & { content: string } = {
|
|
63
61
|
'@context': 'https://www.w3.org/ns/activitystreams',
|
|
64
|
-
'@id': 'test-123',
|
|
62
|
+
'@id': 'test-123' as ResourceId,
|
|
65
63
|
name: 'Test Document',
|
|
66
64
|
created: '2024-01-01T00:00:00Z',
|
|
67
65
|
entityTypes: [],
|
|
@@ -84,7 +82,7 @@ const mockAnnotations = {
|
|
|
84
82
|
};
|
|
85
83
|
|
|
86
84
|
const mockTranslationManager = {
|
|
87
|
-
t: (namespace: string, key: string
|
|
85
|
+
t: (namespace: string, key: string) => {
|
|
88
86
|
return `${namespace}.${key}`;
|
|
89
87
|
},
|
|
90
88
|
};
|
|
@@ -236,7 +236,7 @@ export function ReferencesPanel({
|
|
|
236
236
|
}
|
|
237
237
|
|
|
238
238
|
// When annotation is complete and we haven't saved yet, save the log
|
|
239
|
-
if (!
|
|
239
|
+
if (!hasSavedLogRef.current && progress?.completedEntityTypes) {
|
|
240
240
|
hasSavedLogRef.current = true;
|
|
241
241
|
setLastDetectionLog(progress.completedEntityTypes);
|
|
242
242
|
setSelectedEntityTypes([]);
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { screen } from '@testing-library/react';
|
|
4
3
|
import '@testing-library/jest-dom';
|
|
5
4
|
import { renderWithProviders } from '../../../../test-utils';
|
|
6
5
|
import userEvent from '@testing-library/user-event';
|
|
7
|
-
import type { components } from '@semiont/core';
|
|
8
6
|
|
|
9
|
-
import type { Annotation } from '@semiont/core';
|
|
7
|
+
import type { Annotation, AnnotationId } from '@semiont/core';
|
|
10
8
|
|
|
11
9
|
// Mock @semiont/api-client
|
|
12
10
|
vi.mock('@semiont/core', async () => {
|
|
@@ -25,10 +23,11 @@ const mockGetAnnotationExactText = getAnnotationExactText as MockedFunction<type
|
|
|
25
23
|
|
|
26
24
|
const createMockAssessment = (overrides?: Partial<Annotation>): Annotation => ({
|
|
27
25
|
'@context': 'http://www.w3.org/ns/anno.jsonld',
|
|
28
|
-
id: 'assessment-1',
|
|
26
|
+
id: 'assessment-1' as AnnotationId,
|
|
29
27
|
type: 'Annotation',
|
|
30
28
|
motivation: 'assessing',
|
|
31
29
|
creator: {
|
|
30
|
+
'@type': 'Person',
|
|
32
31
|
name: 'reviewer@example.com',
|
|
33
32
|
},
|
|
34
33
|
created: '2024-06-15T12:00:00Z',
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
2
2
|
import type { MockedFunction } from 'vitest';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { render, screen,
|
|
4
|
+
import { render, screen, waitFor } from '@testing-library/react';
|
|
5
5
|
import userEvent from '@testing-library/user-event';
|
|
6
6
|
import '@testing-library/jest-dom';
|
|
7
7
|
import { AssessmentPanel } from '../AssessmentPanel';
|
|
8
|
-
import type {
|
|
8
|
+
import type { EventBus } from '@semiont/core';
|
|
9
9
|
import { createTestSemiontWrapper } from '../../../../test-utils';
|
|
10
10
|
|
|
11
|
-
import type { Annotation } from '@semiont/core';
|
|
11
|
+
import type { Annotation, AnnotationId } from '@semiont/core';
|
|
12
12
|
|
|
13
13
|
// Composition-based event tracker
|
|
14
14
|
interface TrackedEvent {
|
|
@@ -69,7 +69,7 @@ vi.mock('@semiont/core', async () => {
|
|
|
69
69
|
|
|
70
70
|
// Mock AssessmentEntry component to simplify testing
|
|
71
71
|
vi.mock('../AssessmentEntry', () => ({
|
|
72
|
-
AssessmentEntry: ({ assessment
|
|
72
|
+
AssessmentEntry: ({ assessment }: any) => (
|
|
73
73
|
<div data-testid={`assessment-${assessment.id}`}>
|
|
74
74
|
<div>{assessment.id}</div>
|
|
75
75
|
</div>
|
|
@@ -78,7 +78,7 @@ vi.mock('../AssessmentEntry', () => ({
|
|
|
78
78
|
|
|
79
79
|
// Mock AssistSection component — just render a simplified version.
|
|
80
80
|
vi.mock('../AssistSection', () => ({
|
|
81
|
-
AssistSection: ({
|
|
81
|
+
AssistSection: ({ isAssisting }: any) => (
|
|
82
82
|
<div data-testid="detect-section">
|
|
83
83
|
<button>Start Detection</button>
|
|
84
84
|
{isAssisting && <div>Detecting...</div>}
|
|
@@ -93,10 +93,11 @@ const mockGetTargetSelector = getTargetSelector as MockedFunction<typeof getTarg
|
|
|
93
93
|
// Test data fixtures
|
|
94
94
|
const createMockAssessment = (id: string, start: number, end: number): Annotation => ({
|
|
95
95
|
'@context': 'http://www.w3.org/ns/anno.jsonld',
|
|
96
|
-
id,
|
|
96
|
+
id: id as AnnotationId,
|
|
97
97
|
type: 'Annotation',
|
|
98
98
|
motivation: 'assessing',
|
|
99
99
|
creator: {
|
|
100
|
+
'@type': 'Person',
|
|
100
101
|
name: `user${id}@example.com`,
|
|
101
102
|
},
|
|
102
103
|
created: `2024-01-0${id.slice(-1)}T10:00:00Z`,
|