@semiont/react-ui 0.4.19 → 0.4.21
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 +8 -5
- package/dist/{PdfAnnotationCanvas.client-CHDCGQBR.mjs → PdfAnnotationCanvas.client-6ZGFEN2N.mjs} +9 -13
- package/dist/PdfAnnotationCanvas.client-6ZGFEN2N.mjs.map +1 -0
- package/dist/TranslationManager-9Xj3MIWQ.d.mts +16 -0
- package/dist/chunk-KEDFYI6N.mjs +7788 -0
- package/dist/chunk-KEDFYI6N.mjs.map +1 -0
- package/dist/index.d.mts +171 -1140
- package/dist/index.mjs +3263 -13644
- package/dist/index.mjs.map +1 -1
- package/dist/test-utils.d.mts +46 -21
- package/dist/test-utils.mjs +2499 -87
- package/dist/test-utils.mjs.map +1 -1
- package/package.json +1 -2
- package/src/components/AnnotateReferencesProgressWidget.tsx +21 -28
- package/src/components/CodeMirrorRenderer.tsx +9 -11
- package/src/components/StatusDisplay.tsx +42 -16
- package/src/components/Toolbar.tsx +4 -4
- package/src/components/__tests__/AnnotateReferencesProgressWidget.test.tsx +34 -20
- package/src/components/__tests__/StatusDisplay.test.tsx +47 -64
- package/src/components/__tests__/Toolbar.test.tsx +4 -4
- package/src/components/annotation/AnnotateToolbar.tsx +8 -7
- package/src/components/annotation/__tests__/AnnotateToolbar.test.tsx +31 -77
- package/src/components/annotation-popups/__tests__/JsonLdView.test.tsx +0 -1
- package/src/components/image-annotation/AnnotationOverlay.tsx +12 -13
- package/src/components/image-annotation/SvgDrawingCanvas.tsx +7 -7
- package/src/components/modals/PermissionDeniedModal.tsx +11 -11
- package/src/components/modals/ReferenceWizardModal.tsx +14 -18
- package/src/components/modals/ResourceSearchModal.tsx +10 -6
- package/src/components/modals/SearchModal.tsx +10 -6
- package/src/components/modals/SessionExpiredModal.tsx +11 -11
- package/src/components/modals/__tests__/PermissionDeniedModal.test.tsx +7 -7
- package/src/components/modals/__tests__/ResourceSearchModal.test.tsx +10 -8
- package/src/components/modals/__tests__/SearchModal.search-wiring.test.tsx +10 -7
- package/src/components/modals/__tests__/SessionExpiredModal.test.tsx +5 -5
- package/src/components/navigation/CollapsibleResourceNavigation.tsx +10 -10
- package/src/components/navigation/ObservableLink.tsx +6 -6
- package/src/components/navigation/SimpleNavigation.tsx +4 -4
- package/src/components/navigation/__tests__/ObservableLink.test.tsx +4 -4
- package/src/components/navigation/__tests__/SimpleNavigation.test.tsx +4 -4
- package/src/components/pdf-annotation/PdfAnnotationCanvas.tsx +9 -11
- package/src/components/pdf-annotation/__tests__/PdfAnnotationCanvas.test.tsx +0 -1
- package/src/components/resource/AnnotateView.tsx +7 -6
- package/src/components/resource/AnnotationHistory.tsx +9 -12
- package/src/components/resource/BrowseView.tsx +8 -7
- package/src/components/resource/ResourceViewer.tsx +17 -25
- package/src/components/resource/__tests__/AnnotationHistory.test.tsx +54 -192
- package/src/components/resource/__tests__/BrowseView.test.tsx +34 -83
- package/src/components/resource/__tests__/ResourceViewer.mode-switch.test.tsx +40 -31
- package/src/components/resource/panels/AssessmentEntry.tsx +5 -4
- package/src/components/resource/panels/AssessmentPanel.tsx +19 -15
- package/src/components/resource/panels/AssistSection.tsx +11 -13
- package/src/components/resource/panels/CollaborationPanel.tsx +29 -7
- package/src/components/resource/panels/CommentEntry.tsx +5 -4
- package/src/components/resource/panels/CommentsPanel.tsx +9 -11
- package/src/components/resource/panels/HighlightEntry.tsx +5 -4
- package/src/components/resource/panels/HighlightPanel.tsx +10 -11
- package/src/components/resource/panels/ReferenceEntry.tsx +8 -8
- package/src/components/resource/panels/ReferencesPanel.tsx +13 -12
- package/src/components/resource/panels/ResourceInfoPanel.tsx +7 -6
- package/src/components/resource/panels/TagEntry.tsx +5 -4
- package/src/components/resource/panels/TaggingPanel.tsx +10 -16
- package/src/components/resource/panels/UnifiedAnnotationsPanel.tsx +3 -2
- package/src/components/resource/panels/__tests__/AssessmentPanel.test.tsx +18 -52
- package/src/components/resource/panels/__tests__/CollaborationPanel.test.tsx +51 -20
- package/src/components/resource/panels/__tests__/CommentsPanel.test.tsx +18 -56
- package/src/components/resource/panels/__tests__/HighlightPanel.annotationProgress.test.tsx +0 -1
- package/src/components/resource/panels/__tests__/ReferenceEntry.test.tsx +4 -5
- package/src/components/resource/panels/__tests__/ReferencesPanel.observable-flow.test.tsx +153 -0
- package/src/components/resource/panels/__tests__/ReferencesPanel.test.tsx +51 -106
- package/src/components/resource/panels/__tests__/ResourceInfoPanel.test.tsx +15 -47
- package/src/components/resource/panels/__tests__/TaggingPanel.test.tsx +15 -47
- package/src/components/settings/SettingsPanel.tsx +8 -8
- package/src/components/settings/__tests__/SettingsPanel.test.tsx +12 -12
- package/src/features/admin-devops/components/AdminDevOpsPage.tsx +1 -1
- package/src/features/admin-exchange/components/AdminExchangePage.tsx +1 -1
- package/src/features/admin-exchange/components/ImportCard.tsx +2 -6
- package/src/features/admin-security/components/AdminSecurityPage.tsx +1 -1
- package/src/features/admin-users/components/AdminUsersPage.tsx +1 -1
- package/src/features/moderate-entity-tags/components/EntityTagsPage.tsx +1 -1
- package/src/features/moderate-recent/components/RecentDocumentsPage.tsx +1 -1
- package/src/features/moderate-tag-schemas/components/TagSchemasPage.tsx +1 -1
- package/src/features/moderation-linked-data/components/LinkedDataPage.tsx +1 -1
- package/src/features/resource-compose/__tests__/ResourceComposePage.test.tsx +5 -3
- package/src/features/resource-compose/components/ResourceComposePage.tsx +5 -22
- package/src/features/resource-discovery/__tests__/ResourceDiscoveryPage.test.tsx +4 -3
- package/src/features/resource-discovery/components/ResourceDiscoveryPage.tsx +1 -1
- package/src/features/resource-viewer/__tests__/ResourceViewerPage.test.tsx +38 -45
- package/src/features/resource-viewer/components/ResourceViewerPage.tsx +123 -192
- package/dist/KnowledgeBaseSessionContext-BNNunwzO.d.mts +0 -175
- package/dist/PdfAnnotationCanvas.client-CHDCGQBR.mjs.map +0 -1
- package/dist/chunk-OZICDVH7.mjs +0 -62
- package/dist/chunk-OZICDVH7.mjs.map +0 -1
- package/dist/chunk-R4CCMFJH.mjs +0 -877
- package/dist/chunk-R4CCMFJH.mjs.map +0 -1
- package/dist/chunk-VN5NY4SN.mjs +0 -200
- package/dist/chunk-VN5NY4SN.mjs.map +0 -1
- package/src/components/modals/ProposeEntitiesModal.tsx +0 -179
- package/src/components/modals/__tests__/ProposeEntitiesModal.test.tsx +0 -129
- package/src/features/resource-viewer/__tests__/AnnotationCreationPending.test.tsx +0 -323
- package/src/features/resource-viewer/__tests__/AnnotationDeletionIntegration.test.tsx +0 -245
- package/src/features/resource-viewer/__tests__/AnnotationProgressDismissal.test.tsx +0 -303
- package/src/features/resource-viewer/__tests__/BindFlowIntegration.test.tsx +0 -150
- package/src/features/resource-viewer/__tests__/DetectionFlowBug.test.tsx +0 -243
- package/src/features/resource-viewer/__tests__/DetectionFlowIntegration.test.tsx +0 -383
- package/src/features/resource-viewer/__tests__/ResourceMutations.test.tsx +0 -299
- package/src/features/resource-viewer/__tests__/ToastNotifications.test.tsx +0 -186
- package/src/features/resource-viewer/__tests__/YieldFlowIntegration.test.tsx +0 -429
- package/src/features/resource-viewer/__tests__/annotation-progress-flow.test.tsx +0 -348
package/dist/test-utils.d.mts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
1
|
+
import React__default, { ReactElement } from 'react';
|
|
2
2
|
import { RenderOptions, RenderResult } from '@testing-library/react';
|
|
3
3
|
export * from '@testing-library/react';
|
|
4
|
-
import {
|
|
5
|
-
import { T as TranslationManager, e as KnowledgeBaseSessionValue, O as OpenResourcesManager } from './KnowledgeBaseSessionContext-BNNunwzO.mjs';
|
|
4
|
+
import { SemiontBrowser } from '@semiont/api-client';
|
|
6
5
|
import { EventBus } from '@semiont/core';
|
|
6
|
+
import { T as TranslationManager } from './TranslationManager-9Xj3MIWQ.mjs';
|
|
7
7
|
export { vi } from 'vitest';
|
|
8
|
-
import 'react/jsx-runtime';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* Test utilities for @semiont/react-ui
|
|
@@ -14,21 +13,11 @@ import 'react/jsx-runtime';
|
|
|
14
13
|
* for testing, with customizable mock implementations.
|
|
15
14
|
*/
|
|
16
15
|
|
|
17
|
-
/**
|
|
18
|
-
* Default mock context value for KnowledgeBaseSessionProvider in tests.
|
|
19
|
-
* Tests override individual fields via `createMockKnowledgeBaseSession`.
|
|
20
|
-
*/
|
|
21
|
-
declare const defaultMockKnowledgeBaseSession: KnowledgeBaseSessionValue;
|
|
22
|
-
/**
|
|
23
|
-
* Construct a mock KnowledgeBaseSession context value with overrides.
|
|
24
|
-
*/
|
|
25
|
-
declare function createMockKnowledgeBaseSession(overrides?: Partial<KnowledgeBaseSessionValue>): KnowledgeBaseSessionValue;
|
|
26
16
|
/**
|
|
27
17
|
* Default mock implementations
|
|
28
18
|
*/
|
|
29
19
|
declare const defaultMocks: {
|
|
30
20
|
translationManager: TranslationManager;
|
|
31
|
-
openResourcesManager: OpenResourcesManager;
|
|
32
21
|
};
|
|
33
22
|
/**
|
|
34
23
|
* Options for renderWithProviders
|
|
@@ -36,25 +25,61 @@ declare const defaultMocks: {
|
|
|
36
25
|
interface TestProvidersOptions {
|
|
37
26
|
translationManager?: TranslationManager;
|
|
38
27
|
apiBaseUrl?: string;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
queryClient?: QueryClient;
|
|
28
|
+
/** Inject a specific SemiontBrowser (e.g. one seeded with a kbs list). */
|
|
29
|
+
browser?: SemiontBrowser;
|
|
42
30
|
}
|
|
43
31
|
interface RenderWithProvidersOptions extends TestProvidersOptions, Omit<RenderOptions, 'wrapper'> {
|
|
44
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* If true, returns the session (client) EventBus — session-scoped
|
|
34
|
+
* channels (mark:*, beckon:*, gather:*, match:*, bind:*, yield:*,
|
|
35
|
+
* browse:click, browse:reference-navigate, browse:entity-type-clicked).
|
|
36
|
+
*/
|
|
45
37
|
returnEventBus?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* If true, returns the app-scoped (SemiontBrowser) EventBus — panel:*,
|
|
40
|
+
* shell:*, tabs:*, nav:*, settings:*.
|
|
41
|
+
*/
|
|
42
|
+
returnShellBus?: boolean;
|
|
46
43
|
}
|
|
47
44
|
interface RenderWithProvidersResult extends RenderResult {
|
|
45
|
+
/** Session-scoped bus (from the fake client inside the fake browser). */
|
|
48
46
|
eventBus?: EventBus;
|
|
47
|
+
/** App-scoped bus (the fake browser's own bus). */
|
|
48
|
+
shellBus?: EventBus;
|
|
49
49
|
}
|
|
50
50
|
declare function renderWithProviders(ui: ReactElement, options?: RenderWithProvidersOptions): RenderWithProvidersResult;
|
|
51
|
+
/**
|
|
52
|
+
* Build a minimal `<SemiontProvider>` wrapper for tests that roll their
|
|
53
|
+
* own render wrapper (instead of `renderWithProviders`). The returned
|
|
54
|
+
* `eventBus` is the bus backing the fake session's client — same
|
|
55
|
+
* reference production code pokes via `session.client.emit(...)`.
|
|
56
|
+
*/
|
|
57
|
+
declare function createTestSemiontWrapper(apiBaseUrl?: string): {
|
|
58
|
+
SemiontWrapper: React__default.ComponentType<{
|
|
59
|
+
children: React__default.ReactNode;
|
|
60
|
+
}>;
|
|
61
|
+
/** Session-scoped bus (from the fake client). */
|
|
62
|
+
eventBus: EventBus;
|
|
63
|
+
/** App-scoped bus (the fake browser's own bus). */
|
|
64
|
+
shellBus: EventBus;
|
|
65
|
+
};
|
|
51
66
|
/**
|
|
52
67
|
* Create a mock translation manager with custom translations
|
|
53
68
|
*/
|
|
54
69
|
declare function createMockTranslationManager(translations: Record<string, Record<string, string>>): TranslationManager;
|
|
55
70
|
/**
|
|
56
|
-
*
|
|
71
|
+
* Build a fake SemiontBrowser with the active FrontendSessionSignals
|
|
72
|
+
* observables pre-populated. Used by SessionExpiredModal and
|
|
73
|
+
* PermissionDeniedModal tests that need to control the modal flags
|
|
74
|
+
* without driving a real session through its state machine.
|
|
57
75
|
*/
|
|
58
|
-
declare function
|
|
76
|
+
declare function createMockKnowledgeBaseSession(overrides?: {
|
|
77
|
+
permissionDeniedAt?: number | null;
|
|
78
|
+
permissionDeniedMessage?: string | null;
|
|
79
|
+
sessionExpiredAt?: number | null;
|
|
80
|
+
sessionExpiredMessage?: string | null;
|
|
81
|
+
acknowledgePermissionDenied?: () => void;
|
|
82
|
+
acknowledgeSessionExpired?: () => void;
|
|
83
|
+
}): SemiontBrowser;
|
|
59
84
|
|
|
60
|
-
export { type RenderWithProvidersOptions, type RenderWithProvidersResult, type TestProvidersOptions, createMockKnowledgeBaseSession,
|
|
85
|
+
export { type RenderWithProvidersOptions, type RenderWithProvidersResult, type TestProvidersOptions, createMockKnowledgeBaseSession, createMockTranslationManager, createTestSemiontWrapper, defaultMocks, renderWithProviders };
|