@semiont/react-ui 0.2.33-build.81 → 0.2.33-build.83
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/dist/{PdfAnnotationCanvas.client-RAJRPQLU.mjs → PdfAnnotationCanvas.client-FGV33CWN.mjs} +9 -14
- package/dist/PdfAnnotationCanvas.client-FGV33CWN.mjs.map +1 -0
- package/dist/chunk-FC6SGLLT.mjs +141 -0
- package/dist/chunk-FC6SGLLT.mjs.map +1 -0
- package/dist/chunk-XS27QKGP.mjs +55 -0
- package/dist/chunk-XS27QKGP.mjs.map +1 -0
- package/dist/{chunk-QB52Q7EQ.mjs → chunk-YPYLOBA2.mjs} +31 -81
- package/dist/chunk-YPYLOBA2.mjs.map +1 -0
- package/dist/index.css +16 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +70 -28
- package/dist/index.mjs +564 -621
- package/dist/index.mjs.map +1 -1
- package/dist/test-utils.mjs +5 -3
- package/dist/test-utils.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/CodeMirrorRenderer.tsx +8 -8
- package/src/components/annotation/AnnotateToolbar.tsx +4 -1
- package/src/components/image-annotation/AnnotationOverlay.tsx +6 -17
- package/src/components/pdf-annotation/PdfAnnotationCanvas.tsx +6 -17
- package/src/components/resource/BrowseView.tsx +8 -8
- package/src/components/resource/__tests__/BrowseView.test.tsx +20 -12
- package/src/components/resource/panels/AssessmentEntry.tsx +3 -6
- package/src/components/resource/panels/CommentEntry.tsx +3 -6
- package/src/components/resource/panels/HighlightEntry.tsx +3 -6
- package/src/components/resource/panels/ReferenceEntry.tsx +3 -6
- package/src/components/resource/panels/TagEntry.tsx +3 -6
- package/src/components/resource/panels/TaggingPanel.tsx +5 -0
- package/src/components/resource/panels/__tests__/CommentEntry.test.tsx +42 -4
- package/src/components/resource/panels/__tests__/TaggingPanel.test.tsx +44 -0
- package/src/components/toolbar/Toolbar.css +20 -0
- package/src/features/resource-viewer/__tests__/AnnotationCreationPending.test.tsx +312 -0
- package/src/features/resource-viewer/__tests__/GenerationFlowIntegration.test.tsx +4 -8
- package/src/features/resource-viewer/__tests__/ResolutionFlowIntegration.test.tsx +266 -0
- package/src/features/resource-viewer/components/ResourceViewerPage.tsx +5 -3
- package/dist/PdfAnnotationCanvas.client-RAJRPQLU.mjs.map +0 -1
- package/dist/chunk-QB52Q7EQ.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1482,27 +1482,6 @@ declare function CacheProvider({ cacheManager, children }: CacheProviderProps):
|
|
|
1482
1482
|
*/
|
|
1483
1483
|
declare function useCacheManager(): CacheManager;
|
|
1484
1484
|
|
|
1485
|
-
interface ResolutionFlowConfig {
|
|
1486
|
-
client: SemiontApiClient;
|
|
1487
|
-
resourceUri: ResourceUri;
|
|
1488
|
-
}
|
|
1489
|
-
interface ResolutionFlowState {
|
|
1490
|
-
searchModalOpen: boolean;
|
|
1491
|
-
pendingReferenceId: string | null;
|
|
1492
|
-
onCloseSearchModal: () => void;
|
|
1493
|
-
}
|
|
1494
|
-
/**
|
|
1495
|
-
* Hook that handles the Resolution capability: resolving reference annotations
|
|
1496
|
-
* to existing resources (search) or new resources (manual creation).
|
|
1497
|
-
*
|
|
1498
|
-
* Handles: annotation:update-body, reference:link, resolution:search-requested
|
|
1499
|
-
*
|
|
1500
|
-
* @param emitter - The mitt event bus instance
|
|
1501
|
-
* @param config - Configuration including API client and resource URI
|
|
1502
|
-
* @returns Resolution flow state (search modal open state and close handler)
|
|
1503
|
-
*/
|
|
1504
|
-
declare function useResolutionFlow(emitter: Emitter<EventMap>, config: ResolutionFlowConfig): ResolutionFlowState;
|
|
1505
|
-
|
|
1506
1485
|
/**
|
|
1507
1486
|
* Subscribe to an event bus event with automatic cleanup.
|
|
1508
1487
|
*
|
|
@@ -3686,13 +3665,60 @@ interface ResourceViewerPageProps {
|
|
|
3686
3665
|
*/
|
|
3687
3666
|
declare function ResourceViewerPage({ resource, rUri, locale, cacheManager, Link, routes, ToolbarPanels, SearchResourcesModal, GenerationConfigModal, refetchDocument, }: ResourceViewerPageProps): react_jsx_runtime.JSX.Element;
|
|
3688
3667
|
|
|
3668
|
+
/**
|
|
3669
|
+
* useAttentionFlow — Annotation attention / pointer coordination hook
|
|
3670
|
+
*
|
|
3671
|
+
* Manages which annotation currently has the user's attention:
|
|
3672
|
+
* - Hover state (hoveredAnnotationId)
|
|
3673
|
+
* - Hover → sparkle relay
|
|
3674
|
+
* - Click → focus relay
|
|
3675
|
+
*
|
|
3676
|
+
* Follows react-rxjs-guide.md Layer 2 pattern: Hook bridge that
|
|
3677
|
+
* subscribes to events and pushes values into React state.
|
|
3678
|
+
*
|
|
3679
|
+
* Note: annotation:sparkle visual effect (triggerSparkleAnimation) is owned by
|
|
3680
|
+
* ResourceViewerPage, which subscribes to annotation:sparkle and delegates to
|
|
3681
|
+
* ResourceAnnotationsContext. This hook emits the signal; it does not render the effect.
|
|
3682
|
+
*
|
|
3683
|
+
* @subscribes annotation:hover - Sets hoveredAnnotationId; emits annotation:sparkle
|
|
3684
|
+
* @subscribes annotation:click - Emits annotation:focus (attention relay only)
|
|
3685
|
+
* @emits annotation:sparkle
|
|
3686
|
+
* @emits annotation:focus
|
|
3687
|
+
*/
|
|
3688
|
+
interface AttentionFlowState {
|
|
3689
|
+
hoveredAnnotationId: string | null;
|
|
3690
|
+
}
|
|
3691
|
+
declare function useAttentionFlow(): AttentionFlowState;
|
|
3692
|
+
/** Milliseconds the mouse must dwell before annotation:hover is emitted. */
|
|
3693
|
+
declare const HOVER_DELAY_MS = 150;
|
|
3694
|
+
type EmitHover = (annotationId: string | null) => void;
|
|
3695
|
+
interface HoverHandlers {
|
|
3696
|
+
/** Call with the annotation ID when the mouse enters an annotation element. */
|
|
3697
|
+
handleMouseEnter: (annotationId: string) => void;
|
|
3698
|
+
/** Call when the mouse leaves the annotation element. */
|
|
3699
|
+
handleMouseLeave: () => void;
|
|
3700
|
+
/** Cancel any pending timer — call in the useEffect cleanup. */
|
|
3701
|
+
cleanup: () => void;
|
|
3702
|
+
}
|
|
3703
|
+
declare function createHoverHandlers(emit: EmitHover): HoverHandlers;
|
|
3704
|
+
interface HoverEmitterProps {
|
|
3705
|
+
onMouseEnter: () => void;
|
|
3706
|
+
onMouseLeave: () => void;
|
|
3707
|
+
}
|
|
3708
|
+
/**
|
|
3709
|
+
* React hook that returns onMouseEnter / onMouseLeave props for a single
|
|
3710
|
+
* annotation entry element.
|
|
3711
|
+
*
|
|
3712
|
+
* @param annotationId - The ID of the annotation this element represents.
|
|
3713
|
+
*/
|
|
3714
|
+
declare function useHoverEmitter(annotationId: string): HoverEmitterProps;
|
|
3715
|
+
|
|
3689
3716
|
/**
|
|
3690
3717
|
* useDetectionFlow - Detection state management hook
|
|
3691
3718
|
*
|
|
3692
3719
|
* Manages all annotation detection (manual and AI-driven):
|
|
3693
3720
|
* - Pending annotation state (user selected text, waiting for confirmation)
|
|
3694
3721
|
* - Selection events → pending annotation conversion
|
|
3695
|
-
* - Annotation interaction (hover, click)
|
|
3696
3722
|
* - Annotation request routing to appropriate panel
|
|
3697
3723
|
* - Tracking currently detecting motivation (AI-driven detection)
|
|
3698
3724
|
* - Detection progress updates from SSE
|
|
@@ -3715,7 +3741,6 @@ interface PendingAnnotation {
|
|
|
3715
3741
|
}
|
|
3716
3742
|
interface DetectionFlowState {
|
|
3717
3743
|
pendingAnnotation: PendingAnnotation | null;
|
|
3718
|
-
hoveredAnnotationId: string | null;
|
|
3719
3744
|
detectingMotivation: Motivation$9 | null;
|
|
3720
3745
|
detectionProgress: DetectionProgress | null;
|
|
3721
3746
|
detectionStreamRef: React.MutableRefObject<AbortController | null>;
|
|
@@ -3725,8 +3750,6 @@ interface DetectionFlowState {
|
|
|
3725
3750
|
*
|
|
3726
3751
|
* @param rUri - Resource URI being detected
|
|
3727
3752
|
* @emits panel:open - Open the annotations panel when annotation is requested
|
|
3728
|
-
* @emits annotation:sparkle - Trigger sparkle animation on hovered annotation
|
|
3729
|
-
* @emits annotation:focus - Focus/scroll to clicked annotation
|
|
3730
3753
|
* @emits annotation:created - Annotation successfully created
|
|
3731
3754
|
* @emits annotation:create-failed - Annotation creation failed
|
|
3732
3755
|
* @emits annotation:deleted - Annotation successfully deleted
|
|
@@ -3743,8 +3766,6 @@ interface DetectionFlowState {
|
|
|
3743
3766
|
* @subscribes selection:assessment-requested - User selected text for an assessment
|
|
3744
3767
|
* @subscribes selection:reference-requested - User selected text for a reference
|
|
3745
3768
|
* @subscribes annotation:cancel-pending - Cancel pending annotation creation
|
|
3746
|
-
* @subscribes annotation:hover - Annotation hover state change
|
|
3747
|
-
* @subscribes annotation:click - Annotation clicked
|
|
3748
3769
|
* @subscribes detection:start - Trigger AI detection SSE stream
|
|
3749
3770
|
* @subscribes job:cancel-requested - Cancels in-flight detection stream (detection half only)
|
|
3750
3771
|
* @subscribes detection:progress - Progress update during detection
|
|
@@ -3869,4 +3890,25 @@ interface ContextRetrievalFlowState {
|
|
|
3869
3890
|
}
|
|
3870
3891
|
declare function useContextRetrievalFlow(emitter: Emitter<EventMap>, config: ContextRetrievalFlowConfig): ContextRetrievalFlowState;
|
|
3871
3892
|
|
|
3872
|
-
|
|
3893
|
+
interface ResolutionFlowState {
|
|
3894
|
+
searchModalOpen: boolean;
|
|
3895
|
+
pendingReferenceId: string | null;
|
|
3896
|
+
onCloseSearchModal: () => void;
|
|
3897
|
+
}
|
|
3898
|
+
/**
|
|
3899
|
+
* Hook that handles the Resolution capability: resolving reference annotations
|
|
3900
|
+
* to existing resources (search) or new resources (manual creation).
|
|
3901
|
+
*
|
|
3902
|
+
* @param rUri - Resource URI being viewed
|
|
3903
|
+
* @returns Resolution flow state (search modal open state and close handler)
|
|
3904
|
+
*
|
|
3905
|
+
* @emits annotation:body-updated - Annotation body successfully updated
|
|
3906
|
+
* @emits annotation:body-update-failed - Annotation body update failed
|
|
3907
|
+
* @emits resolution:search-requested - Search modal requested
|
|
3908
|
+
* @subscribes annotation:update-body - Update annotation body via API
|
|
3909
|
+
* @subscribes reference:link - User clicked "Link Document"; opens search modal
|
|
3910
|
+
* @subscribes resolution:search-requested - Opens search modal with pending reference
|
|
3911
|
+
*/
|
|
3912
|
+
declare function useResolutionFlow(rUri: ResourceUri): ResolutionFlowState;
|
|
3913
|
+
|
|
3914
|
+
export { ANNOTATORS, AUTH_EVENTS, AVAILABLE_LOCALES, AdminDevOpsPage, type AdminDevOpsPageProps, AdminSecurityPage, type AdminSecurityPageProps, type AdminUser, type AdminUserStats, AdminUsersPage, type AdminUsersPageProps, AnnotateToolbar, AnnotateView, type Annotation$k as Annotation, type AnnotationConfig, type AnnotationCreationHandler, type AnnotationHandlers, AnnotationHistory, type AnnotationManager, AnnotationOverlay, AnnotationProvider, type AnnotationProviderProps, type AnnotationUIState, type AnnotationsCollection, type Annotator, ApiClientProvider, type ApiClientProviderProps, AssessmentEntry, AssessmentPanel, AsyncErrorBoundary, type AttentionFlowState, AuthErrorDisplay, type AuthErrorDisplayProps, type AuthEventDetail, type AuthEventType, AuthTokenProvider, type AuthTokenProviderProps, type AvailableLocale, type BorderRadiusToken, BrowseView, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type CacheManager, CacheProvider, type CacheProviderProps, type ClickAction, CodeMirrorRenderer, CollaborationPanel, CollapsibleResourceNavigation, type CollapsibleResourceNavigationProps, type ColorToken, CommentEntry, CommentsPanel, ComposeLoadingState, type ComposeLoadingStateProps, type ContextRetrievalFlowConfig, type ContextRetrievalFlowState, type CreateAnnotationParams, type CreateConfig, type DeleteAnnotationParams, DetectSection, type DetectionConfig, type DetectionFlowState, DetectionProgress, DetectionProgressWidget, type DevOpsFeature, type DrawingMode, EntityTagsPage, type EntityTagsPageProps, EntityTypeBadges, ErrorBoundary, EventBus, EventMap, Footer, type GenerationFlowState, type GenerationOptions, GenerationProgress, HOVER_DELAY_MS, HighlightEntry, HighlightPanel, HistoryEvent, type HoverEmitterProps, type HoverHandlers, ImageURLSchema, ImageViewer, JsonLdPanel, JsonLdView, type KeyboardShortcut, KeyboardShortcutsHelpModal, LeftSidebar, type LinkComponentProps, LiveRegionProvider, type Motivation$8 as Motivation, type NavigationItem, NavigationMenu, type NavigationMenuHelper, type NavigationProps, type OAuthProvider, type OAuthUser, OAuthUserSchema, ObservableLink, type ObservableLinkProps, type OpenResource, OpenResourcesManager, OpenResourcesProvider, PageLayout, PanelHeader, type PanelNavigationState, PopupContainer, PopupHeader, type PreparedAnnotation, ProposeEntitiesModal, QUERY_KEYS, RecentDocumentsPage, type RecentDocumentsPageProps, ReferenceEntry, ReferenceResolutionWidget, ReferencesPanel, ResizeHandle, type ResolutionFlowState, type ResolvedTheme, ResourceAnnotationsProvider, ResourceCard, type ResourceCardProps, ResourceComposePage, type ResourceComposePageProps, ResourceDiscoveryPage, type ResourceDiscoveryPageProps, ResourceErrorState, type ResourceErrorStateProps, ResourceInfoPanel, ResourceLoadingState, ResourceSearchModal, type ResourceSearchModalProps, ResourceTagsInline, ResourceViewer, ResourceViewerPage, type ResourceViewerPageProps, type RouteBuilder, type SaveResourceParams, SearchModal, type SearchModalProps, SelectedTextDisplay, type SelectionMotivation, type SelectorType, SemiontBranding, SemiontFavicon, type SemiontResource$4 as SemiontResource, SessionExpiryBanner, SessionManager, SessionProvider, SessionTimer, SettingsPanel, type ShadowToken, type ShapeType, SignInForm, type SignInFormProps, SignUpForm, type SignUpFormProps, SimpleNavigation, type SimpleNavigationItem, type SimpleNavigationProps, SkipLinks, SortableResourceTab, type SortableResourceTabProps, type SpacingToken, StatisticsPanel, StatusDisplay, type StreamStatus, SvgDrawingCanvas, TagEntry, TagSchemasPage, type TagSchemasPageProps, TaggingPanel, type TextSegment, type TextSelection, type Theme, ThemeProvider, ToastContainer, type ToastMessage, ToastProvider, type ToastType, Toolbar, type ToolbarPanelType, type TransitionToken, TranslationManager, TranslationProvider, type TranslationProviderProps, type TypographyToken, type UICreateAnnotationParams, UnifiedAnnotationsPanel, UnifiedHeader, type UseResourceContentResult, UserMenuSkeleton, WelcomePage, type WelcomePageProps, buttonStyles, createCancelDetectionHandler, createDetectionHandler, createHoverHandlers, cssVariables, dispatch401Error, dispatch403Error, dispatchAuthEvent, faviconPaths, formatTime, generateCSSVariables, getResourceIcon, getSelectedShapeForSelectorType, getSelectorType, getShortcutDisplay, getSupportedShapes, isShapeSupported, jsonLightHighlightStyle, jsonLightTheme, onAuthEvent, rehypeRenderAnnotations, remarkAnnotations, sanitizeImageURL, saveSelectedShapeForSelectorType, supportsDetection, tokens, useAdmin, useAnnotationManager, useAnnotations, useApiClient, useAttentionFlow, useAuthApi, useAuthToken, useCacheManager, useContextRetrievalFlow, useDebounce, useDebouncedCallback, useDetectionFlow, useDocumentAnnouncements, useDoubleKeyPress, useDropdown, useEntityTypes, useEventSubscription, useEventSubscriptions, useFormAnnouncements, useGenerationFlow, useHealth, useHoverEmitter, useIsTyping, useKeyboardShortcuts, useLanguageChangeAnnouncements, useLineNumbers, useLiveRegion, useLoadingState, useLocalStorage, useObservableExternalNavigation, useObservableRouter, useOpenResources, usePanelNavigation, usePanelWidth, usePreloadTranslations, useResolutionFlow, useResourceAnnotations, useResourceContent, useResourceEvents, useResourceLoadingAnnouncements, useResources, useRovingTabIndex, useSearchAnnouncements, useSessionContext, useSessionExpiry, useTheme, useToast, useTranslations };
|