@semiont/react-ui 0.5.11 → 0.5.13

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 (53) hide show
  1. package/dist/{PdfAnnotationCanvas.client-KWQ7XDWT.js → PdfAnnotationCanvas.client-75GY2EDR.js} +12 -6
  2. package/dist/PdfAnnotationCanvas.client-75GY2EDR.js.map +1 -0
  3. package/dist/{chunk-O2MD7TGE.js → chunk-VXASXU4K.js} +10 -2
  4. package/dist/chunk-VXASXU4K.js.map +1 -0
  5. package/dist/index.d.ts +54 -16
  6. package/dist/index.js +395 -343
  7. package/dist/index.js.map +1 -1
  8. package/dist/test-utils.d.ts +5 -1
  9. package/dist/test-utils.js +3 -2
  10. package/dist/test-utils.js.map +1 -1
  11. package/package.json +5 -5
  12. package/src/components/image-annotation/AnnotationOverlay.tsx +6 -6
  13. package/src/components/image-annotation/SvgDrawingCanvas.tsx +12 -4
  14. package/src/components/image-annotation/__tests__/AnnotationOverlay.click.test.tsx +137 -0
  15. package/src/components/image-annotation/__tests__/SvgDrawingCanvas.click.test.tsx +108 -0
  16. package/src/components/pdf-annotation/PdfAnnotationCanvas.tsx +12 -4
  17. package/src/components/pdf-annotation/__tests__/PdfAnnotationCanvas.test.tsx +137 -1
  18. package/src/components/resource/BrowseView.tsx +14 -6
  19. package/src/components/resource/ResourceViewer.tsx +6 -4
  20. package/src/components/resource/__tests__/BrowseView.test.tsx +98 -31
  21. package/src/components/resource/__tests__/ResourceViewer.embeddable.test.tsx +40 -1
  22. package/src/components/resource/__tests__/browse-renderers.dispatch.test.tsx +113 -0
  23. package/src/components/resource/browse-renderers.tsx +26 -4
  24. package/src/components/resource/panels/AssessmentEntry.tsx +5 -4
  25. package/src/components/resource/panels/AssessmentPanel.tsx +8 -5
  26. package/src/components/resource/panels/AssistSection.tsx +4 -3
  27. package/src/components/resource/panels/CommentEntry.tsx +5 -4
  28. package/src/components/resource/panels/CommentsPanel.tsx +8 -5
  29. package/src/components/resource/panels/HighlightEntry.tsx +5 -4
  30. package/src/components/resource/panels/HighlightPanel.tsx +8 -5
  31. package/src/components/resource/panels/ReferenceEntry.tsx +9 -10
  32. package/src/components/resource/panels/ReferencesPanel.tsx +11 -6
  33. package/src/components/resource/panels/ResourceInfoPanel.tsx +4 -3
  34. package/src/components/resource/panels/TagEntry.tsx +5 -3
  35. package/src/components/resource/panels/TaggingPanel.tsx +7 -4
  36. package/src/components/resource/panels/UnifiedAnnotationsPanel.tsx +10 -0
  37. package/src/components/resource/panels/__tests__/AssessmentEntry.test.tsx +28 -20
  38. package/src/components/resource/panels/__tests__/AssessmentPanel.test.tsx +38 -28
  39. package/src/components/resource/panels/__tests__/AssistSection.test.tsx +46 -17
  40. package/src/components/resource/panels/__tests__/CommentEntry.test.tsx +65 -57
  41. package/src/components/resource/panels/__tests__/CommentsPanel.test.tsx +53 -24
  42. package/src/components/resource/panels/__tests__/HighlightEntry.test.tsx +27 -17
  43. package/src/components/resource/panels/__tests__/HighlightPanel.annotationProgress.test.tsx +23 -17
  44. package/src/components/resource/panels/__tests__/ReferenceEntry.test.tsx +48 -77
  45. package/src/components/resource/panels/__tests__/ReferencesPanel.headless.test.tsx +87 -0
  46. package/src/components/resource/panels/__tests__/ReferencesPanel.observable-flow.test.tsx +15 -9
  47. package/src/components/resource/panels/__tests__/ReferencesPanel.test.tsx +77 -59
  48. package/src/components/resource/panels/__tests__/ResourceInfoPanel.test.tsx +11 -4
  49. package/src/components/resource/panels/__tests__/TagEntry.test.tsx +33 -19
  50. package/src/components/resource/panels/__tests__/TaggingPanel.test.tsx +15 -7
  51. package/src/features/resource-viewer/components/ResourceViewerPage.tsx +3 -0
  52. package/dist/PdfAnnotationCanvas.client-KWQ7XDWT.js.map +0 -1
  53. 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
@@ -13098,7 +13098,7 @@ function renderWithProviders(ui, options) {
13098
13098
  const extras = {};
13099
13099
  if (returnEventBus && client) extras.eventBus = busOf(client);
13100
13100
  if (returnShellBus) extras.shellBus = shellBusOf(fakeBrowser);
13101
- return Object.keys(extras).length ? { ...result, ...extras } : result;
13101
+ return { ...result, session: fakeSession, ...extras };
13102
13102
  }
13103
13103
  function createTestSemiontWrapper(apiBaseUrl = "http://localhost:4000") {
13104
13104
  const fakeBrowser = createFakeBrowserForTests(apiBaseUrl);
@@ -13109,7 +13109,8 @@ function createTestSemiontWrapper(apiBaseUrl = "http://localhost:4000") {
13109
13109
  SemiontWrapper,
13110
13110
  eventBus: busOf(client),
13111
13111
  shellBus: shellBusOf(fakeBrowser),
13112
- client
13112
+ client,
13113
+ session: fakeSession
13113
13114
  };
13114
13115
  }
13115
13116
  function createMockTranslationManager(translations) {