@semiont/react-ui 0.4.16 → 0.4.18

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/index.d.mts CHANGED
@@ -11,9 +11,9 @@ import { SemiontApiClient, ValidationResult, TokenRefresher } from '@semiont/api
11
11
  import * as _codemirror_state from '@codemirror/state';
12
12
  import { HighlightStyle } from '@codemirror/language';
13
13
  import { WidgetType } from '@codemirror/view';
14
+ import { Observable } from 'rxjs';
14
15
  import { TagSchema } from '@semiont/ontology';
15
16
  export { TAG_SCHEMAS, TagCategory, TagSchema, getAllTagSchemas, getSchemaCategory as getTagCategory, getTagSchema, getTagSchemasByDomain, isValidCategory } from '@semiont/ontology';
16
- import { Observable } from 'rxjs';
17
17
 
18
18
  type Annotation$m = components['schemas']['Annotation'];
19
19
  /**
@@ -395,14 +395,6 @@ declare function useResources(): {
395
395
  token: string;
396
396
  }, Error>;
397
397
  };
398
- search: {
399
- useQuery: (query: string, limit: number) => _tanstack_react_query.UseQueryResult<{
400
- resources: _semiont_core.components["schemas"]["ResourceDescriptor"][];
401
- total: number;
402
- offset: number;
403
- limit: number;
404
- }, Error>;
405
- };
406
398
  create: {
407
399
  useMutation: () => _tanstack_react_query.UseMutationResult<{
408
400
  resourceId: string;
@@ -877,10 +869,6 @@ declare const QUERY_KEYS: {
877
869
  }];
878
870
  detail: (id: ResourceId) => readonly ["resources", ResourceId];
879
871
  byToken: (token: string) => readonly ["resources", "by-token", string];
880
- search: (query: string, limit: number) => readonly ["resources", "search", {
881
- readonly query: string;
882
- readonly limit: number;
883
- }];
884
872
  events: (id: ResourceId) => readonly ["resources", ResourceId, "events"];
885
873
  annotations: (id: ResourceId) => readonly ["resources", ResourceId, "annotations"];
886
874
  referencedBy: (id: ResourceId) => readonly ["resources", ResourceId, "referenced-by"];
@@ -905,6 +893,45 @@ declare const QUERY_KEYS: {
905
893
  };
906
894
  };
907
895
 
896
+ /**
897
+ * createSearchPipeline
898
+ *
899
+ * A debounced-search RxJS pipeline factory. Combines an input Subject with a
900
+ * downstream fetch function and emits typed `{ results, isSearching }` state.
901
+ *
902
+ * Designed to be created once per component instance via React's
903
+ * `useState(() => createSearchPipeline(...))` lazy initializer, then consumed
904
+ * via `useObservable(pipeline.state$)`. The pipeline holds no React state and
905
+ * has no React imports — it's pure RxJS, unit-testable without a renderer.
906
+ *
907
+ * The fetch function is expected to return `Observable<T[] | undefined>`,
908
+ * matching the cache-miss-then-data shape of `BrowseNamespace` Observables:
909
+ * `undefined` means "fetch in flight, no value yet"; an array means "data
910
+ * available (possibly empty)".
911
+ */
912
+
913
+ interface SearchState<T> {
914
+ results: T[];
915
+ isSearching: boolean;
916
+ }
917
+ interface SearchPipeline<T> {
918
+ /** Latest query string. Bind to a controlled input via `useObservable`. */
919
+ query$: Observable<string>;
920
+ /** Latest search state — results plus a loading flag. */
921
+ state$: Observable<SearchState<T>>;
922
+ /** Push a new query value. Triggers the debounced fetch. */
923
+ setQuery(value: string): void;
924
+ /** Tear down the input Subject. Call from `useEffect` cleanup. */
925
+ dispose(): void;
926
+ }
927
+ interface SearchPipelineOptions {
928
+ /** Milliseconds to wait after the last keystroke before fetching. Default 250. */
929
+ debounceMs?: number;
930
+ /** Initial query value. Useful for modals that open with a pre-filled term. */
931
+ initialQuery?: string;
932
+ }
933
+ declare function createSearchPipeline<T>(fetch: (query: string) => Observable<T[] | undefined>, options?: SearchPipelineOptions): SearchPipeline<T>;
934
+
908
935
  /**
909
936
  * Annotation overlay: decouples annotation highlighting from markdown rendering.
910
937
  *
@@ -3924,6 +3951,8 @@ interface ResourceDiscoveryPageProps {
3924
3951
  entityTypes: string[];
3925
3952
  isLoadingRecent: boolean;
3926
3953
  isSearching: boolean;
3954
+ searchQuery: string;
3955
+ onSearchQueryChange: (query: string) => void;
3927
3956
  theme: 'light' | 'dark';
3928
3957
  showLineNumbers: boolean;
3929
3958
  activePanel: string | null;
@@ -3949,7 +3978,7 @@ interface ResourceDiscoveryPageProps {
3949
3978
  };
3950
3979
  ToolbarPanels: React__default.ComponentType<any>;
3951
3980
  }
3952
- declare function ResourceDiscoveryPage({ recentDocuments, searchDocuments, entityTypes, isLoadingRecent, isSearching, theme, showLineNumbers, activePanel, onNavigateToResource, onNavigateToCompose, translations: t, ToolbarPanels, }: ResourceDiscoveryPageProps): react_jsx_runtime.JSX.Element;
3981
+ declare function ResourceDiscoveryPage({ recentDocuments, searchDocuments, entityTypes, isLoadingRecent, isSearching, searchQuery, onSearchQueryChange, theme, showLineNumbers, activePanel, onNavigateToResource, onNavigateToCompose, translations: t, ToolbarPanels, }: ResourceDiscoveryPageProps): react_jsx_runtime.JSX.Element;
3953
3982
 
3954
3983
  type ResourceDescriptor = components['schemas']['ResourceDescriptor'];
3955
3984
  interface ResourceCardProps {
@@ -4242,4 +4271,4 @@ declare function useObservable<T>(obs$: Observable<T>): T | undefined;
4242
4271
  */
4243
4272
  declare function useStoreTokenSync(): void;
4244
4273
 
4245
- export { ANNOTATORS, AVAILABLE_LOCALES, AdminDevOpsPage, type AdminDevOpsPageProps, AdminExchangePage, type AdminExchangePageProps, type AdminExchangePageTranslations, AdminSecurityPage, type AdminSecurityPageProps, type AdminUser, type AdminUserStats, AdminUsersPage, type AdminUsersPageProps, AnnotateReferencesProgressWidget, 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, AssistSection, AsyncErrorBoundary, AuthErrorDisplay, type AuthErrorDisplayProps, AuthTokenProvider, type AuthTokenProviderProps, type AvailableLocale, type BeckonFlowState, type BorderRadiusToken, BrowseView, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, COMMON_PANELS, type CacheManager, CacheProvider, type CacheProviderProps, type ClickAction, CodeMirrorRenderer, CollaborationPanel, CollapsibleResourceNavigation, type CollapsibleResourceNavigationProps, type ColorToken, CommentEntry, CommentsPanel, ComposeLoadingState, type ComposeLoadingStateProps, type ContextGatherFlowConfig, type ContextGatherFlowState, type CreateAnnotationParams, type CreateConfig, type DeleteAnnotationParams, type DetectionConfig, type DevOpsFeature, type DrawingMode, EntityTagsPage, type EntityTagsPageProps, EntityTypeBadges, ErrorBoundary, EventBusProvider, type EventBusProviderProps, ExportCard, type ExportCardProps, type ExportCardTranslations, Footer, HOVER_DELAY_MS, HighlightEntry, HighlightPanel, HistoryEvent, type HoverEmitterProps, type HoverHandlers, ImageURLSchema, ImageViewer, ImportCard, type ImportCardProps, type ImportCardTranslations, type ImportPreview, ImportProgress, type ImportProgressProps, type ImportProgressTranslations, JsonLdPanel, JsonLdView, KbSessionStatus, type KeyboardShortcut, KeyboardShortcutsHelpModal, KnowledgeBase, LeftSidebar, type LinkComponentProps, LinkedDataPage, type LinkedDataPageProps, type LinkedDataPageTranslations, LiveRegionProvider, type MarkFlowState, type Motivation$8 as Motivation, type NavigationItem, NavigationMenu, type NavigationMenuHelper, type NavigationProps, type OAuthProvider, type OAuthUser, OAuthUserSchema, ObservableLink, type ObservableLinkProps, OpenResource, OpenResourcesManager, OpenResourcesProvider, type OverlayAnnotation, PageLayout, type PanelBrowseState, PanelHeader, PermissionDeniedModal, PopupContainer, PopupHeader, ProposeEntitiesModal, ProtectedErrorBoundary, QUERY_KEYS, RESOURCE_PANELS, RecentDocumentsPage, type RecentDocumentsPageProps, ReferenceEntry, ReferenceResolutionWidget, ReferenceWizardModal, type ReferenceWizardModalProps, ReferencesPanel, ResizeHandle, 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, SessionExpiredModal, SessionExpiryBanner, 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 StoredSession, 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, type YieldFlowState, applyHighlights, buildSourceToRenderedMap, buildTextNodeIndex, buttonStyles, clearHighlights, createHoverHandlers, cssVariables, defaultProtocol, faviconPaths, formatTime, generateCSSVariables, getKbSessionStatus, getResourceIcon, getSelectedShapeForSelectorType, getSelectorType, getShortcutDisplay, getSupportedShapes, hideWidgetPreview, isShapeSupported, jsonLightHighlightStyle, jsonLightTheme, kbBackendUrl, notifyPermissionDenied, notifySessionExpired, resolveAnnotationRanges, sanitizeImageURL, saveSelectedShapeForSelectorType, showWidgetPreview, supportsDetection, toOverlayAnnotations, tokens, useAdmin, useAnnotationManager, useAnnotations, useApiClient, useAttentionStream, useAuthApi, useAuthToken, useBeckonFlow, useBindFlow, useCacheManager, useContextGatherFlow, useDebounce, useDebouncedCallback, useDocumentAnnouncements, useDoubleKeyPress, useDropdown, useEntityTypes, useEventBus, useEventSubscription, useEventSubscriptions, useFormAnnouncements, useGlobalEvents, useHealth, useHoverDelay, useHoverEmitter, useIsTyping, useKeyboardShortcuts, useLanguageChangeAnnouncements, useLineNumbers, useLiveRegion, useLoadingState, useLocalStorage, useMarkFlow, useModeration, useObservable, useObservableExternalNavigation, useObservableRouter, useOpenResources, usePanelBrowse, usePanelWidth, usePreloadTranslations, useResourceAnnotations, useResourceContent, useResourceEvents, useResourceLoadingAnnouncements, useResources, useRovingTabIndex, useSearchAnnouncements, useSessionExpiry, useStoreTokenSync, useTheme, useToast, useTranslations, useYieldFlow };
4274
+ export { ANNOTATORS, AVAILABLE_LOCALES, AdminDevOpsPage, type AdminDevOpsPageProps, AdminExchangePage, type AdminExchangePageProps, type AdminExchangePageTranslations, AdminSecurityPage, type AdminSecurityPageProps, type AdminUser, type AdminUserStats, AdminUsersPage, type AdminUsersPageProps, AnnotateReferencesProgressWidget, 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, AssistSection, AsyncErrorBoundary, AuthErrorDisplay, type AuthErrorDisplayProps, AuthTokenProvider, type AuthTokenProviderProps, type AvailableLocale, type BeckonFlowState, type BorderRadiusToken, BrowseView, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, COMMON_PANELS, type CacheManager, CacheProvider, type CacheProviderProps, type ClickAction, CodeMirrorRenderer, CollaborationPanel, CollapsibleResourceNavigation, type CollapsibleResourceNavigationProps, type ColorToken, CommentEntry, CommentsPanel, ComposeLoadingState, type ComposeLoadingStateProps, type ContextGatherFlowConfig, type ContextGatherFlowState, type CreateAnnotationParams, type CreateConfig, type DeleteAnnotationParams, type DetectionConfig, type DevOpsFeature, type DrawingMode, EntityTagsPage, type EntityTagsPageProps, EntityTypeBadges, ErrorBoundary, EventBusProvider, type EventBusProviderProps, ExportCard, type ExportCardProps, type ExportCardTranslations, Footer, HOVER_DELAY_MS, HighlightEntry, HighlightPanel, HistoryEvent, type HoverEmitterProps, type HoverHandlers, ImageURLSchema, ImageViewer, ImportCard, type ImportCardProps, type ImportCardTranslations, type ImportPreview, ImportProgress, type ImportProgressProps, type ImportProgressTranslations, JsonLdPanel, JsonLdView, KbSessionStatus, type KeyboardShortcut, KeyboardShortcutsHelpModal, KnowledgeBase, LeftSidebar, type LinkComponentProps, LinkedDataPage, type LinkedDataPageProps, type LinkedDataPageTranslations, LiveRegionProvider, type MarkFlowState, type Motivation$8 as Motivation, type NavigationItem, NavigationMenu, type NavigationMenuHelper, type NavigationProps, type OAuthProvider, type OAuthUser, OAuthUserSchema, ObservableLink, type ObservableLinkProps, OpenResource, OpenResourcesManager, OpenResourcesProvider, type OverlayAnnotation, PageLayout, type PanelBrowseState, PanelHeader, PermissionDeniedModal, PopupContainer, PopupHeader, ProposeEntitiesModal, ProtectedErrorBoundary, QUERY_KEYS, RESOURCE_PANELS, RecentDocumentsPage, type RecentDocumentsPageProps, ReferenceEntry, ReferenceResolutionWidget, ReferenceWizardModal, type ReferenceWizardModalProps, ReferencesPanel, ResizeHandle, 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, type SearchPipeline, type SearchPipelineOptions, type SearchState, SelectedTextDisplay, type SelectionMotivation, type SelectorType, SemiontBranding, SemiontFavicon, type SemiontResource$4 as SemiontResource, SessionExpiredModal, SessionExpiryBanner, 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 StoredSession, 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, type YieldFlowState, applyHighlights, buildSourceToRenderedMap, buildTextNodeIndex, buttonStyles, clearHighlights, createHoverHandlers, createSearchPipeline, cssVariables, defaultProtocol, faviconPaths, formatTime, generateCSSVariables, getKbSessionStatus, getResourceIcon, getSelectedShapeForSelectorType, getSelectorType, getShortcutDisplay, getSupportedShapes, hideWidgetPreview, isShapeSupported, jsonLightHighlightStyle, jsonLightTheme, kbBackendUrl, notifyPermissionDenied, notifySessionExpired, resolveAnnotationRanges, sanitizeImageURL, saveSelectedShapeForSelectorType, showWidgetPreview, supportsDetection, toOverlayAnnotations, tokens, useAdmin, useAnnotationManager, useAnnotations, useApiClient, useAttentionStream, useAuthApi, useAuthToken, useBeckonFlow, useBindFlow, useCacheManager, useContextGatherFlow, useDebounce, useDebouncedCallback, useDocumentAnnouncements, useDoubleKeyPress, useDropdown, useEntityTypes, useEventBus, useEventSubscription, useEventSubscriptions, useFormAnnouncements, useGlobalEvents, useHealth, useHoverDelay, useHoverEmitter, useIsTyping, useKeyboardShortcuts, useLanguageChangeAnnouncements, useLineNumbers, useLiveRegion, useLoadingState, useLocalStorage, useMarkFlow, useModeration, useObservable, useObservableExternalNavigation, useObservableRouter, useOpenResources, usePanelBrowse, usePanelWidth, usePreloadTranslations, useResourceAnnotations, useResourceContent, useResourceEvents, useResourceLoadingAnnouncements, useResources, useRovingTabIndex, useSearchAnnouncements, useSessionExpiry, useStoreTokenSync, useTheme, useToast, useTranslations, useYieldFlow };