@semiont/react-ui 0.5.10 → 0.5.12
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 +1 -1
- package/dist/{PdfAnnotationCanvas.client-P37SXBWQ.js → PdfAnnotationCanvas.client-75GY2EDR.js} +15 -6
- package/dist/PdfAnnotationCanvas.client-75GY2EDR.js.map +1 -0
- package/dist/{chunk-5LFFAVDI.js → chunk-PFUXQPWJ.js} +96 -96
- package/dist/{chunk-5LFFAVDI.js.map → chunk-PFUXQPWJ.js.map} +1 -1
- package/dist/{chunk-O2MD7TGE.js → chunk-VXASXU4K.js} +10 -2
- package/dist/chunk-VXASXU4K.js.map +1 -0
- package/dist/index.css +150 -112
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +334 -48
- package/dist/index.js +2494 -2201
- package/dist/index.js.map +1 -1
- package/dist/test-utils.d.ts +5 -1
- package/dist/test-utils.js +10 -4
- package/dist/test-utils.js.map +1 -1
- package/package.json +7 -7
- package/src/components/ResourceTagsInline.tsx +94 -11
- package/src/components/StatusDisplay.css +36 -0
- package/src/components/__tests__/ResourceTagsInline.test.tsx +101 -3
- package/src/components/annotation/AnnotateToolbar.tsx +53 -28
- package/src/components/annotation/__tests__/AnnotateToolbar.display.test.tsx +76 -0
- package/src/components/annotation/__tests__/AnnotateToolbar.test.tsx +124 -360
- package/src/components/image-annotation/AnnotationOverlay.tsx +6 -6
- package/src/components/image-annotation/SvgDrawingCanvas.tsx +17 -5
- package/src/components/image-annotation/__tests__/AnnotationOverlay.click.test.tsx +137 -0
- package/src/components/image-annotation/__tests__/SvgDrawingCanvas.click.test.tsx +108 -0
- package/src/components/pdf-annotation/PdfAnnotationCanvas.tsx +17 -4
- package/src/components/pdf-annotation/__tests__/PdfAnnotationCanvas.test.tsx +143 -7
- package/src/components/resource/AnnotateView.tsx +59 -38
- package/src/components/resource/BrowseView.tsx +172 -138
- package/src/components/resource/ResourceViewer.tsx +123 -130
- package/src/components/resource/__tests__/AnnotateView.embeddable.test.tsx +55 -0
- package/src/components/resource/__tests__/BrowseView.embeddable.test.tsx +49 -0
- package/src/components/resource/__tests__/BrowseView.links.test.tsx +60 -0
- package/src/components/resource/__tests__/BrowseView.overlay-async.test.tsx +113 -0
- package/src/components/resource/__tests__/BrowseView.reference-hover.test.tsx +161 -0
- package/src/components/resource/__tests__/BrowseView.registry.test.tsx +43 -0
- package/src/components/resource/__tests__/BrowseView.test.tsx +133 -53
- package/src/components/resource/__tests__/ResourceViewer.embeddable.test.tsx +102 -0
- package/src/components/resource/__tests__/ResourceViewer.mode-switch.test.tsx +12 -7
- package/src/components/resource/__tests__/ResourceViewer.toolbar-opt-out.test.tsx +135 -0
- package/src/components/resource/__tests__/ResourceViewer.toolbar-prefs.test.tsx +200 -0
- package/src/components/resource/__tests__/browse-renderers.dispatch.test.tsx +113 -0
- package/src/components/resource/__tests__/browse-renderers.test.tsx +34 -0
- package/src/components/resource/__tests__/inline-embedding.test.tsx +81 -0
- package/src/components/resource/__tests__/media-completeness.test.tsx +88 -0
- package/src/components/resource/browse-renderers.tsx +85 -0
- package/src/components/resource/panels/AssessmentEntry.tsx +5 -4
- package/src/components/resource/panels/AssessmentPanel.tsx +12 -5
- package/src/components/resource/panels/AssistSection.tsx +4 -3
- package/src/components/resource/panels/CommentEntry.tsx +5 -4
- package/src/components/resource/panels/CommentsPanel.tsx +12 -5
- package/src/components/resource/panels/HighlightEntry.tsx +5 -4
- package/src/components/resource/panels/HighlightPanel.tsx +12 -5
- package/src/components/resource/panels/ReferenceEntry.tsx +9 -10
- package/src/components/resource/panels/ReferencesPanel.tsx +15 -6
- package/src/components/resource/panels/ResourceInfoPanel.tsx +4 -3
- package/src/components/resource/panels/TagEntry.tsx +5 -3
- package/src/components/resource/panels/TaggingPanel.tsx +11 -4
- package/src/components/resource/panels/UnifiedAnnotationsPanel.tsx +15 -2
- package/src/components/resource/panels/__tests__/AssessmentEntry.test.tsx +28 -20
- package/src/components/resource/panels/__tests__/AssessmentPanel.test.tsx +39 -28
- package/src/components/resource/panels/__tests__/AssistSection.test.tsx +46 -17
- package/src/components/resource/panels/__tests__/CommentEntry.test.tsx +65 -57
- package/src/components/resource/panels/__tests__/CommentsPanel.test.tsx +54 -24
- package/src/components/resource/panels/__tests__/HighlightEntry.test.tsx +27 -17
- package/src/components/resource/panels/__tests__/HighlightPanel.annotationProgress.test.tsx +23 -17
- package/src/components/resource/panels/__tests__/ReferenceEntry.test.tsx +48 -77
- package/src/components/resource/panels/__tests__/ReferencesPanel.headless.test.tsx +87 -0
- package/src/components/resource/panels/__tests__/ReferencesPanel.observable-flow.test.tsx +15 -9
- package/src/components/resource/panels/__tests__/ReferencesPanel.test.tsx +78 -59
- package/src/components/resource/panels/__tests__/ResourceInfoPanel.test.tsx +11 -4
- package/src/components/resource/panels/__tests__/TagEntry.test.tsx +33 -19
- package/src/components/resource/panels/__tests__/TaggingPanel.test.tsx +16 -7
- package/src/components/toolbar/Toolbar.css +14 -0
- package/src/features/resource-viewer/__tests__/ResourceViewerPage.test.tsx +7 -17
- package/src/features/resource-viewer/components/ResourceViewerPage.tsx +43 -17
- package/src/features/resource-viewer/state/resource-viewer-page-state-unit.ts +2 -14
- package/src/styles/features/resource-viewer.css +19 -0
- package/dist/PdfAnnotationCanvas.client-P37SXBWQ.js.map +0 -1
- package/dist/chunk-O2MD7TGE.js.map +0 -1
package/dist/test-utils.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ReactElement } from 'react';
|
|
2
2
|
import { RenderOptions, RenderResult } from '@testing-library/react';
|
|
3
3
|
export * from '@testing-library/react';
|
|
4
|
-
import { SemiontBrowser, SemiontClient } from '@semiont/sdk';
|
|
4
|
+
import { SemiontBrowser, SemiontSession, SemiontClient } from '@semiont/sdk';
|
|
5
5
|
import { EventBus } from '@semiont/core';
|
|
6
6
|
export { vi } from 'vitest';
|
|
7
7
|
|
|
@@ -60,6 +60,8 @@ interface RenderWithProvidersResult extends RenderResult {
|
|
|
60
60
|
eventBus?: EventBus;
|
|
61
61
|
/** App-scoped bus (the fake browser's own bus). */
|
|
62
62
|
shellBus?: EventBus;
|
|
63
|
+
/** The fake session — pass as the `session` prop to provider-free components. */
|
|
64
|
+
session: SemiontSession | null;
|
|
63
65
|
}
|
|
64
66
|
declare function renderWithProviders(ui: ReactElement, options?: RenderWithProvidersOptions): RenderWithProvidersResult;
|
|
65
67
|
/**
|
|
@@ -78,6 +80,8 @@ declare function createTestSemiontWrapper(apiBaseUrl?: string): {
|
|
|
78
80
|
shellBus: EventBus;
|
|
79
81
|
/** The fake session's client — for tests that need to spy on namespace methods. */
|
|
80
82
|
client: SemiontClient;
|
|
83
|
+
/** The fake session — pass as the `session` prop to provider-free components. */
|
|
84
|
+
session: SemiontSession;
|
|
81
85
|
};
|
|
82
86
|
/**
|
|
83
87
|
* Create a mock translation manager with custom translations
|
package/dist/test-utils.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
ToastProvider,
|
|
5
5
|
TranslationProvider,
|
|
6
6
|
require_cjs
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PFUXQPWJ.js";
|
|
8
8
|
import "./chunk-R52YAGHK.js";
|
|
9
9
|
import {
|
|
10
10
|
__commonJS,
|
|
@@ -12979,15 +12979,20 @@ if (typeof process === "undefined" || !process.env?.RTL_SKIP_AUTO_CLEANUP) {
|
|
|
12979
12979
|
|
|
12980
12980
|
// src/test-utils.tsx
|
|
12981
12981
|
var import_rxjs = __toESM(require_cjs(), 1);
|
|
12982
|
-
import { vi } from "vitest";
|
|
12982
|
+
import { vi, afterEach as afterEach2 } from "vitest";
|
|
12983
12983
|
import { SemiontClient } from "@semiont/sdk";
|
|
12984
12984
|
import { HttpContentTransport, HttpTransport } from "@semiont/http-transport";
|
|
12985
12985
|
import { baseUrl, EventBus } from "@semiont/core";
|
|
12986
12986
|
import { vi as vi2 } from "vitest";
|
|
12987
12987
|
import { jsx } from "react/jsx-runtime";
|
|
12988
|
+
var liveTestClients = [];
|
|
12989
|
+
afterEach2(() => {
|
|
12990
|
+
for (const client of liveTestClients.splice(0)) client.dispose();
|
|
12991
|
+
});
|
|
12988
12992
|
function createFakeBrowserForTests(apiBaseUrl) {
|
|
12989
12993
|
const transport = new HttpTransport({ baseUrl: baseUrl(apiBaseUrl) });
|
|
12990
12994
|
const client = new SemiontClient(transport, new HttpContentTransport(transport), transport);
|
|
12995
|
+
liveTestClients.push(client);
|
|
12991
12996
|
const fakeSession = {
|
|
12992
12997
|
client,
|
|
12993
12998
|
kb: null,
|
|
@@ -13093,7 +13098,7 @@ function renderWithProviders(ui, options) {
|
|
|
13093
13098
|
const extras = {};
|
|
13094
13099
|
if (returnEventBus && client) extras.eventBus = busOf(client);
|
|
13095
13100
|
if (returnShellBus) extras.shellBus = shellBusOf(fakeBrowser);
|
|
13096
|
-
return
|
|
13101
|
+
return { ...result, session: fakeSession, ...extras };
|
|
13097
13102
|
}
|
|
13098
13103
|
function createTestSemiontWrapper(apiBaseUrl = "http://localhost:4000") {
|
|
13099
13104
|
const fakeBrowser = createFakeBrowserForTests(apiBaseUrl);
|
|
@@ -13104,7 +13109,8 @@ function createTestSemiontWrapper(apiBaseUrl = "http://localhost:4000") {
|
|
|
13104
13109
|
SemiontWrapper,
|
|
13105
13110
|
eventBus: busOf(client),
|
|
13106
13111
|
shellBus: shellBusOf(fakeBrowser),
|
|
13107
|
-
client
|
|
13112
|
+
client,
|
|
13113
|
+
session: fakeSession
|
|
13108
13114
|
};
|
|
13109
13115
|
}
|
|
13110
13116
|
function createMockTranslationManager(translations) {
|