@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.
Files changed (81) hide show
  1. package/README.md +1 -1
  2. package/dist/{PdfAnnotationCanvas.client-P37SXBWQ.js → PdfAnnotationCanvas.client-75GY2EDR.js} +15 -6
  3. package/dist/PdfAnnotationCanvas.client-75GY2EDR.js.map +1 -0
  4. package/dist/{chunk-5LFFAVDI.js → chunk-PFUXQPWJ.js} +96 -96
  5. package/dist/{chunk-5LFFAVDI.js.map → chunk-PFUXQPWJ.js.map} +1 -1
  6. package/dist/{chunk-O2MD7TGE.js → chunk-VXASXU4K.js} +10 -2
  7. package/dist/chunk-VXASXU4K.js.map +1 -0
  8. package/dist/index.css +150 -112
  9. package/dist/index.css.map +1 -1
  10. package/dist/index.d.ts +334 -48
  11. package/dist/index.js +2494 -2201
  12. package/dist/index.js.map +1 -1
  13. package/dist/test-utils.d.ts +5 -1
  14. package/dist/test-utils.js +10 -4
  15. package/dist/test-utils.js.map +1 -1
  16. package/package.json +7 -7
  17. package/src/components/ResourceTagsInline.tsx +94 -11
  18. package/src/components/StatusDisplay.css +36 -0
  19. package/src/components/__tests__/ResourceTagsInline.test.tsx +101 -3
  20. package/src/components/annotation/AnnotateToolbar.tsx +53 -28
  21. package/src/components/annotation/__tests__/AnnotateToolbar.display.test.tsx +76 -0
  22. package/src/components/annotation/__tests__/AnnotateToolbar.test.tsx +124 -360
  23. package/src/components/image-annotation/AnnotationOverlay.tsx +6 -6
  24. package/src/components/image-annotation/SvgDrawingCanvas.tsx +17 -5
  25. package/src/components/image-annotation/__tests__/AnnotationOverlay.click.test.tsx +137 -0
  26. package/src/components/image-annotation/__tests__/SvgDrawingCanvas.click.test.tsx +108 -0
  27. package/src/components/pdf-annotation/PdfAnnotationCanvas.tsx +17 -4
  28. package/src/components/pdf-annotation/__tests__/PdfAnnotationCanvas.test.tsx +143 -7
  29. package/src/components/resource/AnnotateView.tsx +59 -38
  30. package/src/components/resource/BrowseView.tsx +172 -138
  31. package/src/components/resource/ResourceViewer.tsx +123 -130
  32. package/src/components/resource/__tests__/AnnotateView.embeddable.test.tsx +55 -0
  33. package/src/components/resource/__tests__/BrowseView.embeddable.test.tsx +49 -0
  34. package/src/components/resource/__tests__/BrowseView.links.test.tsx +60 -0
  35. package/src/components/resource/__tests__/BrowseView.overlay-async.test.tsx +113 -0
  36. package/src/components/resource/__tests__/BrowseView.reference-hover.test.tsx +161 -0
  37. package/src/components/resource/__tests__/BrowseView.registry.test.tsx +43 -0
  38. package/src/components/resource/__tests__/BrowseView.test.tsx +133 -53
  39. package/src/components/resource/__tests__/ResourceViewer.embeddable.test.tsx +102 -0
  40. package/src/components/resource/__tests__/ResourceViewer.mode-switch.test.tsx +12 -7
  41. package/src/components/resource/__tests__/ResourceViewer.toolbar-opt-out.test.tsx +135 -0
  42. package/src/components/resource/__tests__/ResourceViewer.toolbar-prefs.test.tsx +200 -0
  43. package/src/components/resource/__tests__/browse-renderers.dispatch.test.tsx +113 -0
  44. package/src/components/resource/__tests__/browse-renderers.test.tsx +34 -0
  45. package/src/components/resource/__tests__/inline-embedding.test.tsx +81 -0
  46. package/src/components/resource/__tests__/media-completeness.test.tsx +88 -0
  47. package/src/components/resource/browse-renderers.tsx +85 -0
  48. package/src/components/resource/panels/AssessmentEntry.tsx +5 -4
  49. package/src/components/resource/panels/AssessmentPanel.tsx +12 -5
  50. package/src/components/resource/panels/AssistSection.tsx +4 -3
  51. package/src/components/resource/panels/CommentEntry.tsx +5 -4
  52. package/src/components/resource/panels/CommentsPanel.tsx +12 -5
  53. package/src/components/resource/panels/HighlightEntry.tsx +5 -4
  54. package/src/components/resource/panels/HighlightPanel.tsx +12 -5
  55. package/src/components/resource/panels/ReferenceEntry.tsx +9 -10
  56. package/src/components/resource/panels/ReferencesPanel.tsx +15 -6
  57. package/src/components/resource/panels/ResourceInfoPanel.tsx +4 -3
  58. package/src/components/resource/panels/TagEntry.tsx +5 -3
  59. package/src/components/resource/panels/TaggingPanel.tsx +11 -4
  60. package/src/components/resource/panels/UnifiedAnnotationsPanel.tsx +15 -2
  61. package/src/components/resource/panels/__tests__/AssessmentEntry.test.tsx +28 -20
  62. package/src/components/resource/panels/__tests__/AssessmentPanel.test.tsx +39 -28
  63. package/src/components/resource/panels/__tests__/AssistSection.test.tsx +46 -17
  64. package/src/components/resource/panels/__tests__/CommentEntry.test.tsx +65 -57
  65. package/src/components/resource/panels/__tests__/CommentsPanel.test.tsx +54 -24
  66. package/src/components/resource/panels/__tests__/HighlightEntry.test.tsx +27 -17
  67. package/src/components/resource/panels/__tests__/HighlightPanel.annotationProgress.test.tsx +23 -17
  68. package/src/components/resource/panels/__tests__/ReferenceEntry.test.tsx +48 -77
  69. package/src/components/resource/panels/__tests__/ReferencesPanel.headless.test.tsx +87 -0
  70. package/src/components/resource/panels/__tests__/ReferencesPanel.observable-flow.test.tsx +15 -9
  71. package/src/components/resource/panels/__tests__/ReferencesPanel.test.tsx +78 -59
  72. package/src/components/resource/panels/__tests__/ResourceInfoPanel.test.tsx +11 -4
  73. package/src/components/resource/panels/__tests__/TagEntry.test.tsx +33 -19
  74. package/src/components/resource/panels/__tests__/TaggingPanel.test.tsx +16 -7
  75. package/src/components/toolbar/Toolbar.css +14 -0
  76. package/src/features/resource-viewer/__tests__/ResourceViewerPage.test.tsx +7 -17
  77. package/src/features/resource-viewer/components/ResourceViewerPage.tsx +43 -17
  78. package/src/features/resource-viewer/state/resource-viewer-page-state-unit.ts +2 -14
  79. package/src/styles/features/resource-viewer.css +19 -0
  80. package/dist/PdfAnnotationCanvas.client-P37SXBWQ.js.map +0 -1
  81. package/dist/chunk-O2MD7TGE.js.map +0 -1
@@ -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
@@ -4,7 +4,7 @@ import {
4
4
  ToastProvider,
5
5
  TranslationProvider,
6
6
  require_cjs
7
- } from "./chunk-5LFFAVDI.js";
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 Object.keys(extras).length ? { ...result, ...extras } : result;
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) {