@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,11 +1,9 @@
|
|
|
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
|
-
import type { components } from '@semiont/core';
|
|
7
5
|
|
|
8
|
-
import type { Annotation } from '@semiont/core';
|
|
6
|
+
import type { Annotation, AnnotationId } from '@semiont/core';
|
|
9
7
|
|
|
10
8
|
// Stable mock functions defined outside vi.mock to avoid re-render loops
|
|
11
9
|
const mockIsBodyResolved = vi.fn();
|
|
@@ -27,7 +25,7 @@ import { StatisticsPanel } from '../StatisticsPanel';
|
|
|
27
25
|
|
|
28
26
|
const createMockAnnotation = (overrides?: Partial<Annotation>): Annotation => ({
|
|
29
27
|
'@context': 'http://www.w3.org/ns/anno.jsonld',
|
|
30
|
-
id: 'http://example.com/annotations/1',
|
|
28
|
+
id: 'http://example.com/annotations/1' as AnnotationId,
|
|
31
29
|
type: 'Annotation',
|
|
32
30
|
motivation: 'linking',
|
|
33
31
|
created: '2024-06-15T12:00:00Z',
|
|
@@ -73,7 +71,7 @@ describe('StatisticsPanel', () => {
|
|
|
73
71
|
it('should render correct highlight count', () => {
|
|
74
72
|
const props = {
|
|
75
73
|
...emptyProps,
|
|
76
|
-
highlights: [createMockAnnotation({ id: 'h1' }), createMockAnnotation({ id: 'h2' }), createMockAnnotation({ id: 'h3' })],
|
|
74
|
+
highlights: [createMockAnnotation({ id: 'h1' as AnnotationId }), createMockAnnotation({ id: 'h2' as AnnotationId }), createMockAnnotation({ id: 'h3' as AnnotationId })],
|
|
77
75
|
};
|
|
78
76
|
|
|
79
77
|
renderWithProviders(<StatisticsPanel {...props} />);
|
|
@@ -85,7 +83,7 @@ describe('StatisticsPanel', () => {
|
|
|
85
83
|
it('should render correct comment count', () => {
|
|
86
84
|
const props = {
|
|
87
85
|
...emptyProps,
|
|
88
|
-
comments: [createMockAnnotation({ id: 'c1' }), createMockAnnotation({ id: 'c2' })],
|
|
86
|
+
comments: [createMockAnnotation({ id: 'c1' as AnnotationId }), createMockAnnotation({ id: 'c2' as AnnotationId })],
|
|
89
87
|
};
|
|
90
88
|
|
|
91
89
|
renderWithProviders(<StatisticsPanel {...props} />);
|
|
@@ -97,7 +95,7 @@ describe('StatisticsPanel', () => {
|
|
|
97
95
|
it('should render correct assessment count', () => {
|
|
98
96
|
const props = {
|
|
99
97
|
...emptyProps,
|
|
100
|
-
assessments: [createMockAnnotation({ id: 'a1' })],
|
|
98
|
+
assessments: [createMockAnnotation({ id: 'a1' as AnnotationId })],
|
|
101
99
|
};
|
|
102
100
|
|
|
103
101
|
renderWithProviders(<StatisticsPanel {...props} />);
|
|
@@ -110,10 +108,10 @@ describe('StatisticsPanel', () => {
|
|
|
110
108
|
const props = {
|
|
111
109
|
...emptyProps,
|
|
112
110
|
tags: [
|
|
113
|
-
createMockAnnotation({ id: 't1' }),
|
|
114
|
-
createMockAnnotation({ id: 't2' }),
|
|
115
|
-
createMockAnnotation({ id: 't3' }),
|
|
116
|
-
createMockAnnotation({ id: 't4' }),
|
|
111
|
+
createMockAnnotation({ id: 't1' as AnnotationId }),
|
|
112
|
+
createMockAnnotation({ id: 't2' as AnnotationId }),
|
|
113
|
+
createMockAnnotation({ id: 't3' as AnnotationId }),
|
|
114
|
+
createMockAnnotation({ id: 't4' as AnnotationId }),
|
|
117
115
|
],
|
|
118
116
|
};
|
|
119
117
|
|
|
@@ -124,9 +122,9 @@ describe('StatisticsPanel', () => {
|
|
|
124
122
|
});
|
|
125
123
|
|
|
126
124
|
it('should render correct total reference count', () => {
|
|
127
|
-
const refs = [createMockAnnotation({ id: 'r1' }), createMockAnnotation({ id: 'r2' })];
|
|
125
|
+
const refs = [createMockAnnotation({ id: 'r1' as AnnotationId }), createMockAnnotation({ id: 'r2' as AnnotationId })];
|
|
128
126
|
|
|
129
|
-
|
|
127
|
+
renderWithProviders(<StatisticsPanel {...emptyProps} references={refs} />);
|
|
130
128
|
|
|
131
129
|
expect(screen.getByText('StatisticsPanel.references')).toBeInTheDocument();
|
|
132
130
|
// The references item has the total count as its direct .semiont-statistics-panel__value child
|
|
@@ -139,13 +137,13 @@ describe('StatisticsPanel', () => {
|
|
|
139
137
|
describe('Reference sub-categories', () => {
|
|
140
138
|
it('should show stub and resolved counts', () => {
|
|
141
139
|
const refs = [
|
|
142
|
-
createMockAnnotation({ id: 'r1' }),
|
|
143
|
-
createMockAnnotation({ id: 'r2' }),
|
|
144
|
-
createMockAnnotation({ id: 'r3' }),
|
|
140
|
+
createMockAnnotation({ id: 'r1' as AnnotationId }),
|
|
141
|
+
createMockAnnotation({ id: 'r2' as AnnotationId }),
|
|
142
|
+
createMockAnnotation({ id: 'r3' as AnnotationId }),
|
|
145
143
|
];
|
|
146
144
|
|
|
147
145
|
// r1 resolved, r2 and r3 are stubs
|
|
148
|
-
mockIsBodyResolved.mockImplementation((
|
|
146
|
+
mockIsBodyResolved.mockImplementation(() => {
|
|
149
147
|
// We can distinguish by the call order
|
|
150
148
|
return false;
|
|
151
149
|
});
|
|
@@ -167,8 +165,8 @@ describe('StatisticsPanel', () => {
|
|
|
167
165
|
|
|
168
166
|
it('should count all as resolved when isBodyResolved returns true', () => {
|
|
169
167
|
const refs = [
|
|
170
|
-
createMockAnnotation({ id: 'r1' }),
|
|
171
|
-
createMockAnnotation({ id: 'r2' }),
|
|
168
|
+
createMockAnnotation({ id: 'r1' as AnnotationId }),
|
|
169
|
+
createMockAnnotation({ id: 'r2' as AnnotationId }),
|
|
172
170
|
];
|
|
173
171
|
|
|
174
172
|
mockIsBodyResolved.mockReturnValue(true);
|
|
@@ -182,8 +180,8 @@ describe('StatisticsPanel', () => {
|
|
|
182
180
|
|
|
183
181
|
it('should count all as stubs when isBodyResolved returns false', () => {
|
|
184
182
|
const refs = [
|
|
185
|
-
createMockAnnotation({ id: 'r1' }),
|
|
186
|
-
createMockAnnotation({ id: 'r2' }),
|
|
183
|
+
createMockAnnotation({ id: 'r1' as AnnotationId }),
|
|
184
|
+
createMockAnnotation({ id: 'r2' as AnnotationId }),
|
|
187
185
|
];
|
|
188
186
|
|
|
189
187
|
mockIsBodyResolved.mockReturnValue(false);
|
|
@@ -206,9 +204,9 @@ describe('StatisticsPanel', () => {
|
|
|
206
204
|
|
|
207
205
|
it('should render entity types with counts', () => {
|
|
208
206
|
const refs = [
|
|
209
|
-
createMockAnnotation({ id: 'r1' }),
|
|
210
|
-
createMockAnnotation({ id: 'r2' }),
|
|
211
|
-
createMockAnnotation({ id: 'r3' }),
|
|
207
|
+
createMockAnnotation({ id: 'r1' as AnnotationId }),
|
|
208
|
+
createMockAnnotation({ id: 'r2' as AnnotationId }),
|
|
209
|
+
createMockAnnotation({ id: 'r3' as AnnotationId }),
|
|
212
210
|
];
|
|
213
211
|
|
|
214
212
|
mockGetEntityTypes
|
|
@@ -226,9 +224,9 @@ describe('StatisticsPanel', () => {
|
|
|
226
224
|
|
|
227
225
|
it('should sort entity types by count descending', () => {
|
|
228
226
|
const refs = [
|
|
229
|
-
createMockAnnotation({ id: 'r1' }),
|
|
230
|
-
createMockAnnotation({ id: 'r2' }),
|
|
231
|
-
createMockAnnotation({ id: 'r3' }),
|
|
227
|
+
createMockAnnotation({ id: 'r1' as AnnotationId }),
|
|
228
|
+
createMockAnnotation({ id: 'r2' as AnnotationId }),
|
|
229
|
+
createMockAnnotation({ id: 'r3' as AnnotationId }),
|
|
232
230
|
];
|
|
233
231
|
|
|
234
232
|
// Person appears 3 times, Location 1 time
|
|
@@ -251,11 +249,11 @@ describe('StatisticsPanel', () => {
|
|
|
251
249
|
describe('Mixed annotation counts', () => {
|
|
252
250
|
it('should render all categories with their respective counts simultaneously', () => {
|
|
253
251
|
const props = {
|
|
254
|
-
highlights: [createMockAnnotation({ id: 'h1' })],
|
|
255
|
-
comments: [createMockAnnotation({ id: 'c1' }), createMockAnnotation({ id: 'c2' })],
|
|
256
|
-
assessments: [createMockAnnotation({ id: 'a1' }), createMockAnnotation({ id: 'a2' }), createMockAnnotation({ id: 'a3' })],
|
|
257
|
-
references: [createMockAnnotation({ id: 'r1' })],
|
|
258
|
-
tags: [createMockAnnotation({ id: 't1' }), createMockAnnotation({ id: 't2' })],
|
|
252
|
+
highlights: [createMockAnnotation({ id: 'h1' as AnnotationId })],
|
|
253
|
+
comments: [createMockAnnotation({ id: 'c1' as AnnotationId }), createMockAnnotation({ id: 'c2' as AnnotationId })],
|
|
254
|
+
assessments: [createMockAnnotation({ id: 'a1' as AnnotationId }), createMockAnnotation({ id: 'a2' as AnnotationId }), createMockAnnotation({ id: 'a3' as AnnotationId })],
|
|
255
|
+
references: [createMockAnnotation({ id: 'r1' as AnnotationId })],
|
|
256
|
+
tags: [createMockAnnotation({ id: 't1' as AnnotationId }), createMockAnnotation({ id: 't2' as AnnotationId })],
|
|
259
257
|
};
|
|
260
258
|
|
|
261
259
|
renderWithProviders(<StatisticsPanel {...props} />);
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { render, screen } from '@testing-library/react';
|
|
4
3
|
import '@testing-library/jest-dom';
|
|
5
4
|
import { of } from 'rxjs';
|
|
6
5
|
import { CacheObservable } from '@semiont/sdk';
|
|
7
6
|
import { renderWithProviders, createTestSemiontWrapper } from '../../../../test-utils';
|
|
8
7
|
import userEvent from '@testing-library/user-event';
|
|
9
|
-
import type {
|
|
8
|
+
import type { TagSchema } from '@semiont/core';
|
|
10
9
|
|
|
11
|
-
import type { Annotation } from '@semiont/core';
|
|
10
|
+
import type { Annotation, AnnotationId } from '@semiont/core';
|
|
12
11
|
|
|
13
12
|
// Mock @semiont/api-client
|
|
14
13
|
vi.mock('@semiont/core', async () => {
|
|
@@ -37,10 +36,11 @@ const mockGetTagSchemaId = getTagSchemaId as MockedFunction<typeof getTagSchemaI
|
|
|
37
36
|
|
|
38
37
|
const createMockTag = (overrides?: Partial<Annotation>): Annotation => ({
|
|
39
38
|
'@context': 'http://www.w3.org/ns/anno.jsonld',
|
|
40
|
-
id: 'tag-1',
|
|
39
|
+
id: 'tag-1' as AnnotationId,
|
|
41
40
|
type: 'Annotation',
|
|
42
41
|
motivation: 'tagging',
|
|
43
42
|
creator: {
|
|
43
|
+
'@type': 'Person',
|
|
44
44
|
name: 'tagger@example.com',
|
|
45
45
|
},
|
|
46
46
|
created: '2024-06-15T12:00:00Z',
|
|
@@ -71,7 +71,7 @@ describe('TagEntry', () => {
|
|
|
71
71
|
vi.clearAllMocks();
|
|
72
72
|
mockGetAnnotationExactText.mockReturnValue('Tagged text content');
|
|
73
73
|
mockGetTagCategory.mockReturnValue('Entity');
|
|
74
|
-
mockGetTagSchemaId.mockReturnValue(
|
|
74
|
+
mockGetTagSchemaId.mockReturnValue(undefined);
|
|
75
75
|
});
|
|
76
76
|
|
|
77
77
|
describe('Rendering', () => {
|
|
@@ -1,16 +1,16 @@
|
|
|
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 { of } from 'rxjs';
|
|
8
8
|
import { CacheObservable } from '@semiont/sdk';
|
|
9
9
|
import { TaggingPanel } from '../TaggingPanel';
|
|
10
|
-
import type {
|
|
10
|
+
import type { EventBus, TagSchema } from '@semiont/core';
|
|
11
11
|
import { createTestSemiontWrapper } from '../../../../test-utils';
|
|
12
12
|
|
|
13
|
-
import type { Annotation } from '@semiont/core';
|
|
13
|
+
import type { Annotation, AnnotationId } from '@semiont/core';
|
|
14
14
|
|
|
15
15
|
// Composition-based event tracker
|
|
16
16
|
interface TrackedEvent {
|
|
@@ -124,7 +124,7 @@ vi.mock('@semiont/core', async () => {
|
|
|
124
124
|
|
|
125
125
|
// Mock TagEntry component to simplify testing
|
|
126
126
|
vi.mock('../TagEntry', () => ({
|
|
127
|
-
TagEntry: ({ tag
|
|
127
|
+
TagEntry: ({ tag }: any) => (
|
|
128
128
|
<div data-testid={`tag-${tag.id}`}>
|
|
129
129
|
<div>{tag.id}</div>
|
|
130
130
|
</div>
|
|
@@ -138,10 +138,11 @@ const mockGetTargetSelector = getTargetSelector as MockedFunction<typeof getTarg
|
|
|
138
138
|
// Test data fixtures
|
|
139
139
|
const createMockTag = (id: string, start: number, end: number, tagName: string = 'Issue'): Annotation => ({
|
|
140
140
|
'@context': 'http://www.w3.org/ns/anno.jsonld',
|
|
141
|
-
id,
|
|
141
|
+
id: id as AnnotationId,
|
|
142
142
|
type: 'Annotation',
|
|
143
143
|
motivation: 'tagging',
|
|
144
144
|
creator: {
|
|
145
|
+
'@type': 'Person',
|
|
145
146
|
name: `user${id}@example.com`,
|
|
146
147
|
},
|
|
147
148
|
created: `2024-01-0${id.slice(-1)}T10:00:00Z`,
|
|
@@ -45,6 +45,8 @@ const mockTranslations = {
|
|
|
45
45
|
errorEmailRequired: 'Email is required',
|
|
46
46
|
errorPasswordRequired: 'Password is required',
|
|
47
47
|
errorBackendUrlRequired: 'Backend URL is required',
|
|
48
|
+
errorBackendUrlInvalid: 'Backend URL is not valid',
|
|
49
|
+
errorBackendUrlUnreachable: 'Backend URL is unreachable',
|
|
48
50
|
tagline: 'make meaning',
|
|
49
51
|
};
|
|
50
52
|
|
|
@@ -54,7 +54,7 @@ describe('SignUpForm - Accessibility', () => {
|
|
|
54
54
|
});
|
|
55
55
|
|
|
56
56
|
it('should have no accessibility violations during loading state', async () => {
|
|
57
|
-
const onSignUp = vi.fn(() => new Promise(() => {})); // Never resolves
|
|
57
|
+
const onSignUp = vi.fn<() => Promise<void>>(() => new Promise<void>(() => {})); // Never resolves
|
|
58
58
|
|
|
59
59
|
const { container } = render(
|
|
60
60
|
<SignUpForm
|
|
@@ -138,7 +138,7 @@ describe('SignUpForm - Accessibility', () => {
|
|
|
138
138
|
});
|
|
139
139
|
|
|
140
140
|
it('should disable button during loading state', async () => {
|
|
141
|
-
const onSignUp = vi.fn(() => new Promise(() => {}));
|
|
141
|
+
const onSignUp = vi.fn<() => Promise<void>>(() => new Promise<void>(() => {}));
|
|
142
142
|
|
|
143
143
|
render(
|
|
144
144
|
<SignUpForm
|
|
@@ -197,13 +197,12 @@ describe('SignUpForm - Accessibility', () => {
|
|
|
197
197
|
it('should have Google icon inside button', () => {
|
|
198
198
|
const onSignUp = vi.fn();
|
|
199
199
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
);
|
|
200
|
+
render(
|
|
201
|
+
<SignUpForm
|
|
202
|
+
onSignUp={onSignUp}
|
|
203
|
+
Link={MockLink}
|
|
204
|
+
translations={mockTranslations} />
|
|
205
|
+
);
|
|
207
206
|
|
|
208
207
|
const button = screen.getByRole('button');
|
|
209
208
|
const svg = button.querySelector('svg');
|
|
@@ -214,7 +213,7 @@ describe('SignUpForm - Accessibility', () => {
|
|
|
214
213
|
});
|
|
215
214
|
|
|
216
215
|
it('should show loading spinner during sign-up', async () => {
|
|
217
|
-
const onSignUp = vi.fn(() => new Promise(() => {}));
|
|
216
|
+
const onSignUp = vi.fn<() => Promise<void>>(() => new Promise<void>(() => {}));
|
|
218
217
|
|
|
219
218
|
const { container } = render(
|
|
220
219
|
<SignUpForm
|
|
@@ -349,7 +348,7 @@ describe('SignUpForm - Accessibility', () => {
|
|
|
349
348
|
|
|
350
349
|
describe('Loading State Accessibility', () => {
|
|
351
350
|
it('should announce loading state to screen readers', async () => {
|
|
352
|
-
const onSignUp = vi.fn(() => new Promise(() => {}));
|
|
351
|
+
const onSignUp = vi.fn<() => Promise<void>>(() => new Promise<void>(() => {}));
|
|
353
352
|
|
|
354
353
|
render(
|
|
355
354
|
<SignUpForm
|
|
@@ -368,7 +367,7 @@ describe('SignUpForm - Accessibility', () => {
|
|
|
368
367
|
});
|
|
369
368
|
|
|
370
369
|
it('should maintain button focus during loading', async () => {
|
|
371
|
-
const onSignUp = vi.fn(() => new Promise(() => {}));
|
|
370
|
+
const onSignUp = vi.fn<() => Promise<void>>(() => new Promise<void>(() => {}));
|
|
372
371
|
|
|
373
372
|
render(
|
|
374
373
|
<SignUpForm
|
|
@@ -53,7 +53,7 @@ describe('SignUpForm', () => {
|
|
|
53
53
|
|
|
54
54
|
describe('Sign-Up Interaction', () => {
|
|
55
55
|
it('calls onSignUp when button is clicked', async () => {
|
|
56
|
-
const onSignUp = vi.fn<
|
|
56
|
+
const onSignUp = vi.fn<() => Promise<void>>().mockResolvedValue(undefined);
|
|
57
57
|
render(<SignUpForm onSignUp={onSignUp} Link={MockLink} translations={mockTranslations} />);
|
|
58
58
|
|
|
59
59
|
const button = screen.getByRole('button', { name: /Continue with Google/i });
|
|
@@ -63,7 +63,7 @@ describe('SignUpForm', () => {
|
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
it('shows loading state while signing up', async () => {
|
|
66
|
-
const onSignUp = vi.fn<
|
|
66
|
+
const onSignUp = vi.fn<() => Promise<void>>(() => new Promise<void>((resolve) => setTimeout(resolve, 100)));
|
|
67
67
|
render(<SignUpForm onSignUp={onSignUp} Link={MockLink} translations={mockTranslations} />);
|
|
68
68
|
|
|
69
69
|
const button = screen.getByRole('button');
|
|
@@ -83,7 +83,7 @@ describe('SignUpForm', () => {
|
|
|
83
83
|
});
|
|
84
84
|
|
|
85
85
|
it('disables button during loading', async () => {
|
|
86
|
-
const onSignUp = vi.fn<
|
|
86
|
+
const onSignUp = vi.fn<() => Promise<void>>(() => new Promise<void>((resolve) => setTimeout(resolve, 100)));
|
|
87
87
|
render(<SignUpForm onSignUp={onSignUp} Link={MockLink} translations={mockTranslations} />);
|
|
88
88
|
|
|
89
89
|
const button = screen.getByRole('button');
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
} from '@heroicons/react/24/outline';
|
|
14
14
|
import { COMMON_PANELS, type ToolbarPanelType } from '../../../state/shell-state-unit';
|
|
15
15
|
import type { TagSchema } from '@semiont/sdk';
|
|
16
|
+
export type { TagSchema };
|
|
16
17
|
|
|
17
18
|
export interface TagSchemasPageProps {
|
|
18
19
|
// Data props
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { describe, it, expect, vi } from 'vitest';
|
|
9
9
|
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
|
|
10
10
|
import { ResourceComposePage } from '../components/ResourceComposePage';
|
|
11
|
-
import type { ResourceComposePageProps
|
|
11
|
+
import type { ResourceComposePageProps } from '../components/ResourceComposePage';
|
|
12
12
|
import { createTestSemiontWrapper } from '../../../test-utils';
|
|
13
13
|
|
|
14
14
|
// Mock CodeMirrorRenderer to avoid CodeMirror dependencies
|
|
@@ -63,6 +63,7 @@ const createMockProps = (overrides?: Partial<ResourceComposePageProps>): Resourc
|
|
|
63
63
|
initialLocale: 'en',
|
|
64
64
|
theme: 'light',
|
|
65
65
|
showLineNumbers: false,
|
|
66
|
+
hoverDelayMs: 0,
|
|
66
67
|
activePanel: null,
|
|
67
68
|
onSaveResource: vi.fn().mockResolvedValue(undefined),
|
|
68
69
|
onCancel: vi.fn(),
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
import { describe, it, expect, vi } from 'vitest';
|
|
8
8
|
import { render, screen, fireEvent } from '@testing-library/react';
|
|
9
9
|
import { ResourceCard } from '../components/ResourceCard';
|
|
10
|
-
import type { ResourceCardProps } from '../components/ResourceCard';
|
|
11
10
|
|
|
12
11
|
const createMockResource = (overrides?: any) => ({
|
|
13
12
|
'@context': 'https://www.w3.org/ns/anno.jsonld',
|
|
@@ -10,10 +10,12 @@ import { render, screen, fireEvent } from '@testing-library/react';
|
|
|
10
10
|
import { ResourceDiscoveryPage } from '../components/ResourceDiscoveryPage';
|
|
11
11
|
import type { ResourceDiscoveryPageProps } from '../components/ResourceDiscoveryPage';
|
|
12
12
|
import { createTestSemiontWrapper } from '../../../test-utils';
|
|
13
|
+
import { resourceId } from '@semiont/core';
|
|
14
|
+
import type { ResourceDescriptor } from '@semiont/core';
|
|
13
15
|
|
|
14
|
-
const createMockResource = (id: string, name: string, entityTypes: string[] = []) => ({
|
|
16
|
+
const createMockResource = (id: string, name: string, entityTypes: string[] = []): ResourceDescriptor => ({
|
|
15
17
|
'@context': 'https://www.w3.org/ns/anno.jsonld',
|
|
16
|
-
'@id': id,
|
|
18
|
+
'@id': resourceId(id),
|
|
17
19
|
'@type': 'schema:DigitalDocument',
|
|
18
20
|
name,
|
|
19
21
|
description: `Description for ${name}`,
|
|
@@ -31,6 +33,8 @@ const createMockProps = (overrides?: Partial<ResourceDiscoveryPageProps>): Resou
|
|
|
31
33
|
isSearching: false,
|
|
32
34
|
searchQuery: '',
|
|
33
35
|
onSearchQueryChange: vi.fn(),
|
|
36
|
+
selectedEntityType: '',
|
|
37
|
+
onSelectedEntityTypeChange: vi.fn(),
|
|
34
38
|
theme: 'light',
|
|
35
39
|
showLineNumbers: false,
|
|
36
40
|
activePanel: null,
|
|
@@ -254,65 +258,59 @@ describe('ResourceDiscoveryPage', () => {
|
|
|
254
258
|
expect(screen.getByRole('button', { name: 'Report' })).toBeInTheDocument();
|
|
255
259
|
});
|
|
256
260
|
|
|
257
|
-
it('
|
|
261
|
+
it('calls onSelectedEntityTypeChange when a filter chip is clicked', () => {
|
|
262
|
+
const onSelectedEntityTypeChange = vi.fn();
|
|
258
263
|
const props = createMockProps({
|
|
259
|
-
recentDocuments: [
|
|
260
|
-
createMockResource('1', 'Doc 1', ['Document']),
|
|
261
|
-
createMockResource('2', 'Doc 2', ['Article']),
|
|
262
|
-
createMockResource('3', 'Doc 3', ['Document']),
|
|
263
|
-
],
|
|
264
264
|
entityTypes: ['Document', 'Article'],
|
|
265
|
+
onSelectedEntityTypeChange,
|
|
265
266
|
});
|
|
266
267
|
renderWithProviders(<ResourceDiscoveryPage {...props} />);
|
|
267
268
|
|
|
268
|
-
|
|
269
|
-
expect(
|
|
270
|
-
expect(screen.getByText('Doc 2')).toBeInTheDocument();
|
|
271
|
-
expect(screen.getByText('Doc 3')).toBeInTheDocument();
|
|
272
|
-
|
|
273
|
-
// Filter by Document
|
|
274
|
-
const documentButton = screen.getByRole('button', { name: 'Document' });
|
|
275
|
-
fireEvent.click(documentButton);
|
|
269
|
+
fireEvent.click(screen.getByRole('button', { name: 'Document' }));
|
|
270
|
+
expect(onSelectedEntityTypeChange).toHaveBeenCalledWith('Document');
|
|
276
271
|
|
|
277
|
-
|
|
278
|
-
expect(
|
|
279
|
-
expect(screen.getByText('Doc 3')).toBeInTheDocument();
|
|
272
|
+
fireEvent.click(screen.getByRole('button', { name: 'Article' }));
|
|
273
|
+
expect(onSelectedEntityTypeChange).toHaveBeenCalledWith('Article');
|
|
280
274
|
});
|
|
281
275
|
|
|
282
|
-
it('shows filtered heading when
|
|
276
|
+
it('shows filtered heading when selectedEntityType prop is set', () => {
|
|
283
277
|
const props = createMockProps({
|
|
284
278
|
recentDocuments: [createMockResource('1', 'Doc 1', ['Document'])],
|
|
285
279
|
entityTypes: ['Document'],
|
|
280
|
+
selectedEntityType: 'Document',
|
|
286
281
|
});
|
|
287
282
|
renderWithProviders(<ResourceDiscoveryPage {...props} />);
|
|
288
283
|
|
|
289
|
-
const documentButton = screen.getByRole('button', { name: 'Document' });
|
|
290
|
-
fireEvent.click(documentButton);
|
|
291
|
-
|
|
292
284
|
expect(screen.getByText('Documents tagged with Document')).toBeInTheDocument();
|
|
293
285
|
});
|
|
294
286
|
|
|
295
|
-
it('
|
|
287
|
+
it('calls onSelectedEntityTypeChange with empty string when "All" is clicked', () => {
|
|
288
|
+
const onSelectedEntityTypeChange = vi.fn();
|
|
289
|
+
const props = createMockProps({
|
|
290
|
+
entityTypes: ['Document', 'Article'],
|
|
291
|
+
selectedEntityType: 'Document',
|
|
292
|
+
onSelectedEntityTypeChange,
|
|
293
|
+
});
|
|
294
|
+
renderWithProviders(<ResourceDiscoveryPage {...props} />);
|
|
295
|
+
|
|
296
|
+
fireEvent.click(screen.getByRole('button', { name: 'All' }));
|
|
297
|
+
expect(onSelectedEntityTypeChange).toHaveBeenCalledWith('');
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
it('renders the recentDocuments prop as-is without applying any post-filter', () => {
|
|
301
|
+
// The component is now controlled — backend filtering means
|
|
302
|
+
// `recentDocuments` already contains only the resources matching the
|
|
303
|
+
// active `selectedEntityType`. The component must not re-filter.
|
|
296
304
|
const props = createMockProps({
|
|
297
305
|
recentDocuments: [
|
|
298
306
|
createMockResource('1', 'Doc 1', ['Document']),
|
|
299
307
|
createMockResource('2', 'Doc 2', ['Article']),
|
|
300
308
|
],
|
|
301
309
|
entityTypes: ['Document', 'Article'],
|
|
310
|
+
selectedEntityType: 'Document',
|
|
302
311
|
});
|
|
303
312
|
renderWithProviders(<ResourceDiscoveryPage {...props} />);
|
|
304
313
|
|
|
305
|
-
// Filter by Document
|
|
306
|
-
const documentButton = screen.getByRole('button', { name: 'Document' });
|
|
307
|
-
fireEvent.click(documentButton);
|
|
308
|
-
|
|
309
|
-
expect(screen.getByText('Doc 1')).toBeInTheDocument();
|
|
310
|
-
expect(screen.queryByText('Doc 2')).not.toBeInTheDocument();
|
|
311
|
-
|
|
312
|
-
// Click All
|
|
313
|
-
const allButton = screen.getByRole('button', { name: 'All' });
|
|
314
|
-
fireEvent.click(allButton);
|
|
315
|
-
|
|
316
314
|
expect(screen.getByText('Doc 1')).toBeInTheDocument();
|
|
317
315
|
expect(screen.getByText('Doc 2')).toBeInTheDocument();
|
|
318
316
|
});
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* All dependencies passed as props - no Next.js hooks!
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import React, {
|
|
8
|
+
import React, { useCallback, useRef } from 'react';
|
|
9
9
|
import { getResourceId } from '@semiont/core';
|
|
10
10
|
import { COMMON_PANELS, type ToolbarPanelType } from '../../../state/shell-state-unit';
|
|
11
11
|
import { useRovingTabIndex } from '../../../hooks/useRovingTabIndex';
|
|
@@ -26,6 +26,11 @@ export interface ResourceDiscoveryPageProps {
|
|
|
26
26
|
searchQuery: string;
|
|
27
27
|
onSearchQueryChange: (query: string) => void;
|
|
28
28
|
|
|
29
|
+
// Controlled entity-type filter — owned by the state unit so filtering
|
|
30
|
+
// pushes to the backend rather than running as a post-fetch array filter.
|
|
31
|
+
selectedEntityType: string;
|
|
32
|
+
onSelectedEntityTypeChange: (entityType: string) => void;
|
|
33
|
+
|
|
29
34
|
// UI state props
|
|
30
35
|
theme: 'light' | 'dark';
|
|
31
36
|
showLineNumbers: boolean;
|
|
@@ -67,6 +72,8 @@ export function ResourceDiscoveryPage({
|
|
|
67
72
|
isSearching,
|
|
68
73
|
searchQuery,
|
|
69
74
|
onSearchQueryChange,
|
|
75
|
+
selectedEntityType,
|
|
76
|
+
onSelectedEntityTypeChange,
|
|
70
77
|
theme,
|
|
71
78
|
showLineNumbers,
|
|
72
79
|
activePanel,
|
|
@@ -75,17 +82,11 @@ export function ResourceDiscoveryPage({
|
|
|
75
82
|
translations: t,
|
|
76
83
|
ToolbarPanels,
|
|
77
84
|
}: ResourceDiscoveryPageProps) {
|
|
78
|
-
const [selectedEntityType, setSelectedEntityType] = useState<string>('');
|
|
79
|
-
|
|
80
85
|
const hasSearchQuery = searchQuery.trim() !== '';
|
|
81
86
|
|
|
82
87
|
// When searching, render search results; otherwise render recent.
|
|
83
|
-
|
|
84
|
-
const filteredResources =
|
|
85
|
-
? baseDocuments
|
|
86
|
-
: baseDocuments.filter((resource: ResourceDescriptor) =>
|
|
87
|
-
resource.entityTypes && resource.entityTypes.includes(selectedEntityType)
|
|
88
|
-
);
|
|
88
|
+
// Both already arrive entity-type-filtered from the backend — no post-filter here.
|
|
89
|
+
const filteredResources = hasSearchQuery ? searchDocuments : recentDocuments;
|
|
89
90
|
|
|
90
91
|
// Roving tabindex for entity type filters
|
|
91
92
|
const entityFilterRoving = useRovingTabIndex<HTMLDivElement>(
|
|
@@ -105,8 +106,8 @@ export function ResourceDiscoveryPage({
|
|
|
105
106
|
|
|
106
107
|
// Memoized callbacks
|
|
107
108
|
const handleEntityTypeFilter = useCallback((entityType: string) => {
|
|
108
|
-
|
|
109
|
-
}, []);
|
|
109
|
+
onSelectedEntityTypeChange(entityType);
|
|
110
|
+
}, [onSelectedEntityTypeChange]);
|
|
110
111
|
|
|
111
112
|
const openResource = useCallback((resource: ResourceDescriptor) => {
|
|
112
113
|
const resourceId = getResourceId(resource);
|