@semiont/react-ui 0.5.23 → 0.5.24
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/{chunk-RO5CRVIA.js → chunk-4QMTEPQ3.js} +62 -30
- package/dist/chunk-4QMTEPQ3.js.map +1 -0
- package/dist/index.d.ts +18 -30
- package/dist/index.js +371 -409
- package/dist/index.js.map +1 -1
- package/dist/test-utils.js +3 -2
- package/dist/test-utils.js.map +1 -1
- package/package.json +4 -4
- package/src/components/annotation-popups/JsonLdView.tsx +1 -1
- package/src/components/annotation-popups/__tests__/JsonLdView.test.tsx +8 -2
- package/src/components/modals/ReferenceWizardModal.tsx +2 -1
- package/src/components/resource/panels/JsonLdPanel.tsx +1 -1
- package/src/components/resource/panels/__tests__/JsonLdPanel.test.tsx +8 -2
- package/src/components/settings/SettingsPanel.tsx +6 -2
- package/src/components/settings/__tests__/SettingsPanel.test.tsx +28 -3
- package/src/features/admin-devops/__tests__/AdminDevOpsPage.test.tsx +3 -11
- package/src/features/admin-devops/components/AdminDevOpsPage.tsx +0 -3
- package/src/features/admin-exchange/__tests__/AdminExchangePage.test.tsx +0 -1
- package/src/features/admin-exchange/components/AdminExchangePage.tsx +0 -3
- package/src/features/admin-exchange/state/__tests__/exchange-state-unit.test.ts +1 -1
- package/src/features/admin-security/__tests__/AdminSecurityPage.test.tsx +0 -8
- package/src/features/admin-security/components/AdminSecurityPage.tsx +0 -3
- package/src/features/admin-security/state/__tests__/admin-security-state-unit.test.ts +1 -1
- package/src/features/admin-users/__tests__/AdminUsersPage.test.tsx +0 -1
- package/src/features/admin-users/components/AdminUsersPage.tsx +0 -3
- package/src/features/admin-users/state/__tests__/admin-users-state-unit.test.ts +1 -1
- package/src/features/auth-welcome/state/__tests__/welcome-state-unit.test.ts +1 -1
- package/src/features/moderate-entity-tags/__tests__/EntityTagsPage.test.tsx +0 -2
- package/src/features/moderate-entity-tags/components/EntityTagsPage.tsx +0 -3
- package/src/features/moderate-entity-tags/state/__tests__/entity-tags-state-unit.test.ts +1 -1
- package/src/features/moderate-recent/__tests__/RecentDocumentsPage.test.tsx +3 -5
- package/src/features/moderate-recent/components/RecentDocumentsPage.tsx +0 -3
- package/src/features/moderate-tag-schemas/__tests__/TagSchemasPage.test.tsx +3 -5
- package/src/features/moderate-tag-schemas/components/TagSchemasPage.tsx +0 -3
- package/src/features/moderation-linked-data/__tests__/LinkedDataPage.test.tsx +0 -1
- package/src/features/moderation-linked-data/components/LinkedDataPage.tsx +0 -3
- package/src/features/resource-compose/__tests__/ResourceComposePage.test.tsx +17 -7
- package/src/features/resource-compose/components/ResourceComposePage.tsx +5 -3
- package/src/features/resource-compose/state/__tests__/compose-page-state-unit.test.ts +1 -1
- package/src/features/resource-discovery/__tests__/ResourceDiscoveryPage.test.tsx +0 -1
- package/src/features/resource-discovery/components/ResourceDiscoveryPage.tsx +0 -3
- package/src/features/resource-discovery/state/__tests__/discover-state-unit.test.ts +1 -1
- package/src/features/resource-viewer/__tests__/ResourceViewerPage.test.tsx +8 -5
- package/src/features/resource-viewer/components/ResourceViewerPage.tsx +3 -10
- package/src/features/resource-viewer/state/__tests__/resource-loader-state-unit.test.ts +1 -1
- package/src/features/resource-viewer/state/__tests__/resource-viewer-page-state-unit.test.ts +1 -1
- package/src/features/resource-viewer/state/resource-viewer-page-state-unit.ts +2 -2
- package/dist/chunk-RO5CRVIA.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semiont/react-ui",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.24",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=24.0.0"
|
|
6
6
|
},
|
|
@@ -122,9 +122,9 @@
|
|
|
122
122
|
"directory": "packages/react-ui"
|
|
123
123
|
},
|
|
124
124
|
"dependencies": {
|
|
125
|
-
"@semiont/core": "0.5.
|
|
126
|
-
"@semiont/http-transport": "0.5.
|
|
127
|
-
"@semiont/sdk": "0.5.
|
|
125
|
+
"@semiont/core": "0.5.24",
|
|
126
|
+
"@semiont/http-transport": "0.5.24",
|
|
127
|
+
"@semiont/sdk": "0.5.24",
|
|
128
128
|
"pdfjs-dist": "^6.1.200",
|
|
129
129
|
"react-error-boundary": "^6.1.2",
|
|
130
130
|
"react-markdown": "^10.1.0",
|
|
@@ -7,7 +7,7 @@ import { json } from '@codemirror/lang-json';
|
|
|
7
7
|
import { oneDark } from '@codemirror/theme-one-dark';
|
|
8
8
|
import { syntaxHighlighting } from '@codemirror/language';
|
|
9
9
|
import { jsonLightTheme, jsonLightHighlightStyle } from '../../lib/codemirror-json-theme';
|
|
10
|
-
import { useLineNumbers } from '../../
|
|
10
|
+
import { useLineNumbers } from '../../contexts/LineNumbersContext';
|
|
11
11
|
|
|
12
12
|
import type { Annotation } from '@semiont/core';
|
|
13
13
|
|
|
@@ -47,9 +47,15 @@ vi.mock('../../../lib/codemirror-json-theme', () => ({
|
|
|
47
47
|
jsonLightHighlightStyle: {},
|
|
48
48
|
}));
|
|
49
49
|
|
|
50
|
-
vi.mock('@/
|
|
50
|
+
vi.mock('@/contexts/LineNumbersContext', async () => {
|
|
51
|
+
const actual = await vi.importActual('@/contexts/LineNumbersContext');
|
|
52
|
+
// Mock ONLY the hook: renderWithProviders mounts the real
|
|
53
|
+
// LineNumbersProvider, which an auto-mock would swallow (rendering
|
|
54
|
+
// nothing), while these tests want a fixed showLineNumbers value.
|
|
55
|
+
return { ...actual, useLineNumbers: vi.fn() };
|
|
56
|
+
});
|
|
51
57
|
|
|
52
|
-
import { useLineNumbers } from '@/
|
|
58
|
+
import { useLineNumbers } from '@/contexts/LineNumbersContext';
|
|
53
59
|
import { renderWithProviders } from '../../../test-utils';
|
|
54
60
|
import { JsonLdView } from '../JsonLdView';
|
|
55
61
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { useState, useEffect, useCallback } from 'react';
|
|
4
4
|
import { Dialog, DialogPanel, DialogTitle, Transition, TransitionChild } from '@headlessui/react';
|
|
5
5
|
import type { GatheredContext } from '@semiont/core';
|
|
6
|
+
import { uuidV4 } from '@semiont/core';
|
|
6
7
|
import { useSemiont } from '../../session/SemiontProvider';
|
|
7
8
|
import { useObservable } from '../../hooks/useObservable';
|
|
8
9
|
import { useEventSubscription } from '../../contexts/useEventSubscription';
|
|
@@ -144,7 +145,7 @@ export function ReferenceWizardModal({
|
|
|
144
145
|
setIsSearching(true);
|
|
145
146
|
const contextWithHint = userHint ? { ...context, userHint } : context;
|
|
146
147
|
session?.client.match.requestSearch({
|
|
147
|
-
correlationId:
|
|
148
|
+
correlationId: uuidV4(),
|
|
148
149
|
resourceId,
|
|
149
150
|
referenceId: annotationId,
|
|
150
151
|
context: contextWithHint,
|
|
@@ -7,7 +7,7 @@ import { json } from '@codemirror/lang-json';
|
|
|
7
7
|
import { oneDark } from '@codemirror/theme-one-dark';
|
|
8
8
|
import { syntaxHighlighting } from '@codemirror/language';
|
|
9
9
|
import { jsonLightTheme, jsonLightHighlightStyle } from '../../../lib/codemirror-json-theme';
|
|
10
|
-
import { useLineNumbers } from '../../../
|
|
10
|
+
import { useLineNumbers } from '../../../contexts/LineNumbersContext';
|
|
11
11
|
import { useResourceGraph } from '../../../hooks/useResourceGraph';
|
|
12
12
|
import type { ResourceId } from '@semiont/core';
|
|
13
13
|
import './JsonLdPanel.css';
|
|
@@ -32,9 +32,15 @@ vi.mock('../../../lib/codemirror-json-theme', () => ({
|
|
|
32
32
|
}));
|
|
33
33
|
|
|
34
34
|
// Mock the hooks the panel consumes — NOT the session/client stack.
|
|
35
|
-
vi.mock('@/
|
|
35
|
+
vi.mock('@/contexts/LineNumbersContext', async () => {
|
|
36
|
+
const actual = await vi.importActual('@/contexts/LineNumbersContext');
|
|
37
|
+
// Mock ONLY the hook: renderWithProviders mounts the real
|
|
38
|
+
// LineNumbersProvider, which an auto-mock would swallow (rendering
|
|
39
|
+
// nothing), while these tests want a fixed showLineNumbers value.
|
|
40
|
+
return { ...actual, useLineNumbers: vi.fn() };
|
|
41
|
+
});
|
|
36
42
|
vi.mock('@/hooks/useResourceGraph');
|
|
37
|
-
import { useLineNumbers } from '@/
|
|
43
|
+
import { useLineNumbers } from '@/contexts/LineNumbersContext';
|
|
38
44
|
import { useResourceGraph } from '@/hooks/useResourceGraph';
|
|
39
45
|
|
|
40
46
|
const RID = resourceId('test-resource-1');
|
|
@@ -5,10 +5,10 @@ import { LOCALES } from '@semiont/core';
|
|
|
5
5
|
import { useTranslations } from '../../contexts/TranslationContext';
|
|
6
6
|
import { useLanguageChangeAnnouncements } from '../LiveRegion';
|
|
7
7
|
import { useSemiont } from '../../session/SemiontProvider';
|
|
8
|
+
import { useLineNumbers } from '../../contexts/LineNumbersContext';
|
|
8
9
|
import './SettingsPanel.css';
|
|
9
10
|
|
|
10
11
|
interface SettingsPanelProps {
|
|
11
|
-
showLineNumbers: boolean;
|
|
12
12
|
theme: 'light' | 'dark' | 'system';
|
|
13
13
|
locale: string;
|
|
14
14
|
isPendingLocaleChange?: boolean;
|
|
@@ -24,7 +24,6 @@ interface SettingsPanelProps {
|
|
|
24
24
|
* @emits settings:hover-delay-changed - Hover delay changed by user. Payload: { hoverDelayMs: number }
|
|
25
25
|
*/
|
|
26
26
|
export function SettingsPanel({
|
|
27
|
-
showLineNumbers,
|
|
28
27
|
theme,
|
|
29
28
|
locale,
|
|
30
29
|
isPendingLocaleChange = false,
|
|
@@ -32,6 +31,11 @@ export function SettingsPanel({
|
|
|
32
31
|
}: SettingsPanelProps) {
|
|
33
32
|
const t = useTranslations('Settings');
|
|
34
33
|
const semiont = useSemiont();
|
|
34
|
+
// The switch renders the SHARED line-numbers state, not a prop snapshot:
|
|
35
|
+
// its toggle is applied by a bus subscriber in ToolbarPanels, so a prop
|
|
36
|
+
// fed from any per-route source is a second copy that never updates.
|
|
37
|
+
// See .plans/bugs/line-numbers-toggle-desynced-by-hoist.md
|
|
38
|
+
const { showLineNumbers } = useLineNumbers();
|
|
35
39
|
const { announceLanguageChanging, announceLanguageChanged } = useLanguageChangeAnnouncements();
|
|
36
40
|
|
|
37
41
|
// Track previous locale to detect changes
|
|
@@ -3,6 +3,7 @@ import { screen, fireEvent } from '@testing-library/react';
|
|
|
3
3
|
import { renderWithProviders } from '../../../test-utils';
|
|
4
4
|
import '@testing-library/jest-dom';
|
|
5
5
|
import { SettingsPanel } from '../SettingsPanel';
|
|
6
|
+
import { useLineNumbers } from '../../../contexts/LineNumbersContext';
|
|
6
7
|
|
|
7
8
|
// Mock LiveRegion
|
|
8
9
|
vi.mock('../../LiveRegion', () => ({
|
|
@@ -27,7 +28,6 @@ vi.mock('@semiont/core', async () => {
|
|
|
27
28
|
|
|
28
29
|
describe('SettingsPanel', () => {
|
|
29
30
|
const defaultProps = {
|
|
30
|
-
showLineNumbers: true,
|
|
31
31
|
theme: 'light' as const,
|
|
32
32
|
locale: 'en',
|
|
33
33
|
hoverDelayMs: 150,
|
|
@@ -35,6 +35,7 @@ describe('SettingsPanel', () => {
|
|
|
35
35
|
|
|
36
36
|
beforeEach(() => {
|
|
37
37
|
vi.clearAllMocks();
|
|
38
|
+
localStorage.clear();
|
|
38
39
|
});
|
|
39
40
|
|
|
40
41
|
it('renders settings title', () => {
|
|
@@ -49,13 +50,14 @@ describe('SettingsPanel', () => {
|
|
|
49
50
|
});
|
|
50
51
|
|
|
51
52
|
it('shows toggle as checked when line numbers enabled', () => {
|
|
52
|
-
|
|
53
|
+
localStorage.setItem('showLineNumbers', 'true');
|
|
54
|
+
renderWithProviders(<SettingsPanel {...defaultProps} />);
|
|
53
55
|
const toggle = screen.getByRole('switch');
|
|
54
56
|
expect(toggle).toHaveAttribute('aria-checked', 'true');
|
|
55
57
|
});
|
|
56
58
|
|
|
57
59
|
it('shows toggle as unchecked when line numbers disabled', () => {
|
|
58
|
-
renderWithProviders(<SettingsPanel {...defaultProps}
|
|
60
|
+
renderWithProviders(<SettingsPanel {...defaultProps} />);
|
|
59
61
|
const toggle = screen.getByRole('switch');
|
|
60
62
|
expect(toggle).toHaveAttribute('aria-checked', 'false');
|
|
61
63
|
});
|
|
@@ -72,6 +74,29 @@ describe('SettingsPanel', () => {
|
|
|
72
74
|
expect(handler).toHaveBeenCalled();
|
|
73
75
|
sub.unsubscribe();
|
|
74
76
|
});
|
|
77
|
+
|
|
78
|
+
it('renders the SHARED line-numbers state — a toggle applied elsewhere flips the switch', () => {
|
|
79
|
+
// The e2e chain is: switch click → bus emit → ToolbarPanels applies
|
|
80
|
+
// toggleLineNumbers → the switch must flip. The apply step happens in
|
|
81
|
+
// a DIFFERENT component, so the switch can only flip if all
|
|
82
|
+
// useLineNumbers consumers share one value. A prop-fed switch over a
|
|
83
|
+
// per-caller useState is how e2e 13:77/:134/:189 went red.
|
|
84
|
+
// See .plans/bugs/line-numbers-toggle-desynced-by-hoist.md
|
|
85
|
+
function OtherConsumer() {
|
|
86
|
+
const { toggleLineNumbers } = useLineNumbers();
|
|
87
|
+
return <button data-testid="other-consumer" onClick={toggleLineNumbers} />;
|
|
88
|
+
}
|
|
89
|
+
renderWithProviders(
|
|
90
|
+
<>
|
|
91
|
+
<OtherConsumer />
|
|
92
|
+
<SettingsPanel {...defaultProps} />
|
|
93
|
+
</>
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
expect(screen.getByRole('switch')).toHaveAttribute('aria-checked', 'false');
|
|
97
|
+
fireEvent.click(screen.getByTestId('other-consumer'));
|
|
98
|
+
expect(screen.getByRole('switch')).toHaveAttribute('aria-checked', 'true');
|
|
99
|
+
});
|
|
75
100
|
});
|
|
76
101
|
|
|
77
102
|
describe('theme selection', () => {
|
|
@@ -34,7 +34,6 @@ const createMockProps = (overrides?: Partial<AdminDevOpsPageProps>): AdminDevOps
|
|
|
34
34
|
},
|
|
35
35
|
],
|
|
36
36
|
theme: 'light',
|
|
37
|
-
showLineNumbers: false,
|
|
38
37
|
activePanel: null,
|
|
39
38
|
translations: {
|
|
40
39
|
title: 'DevOps',
|
|
@@ -289,13 +288,13 @@ describe('AdminDevOpsPage', () => {
|
|
|
289
288
|
);
|
|
290
289
|
});
|
|
291
290
|
|
|
292
|
-
it('
|
|
291
|
+
it('does not thread showLineNumbers to toolbar panels — the setting is context-backed', () => {
|
|
293
292
|
const ToolbarPanels = vi.fn(() => <div data-testid="toolbar-panels" />);
|
|
294
|
-
const props = createMockProps({
|
|
293
|
+
const props = createMockProps({ToolbarPanels });
|
|
295
294
|
render(<AdminDevOpsPage {...props} />);
|
|
296
295
|
|
|
297
296
|
expect(ToolbarPanels).toHaveBeenCalledWith(
|
|
298
|
-
expect.objectContaining({ showLineNumbers:
|
|
297
|
+
expect.not.objectContaining({ showLineNumbers: expect.anything() }),
|
|
299
298
|
undefined,
|
|
300
299
|
);
|
|
301
300
|
});
|
|
@@ -384,13 +383,6 @@ describe('AdminDevOpsPage', () => {
|
|
|
384
383
|
expect(screen.getByText('DevOps')).toBeInTheDocument();
|
|
385
384
|
});
|
|
386
385
|
|
|
387
|
-
it('renders with line numbers enabled', () => {
|
|
388
|
-
const props = createMockProps({ showLineNumbers: true });
|
|
389
|
-
render(<AdminDevOpsPage {...props} />);
|
|
390
|
-
|
|
391
|
-
expect(screen.getByText('DevOps')).toBeInTheDocument();
|
|
392
|
-
});
|
|
393
|
-
|
|
394
386
|
it('handles all callbacks being defined', () => {
|
|
395
387
|
const props = createMockProps();
|
|
396
388
|
render(<AdminDevOpsPage {...props} />);
|
|
@@ -23,7 +23,6 @@ export interface AdminDevOpsPageProps {
|
|
|
23
23
|
|
|
24
24
|
// UI state
|
|
25
25
|
theme: 'light' | 'dark' | 'system';
|
|
26
|
-
showLineNumbers: boolean;
|
|
27
26
|
activePanel: string | null;
|
|
28
27
|
|
|
29
28
|
// Translations
|
|
@@ -46,7 +45,6 @@ export interface AdminDevOpsPageProps {
|
|
|
46
45
|
export function AdminDevOpsPage({
|
|
47
46
|
suggestedFeatures,
|
|
48
47
|
theme,
|
|
49
|
-
showLineNumbers,
|
|
50
48
|
activePanel,
|
|
51
49
|
translations: t,
|
|
52
50
|
StatusDisplay,
|
|
@@ -132,7 +130,6 @@ export function AdminDevOpsPage({
|
|
|
132
130
|
<ToolbarPanels
|
|
133
131
|
activePanel={activePanel}
|
|
134
132
|
theme={theme}
|
|
135
|
-
showLineNumbers={showLineNumbers}
|
|
136
133
|
/>
|
|
137
134
|
|
|
138
135
|
<Toolbar
|
|
@@ -38,7 +38,6 @@ export interface AdminExchangePageProps {
|
|
|
38
38
|
|
|
39
39
|
// UI state
|
|
40
40
|
theme: 'light' | 'dark' | 'system';
|
|
41
|
-
showLineNumbers: boolean;
|
|
42
41
|
activePanel: string | null;
|
|
43
42
|
|
|
44
43
|
// Translations
|
|
@@ -62,7 +61,6 @@ export function AdminExchangePage({
|
|
|
62
61
|
importMessage,
|
|
63
62
|
importResult,
|
|
64
63
|
theme,
|
|
65
|
-
showLineNumbers,
|
|
66
64
|
activePanel,
|
|
67
65
|
translations: t,
|
|
68
66
|
ToolbarPanels,
|
|
@@ -108,7 +106,6 @@ export function AdminExchangePage({
|
|
|
108
106
|
<ToolbarPanels
|
|
109
107
|
activePanel={activePanel}
|
|
110
108
|
theme={theme}
|
|
111
|
-
showLineNumbers={showLineNumbers}
|
|
112
109
|
/>
|
|
113
110
|
<Toolbar
|
|
114
111
|
context="simple"
|
|
@@ -2,7 +2,7 @@ import { describe, it, expect, vi } from 'vitest';
|
|
|
2
2
|
import { firstValueFrom, of, throwError } from 'rxjs';
|
|
3
3
|
import type { ShellStateUnit } from '../../../../state/shell-state-unit';
|
|
4
4
|
import { createExchangeStateUnit } from '../exchange-state-unit';
|
|
5
|
-
import { assertStateUnitAxioms, disposeProbe } from '@semiont/core/testing';
|
|
5
|
+
import { assertStateUnitAxioms, disposeProbe } from '@semiont/core/testing/axioms';
|
|
6
6
|
|
|
7
7
|
function mockBrowse(): ShellStateUnit {
|
|
8
8
|
return { dispose: vi.fn() } as unknown as ShellStateUnit;
|
|
@@ -21,7 +21,6 @@ const createMockProps = (overrides?: Partial<AdminSecurityPageProps>): AdminSecu
|
|
|
21
21
|
allowedDomains: ['example.com'],
|
|
22
22
|
isLoading: false,
|
|
23
23
|
theme: 'light',
|
|
24
|
-
showLineNumbers: false,
|
|
25
24
|
activePanel: null,
|
|
26
25
|
translations: {
|
|
27
26
|
title: 'Security Settings',
|
|
@@ -347,12 +346,5 @@ describe('AdminSecurityPage', () => {
|
|
|
347
346
|
|
|
348
347
|
expect(screen.getByText('Security Settings')).toBeInTheDocument();
|
|
349
348
|
});
|
|
350
|
-
|
|
351
|
-
it('renders with line numbers enabled', () => {
|
|
352
|
-
const props = createMockProps({ showLineNumbers: true });
|
|
353
|
-
render(<AdminSecurityPage {...props} />);
|
|
354
|
-
|
|
355
|
-
expect(screen.getByText('Security Settings')).toBeInTheDocument();
|
|
356
|
-
});
|
|
357
349
|
});
|
|
358
350
|
});
|
|
@@ -26,7 +26,6 @@ export interface AdminSecurityPageProps {
|
|
|
26
26
|
|
|
27
27
|
// UI state
|
|
28
28
|
theme: 'light' | 'dark' | 'system';
|
|
29
|
-
showLineNumbers: boolean;
|
|
30
29
|
activePanel: string | null;
|
|
31
30
|
|
|
32
31
|
// Translations
|
|
@@ -60,7 +59,6 @@ export function AdminSecurityPage({
|
|
|
60
59
|
allowedDomains,
|
|
61
60
|
isLoading,
|
|
62
61
|
theme,
|
|
63
|
-
showLineNumbers,
|
|
64
62
|
activePanel,
|
|
65
63
|
translations: t,
|
|
66
64
|
ToolbarPanels,
|
|
@@ -176,7 +174,6 @@ export function AdminSecurityPage({
|
|
|
176
174
|
<ToolbarPanels
|
|
177
175
|
activePanel={activePanel}
|
|
178
176
|
theme={theme}
|
|
179
|
-
showLineNumbers={showLineNumbers}
|
|
180
177
|
/>
|
|
181
178
|
|
|
182
179
|
<Toolbar
|
|
@@ -5,7 +5,7 @@ import { filter } from 'rxjs/operators';
|
|
|
5
5
|
import type { SemiontClient } from '@semiont/sdk';
|
|
6
6
|
import type { ShellStateUnit } from '../../../../state/shell-state-unit';
|
|
7
7
|
import { createAdminSecurityStateUnit } from '../admin-security-state-unit';
|
|
8
|
-
import { assertStateUnitAxioms, disposeProbe } from '@semiont/core/testing';
|
|
8
|
+
import { assertStateUnitAxioms, disposeProbe } from '@semiont/core/testing/axioms';
|
|
9
9
|
|
|
10
10
|
function mockBrowse(): ShellStateUnit {
|
|
11
11
|
return { dispose: vi.fn() } as unknown as ShellStateUnit;
|
|
@@ -78,7 +78,6 @@ const createMockProps = (overrides?: Partial<AdminUsersPageProps>): AdminUsersPa
|
|
|
78
78
|
onAddUser: vi.fn(),
|
|
79
79
|
onExportUsers: vi.fn(),
|
|
80
80
|
theme: 'light',
|
|
81
|
-
showLineNumbers: false,
|
|
82
81
|
activePanel: null,
|
|
83
82
|
translations: createMockTranslations(),
|
|
84
83
|
ToolbarPanels: ({ children }: any) => <div data-testid="toolbar-panels">{children}</div>,
|
|
@@ -152,7 +152,6 @@ export interface AdminUsersPageProps {
|
|
|
152
152
|
|
|
153
153
|
// UI state
|
|
154
154
|
theme: 'light' | 'dark' | 'system';
|
|
155
|
-
showLineNumbers: boolean;
|
|
156
155
|
activePanel: string | null;
|
|
157
156
|
|
|
158
157
|
// Translations
|
|
@@ -213,7 +212,6 @@ export function AdminUsersPage({
|
|
|
213
212
|
onAddUser,
|
|
214
213
|
onExportUsers,
|
|
215
214
|
theme,
|
|
216
|
-
showLineNumbers,
|
|
217
215
|
activePanel,
|
|
218
216
|
translations: t,
|
|
219
217
|
ToolbarPanels,
|
|
@@ -453,7 +451,6 @@ export function AdminUsersPage({
|
|
|
453
451
|
<ToolbarPanels
|
|
454
452
|
activePanel={activePanel}
|
|
455
453
|
theme={theme}
|
|
456
|
-
showLineNumbers={showLineNumbers}
|
|
457
454
|
/>
|
|
458
455
|
|
|
459
456
|
<Toolbar
|
|
@@ -5,7 +5,7 @@ import { filter } from 'rxjs/operators';
|
|
|
5
5
|
import type { SemiontClient } from '@semiont/sdk';
|
|
6
6
|
import type { ShellStateUnit } from '../../../../state/shell-state-unit';
|
|
7
7
|
import { createAdminUsersStateUnit } from '../admin-users-state-unit';
|
|
8
|
-
import { assertStateUnitAxioms, disposeProbe } from '@semiont/core/testing';
|
|
8
|
+
import { assertStateUnitAxioms, disposeProbe } from '@semiont/core/testing/axioms';
|
|
9
9
|
|
|
10
10
|
function mockBrowse(): ShellStateUnit {
|
|
11
11
|
return { dispose: vi.fn() } as unknown as ShellStateUnit;
|
|
@@ -5,7 +5,7 @@ import type { SemiontSession } from '@semiont/sdk';
|
|
|
5
5
|
import { AuthNamespace } from '@semiont/sdk';
|
|
6
6
|
import { createTestSession, stubBackend } from '@semiont/sdk/testing';
|
|
7
7
|
import { createWelcomeStateUnit } from '../welcome-state-unit';
|
|
8
|
-
import { assertStateUnitAxioms } from '@semiont/core/testing';
|
|
8
|
+
import { assertStateUnitAxioms } from '@semiont/core/testing/axioms';
|
|
9
9
|
|
|
10
10
|
// Real session over the scriptable transport (SESSION-TYPED-FACTORIES pilot);
|
|
11
11
|
// auth behavior scripted by prototype spies, the AuthShell precedent — the
|
|
@@ -19,7 +19,6 @@ const createMockProps = (overrides?: Partial<EntityTagsPageProps>): EntityTagsPa
|
|
|
19
19
|
onAddTag: vi.fn(),
|
|
20
20
|
isAddingTag: false,
|
|
21
21
|
theme: 'light',
|
|
22
|
-
showLineNumbers: false,
|
|
23
22
|
activePanel: null,
|
|
24
23
|
translations: {
|
|
25
24
|
pageTitle: 'Entity Tags',
|
|
@@ -344,7 +343,6 @@ describe('EntityTagsPage', () => {
|
|
|
344
343
|
error: 'Error',
|
|
345
344
|
isAddingTag: true,
|
|
346
345
|
theme: 'dark',
|
|
347
|
-
showLineNumbers: true,
|
|
348
346
|
activePanel: 'settings',
|
|
349
347
|
});
|
|
350
348
|
render(<EntityTagsPage {...props} />);
|
|
@@ -28,7 +28,6 @@ export interface EntityTagsPageProps {
|
|
|
28
28
|
|
|
29
29
|
// UI state
|
|
30
30
|
theme: 'light' | 'dark' | 'system';
|
|
31
|
-
showLineNumbers: boolean;
|
|
32
31
|
activePanel: string | null;
|
|
33
32
|
|
|
34
33
|
// Translations
|
|
@@ -55,7 +54,6 @@ export function EntityTagsPage({
|
|
|
55
54
|
onAddTag,
|
|
56
55
|
isAddingTag,
|
|
57
56
|
theme,
|
|
58
|
-
showLineNumbers,
|
|
59
57
|
activePanel,
|
|
60
58
|
translations: t,
|
|
61
59
|
ToolbarPanels,
|
|
@@ -150,7 +148,6 @@ export function EntityTagsPage({
|
|
|
150
148
|
<ToolbarPanels
|
|
151
149
|
activePanel={activePanel}
|
|
152
150
|
theme={theme}
|
|
153
|
-
showLineNumbers={showLineNumbers}
|
|
154
151
|
/>
|
|
155
152
|
|
|
156
153
|
<Toolbar
|
|
@@ -6,7 +6,7 @@ import { filter } from 'rxjs/operators';
|
|
|
6
6
|
import type { SemiontClient } from '@semiont/sdk';
|
|
7
7
|
import type { ShellStateUnit } from '../../../../state/shell-state-unit';
|
|
8
8
|
import { createEntityTagsStateUnit } from '../entity-tags-state-unit';
|
|
9
|
-
import { assertStateUnitAxioms, disposeProbe } from '@semiont/core/testing';
|
|
9
|
+
import { assertStateUnitAxioms, disposeProbe } from '@semiont/core/testing/axioms';
|
|
10
10
|
|
|
11
11
|
function mockBrowse(): ShellStateUnit {
|
|
12
12
|
return { dispose: vi.fn() } as unknown as ShellStateUnit;
|
|
@@ -14,7 +14,6 @@ const createMockProps = (overrides?: Partial<RecentDocumentsPageProps>): RecentD
|
|
|
14
14
|
hasDocuments: false,
|
|
15
15
|
isLoading: false,
|
|
16
16
|
theme: 'light',
|
|
17
|
-
showLineNumbers: false,
|
|
18
17
|
activePanel: null,
|
|
19
18
|
translations: {
|
|
20
19
|
pageTitle: 'Recent Documents',
|
|
@@ -205,13 +204,13 @@ describe('RecentDocumentsPage', () => {
|
|
|
205
204
|
);
|
|
206
205
|
});
|
|
207
206
|
|
|
208
|
-
it('
|
|
207
|
+
it('does not thread showLineNumbers to toolbar panels — the setting is context-backed', () => {
|
|
209
208
|
const ToolbarPanels = vi.fn(() => <div data-testid="toolbar-panels" />);
|
|
210
|
-
const props = createMockProps({
|
|
209
|
+
const props = createMockProps({ToolbarPanels });
|
|
211
210
|
render(<RecentDocumentsPage {...props} />);
|
|
212
211
|
|
|
213
212
|
expect(ToolbarPanels).toHaveBeenCalledWith(
|
|
214
|
-
expect.objectContaining({ showLineNumbers:
|
|
213
|
+
expect.not.objectContaining({ showLineNumbers: expect.anything() }),
|
|
215
214
|
undefined,
|
|
216
215
|
);
|
|
217
216
|
});
|
|
@@ -342,7 +341,6 @@ describe('RecentDocumentsPage', () => {
|
|
|
342
341
|
const props = createMockProps({
|
|
343
342
|
hasDocuments: true,
|
|
344
343
|
theme: 'dark',
|
|
345
|
-
showLineNumbers: true,
|
|
346
344
|
activePanel: 'settings',
|
|
347
345
|
});
|
|
348
346
|
render(<RecentDocumentsPage {...props} />);
|
|
@@ -15,7 +15,6 @@ export interface RecentDocumentsPageProps {
|
|
|
15
15
|
|
|
16
16
|
// UI state
|
|
17
17
|
theme: 'light' | 'dark' | 'system';
|
|
18
|
-
showLineNumbers: boolean;
|
|
19
18
|
activePanel: string | null;
|
|
20
19
|
|
|
21
20
|
// Translations
|
|
@@ -37,7 +36,6 @@ export interface RecentDocumentsPageProps {
|
|
|
37
36
|
export function RecentDocumentsPage({
|
|
38
37
|
isLoading,
|
|
39
38
|
theme,
|
|
40
|
-
showLineNumbers,
|
|
41
39
|
activePanel,
|
|
42
40
|
translations: t,
|
|
43
41
|
ToolbarPanels,
|
|
@@ -95,7 +93,6 @@ export function RecentDocumentsPage({
|
|
|
95
93
|
<ToolbarPanels
|
|
96
94
|
activePanel={activePanel}
|
|
97
95
|
theme={theme}
|
|
98
|
-
showLineNumbers={showLineNumbers}
|
|
99
96
|
/>
|
|
100
97
|
|
|
101
98
|
<Toolbar
|
|
@@ -61,7 +61,6 @@ const createMockProps = (overrides?: Partial<TagSchemasPageProps>): TagSchemasPa
|
|
|
61
61
|
schemas: mockSchemas,
|
|
62
62
|
isLoading: false,
|
|
63
63
|
theme: 'light',
|
|
64
|
-
showLineNumbers: false,
|
|
65
64
|
activePanel: null,
|
|
66
65
|
translations: {
|
|
67
66
|
pageTitle: 'Tag Schemas',
|
|
@@ -276,13 +275,13 @@ describe('TagSchemasPage', () => {
|
|
|
276
275
|
);
|
|
277
276
|
});
|
|
278
277
|
|
|
279
|
-
it('
|
|
278
|
+
it('does not thread showLineNumbers to toolbar panels — the setting is context-backed', () => {
|
|
280
279
|
const ToolbarPanels = vi.fn(() => <div data-testid="toolbar-panels" />);
|
|
281
|
-
const props = createMockProps({
|
|
280
|
+
const props = createMockProps({ToolbarPanels });
|
|
282
281
|
render(<TagSchemasPage {...props} />);
|
|
283
282
|
|
|
284
283
|
expect(ToolbarPanels).toHaveBeenCalledWith(
|
|
285
|
-
expect.objectContaining({ showLineNumbers:
|
|
284
|
+
expect.not.objectContaining({ showLineNumbers: expect.anything() }),
|
|
286
285
|
undefined,
|
|
287
286
|
);
|
|
288
287
|
});
|
|
@@ -420,7 +419,6 @@ describe('TagSchemasPage', () => {
|
|
|
420
419
|
it('handles all props being defined', () => {
|
|
421
420
|
const props = createMockProps({
|
|
422
421
|
theme: 'dark',
|
|
423
|
-
showLineNumbers: true,
|
|
424
422
|
activePanel: 'settings',
|
|
425
423
|
});
|
|
426
424
|
render(<TagSchemasPage {...props} />);
|
|
@@ -22,7 +22,6 @@ export interface TagSchemasPageProps {
|
|
|
22
22
|
|
|
23
23
|
// UI state
|
|
24
24
|
theme: 'light' | 'dark' | 'system';
|
|
25
|
-
showLineNumbers: boolean;
|
|
26
25
|
activePanel: string | null;
|
|
27
26
|
|
|
28
27
|
// Translations
|
|
@@ -54,7 +53,6 @@ export function TagSchemasPage({
|
|
|
54
53
|
schemas,
|
|
55
54
|
isLoading,
|
|
56
55
|
theme,
|
|
57
|
-
showLineNumbers,
|
|
58
56
|
activePanel,
|
|
59
57
|
translations: t,
|
|
60
58
|
ToolbarPanels,
|
|
@@ -153,7 +151,6 @@ export function TagSchemasPage({
|
|
|
153
151
|
<ToolbarPanels
|
|
154
152
|
activePanel={activePanel}
|
|
155
153
|
theme={theme}
|
|
156
|
-
showLineNumbers={showLineNumbers}
|
|
157
154
|
/>
|
|
158
155
|
|
|
159
156
|
<Toolbar
|
|
@@ -39,7 +39,6 @@ export interface LinkedDataPageProps {
|
|
|
39
39
|
|
|
40
40
|
// UI state
|
|
41
41
|
theme: 'light' | 'dark' | 'system';
|
|
42
|
-
showLineNumbers: boolean;
|
|
43
42
|
activePanel: string | null;
|
|
44
43
|
|
|
45
44
|
// Translations
|
|
@@ -63,7 +62,6 @@ export function LinkedDataPage({
|
|
|
63
62
|
importMessage,
|
|
64
63
|
importResult,
|
|
65
64
|
theme,
|
|
66
|
-
showLineNumbers,
|
|
67
65
|
activePanel,
|
|
68
66
|
translations: t,
|
|
69
67
|
ToolbarPanels,
|
|
@@ -109,7 +107,6 @@ export function LinkedDataPage({
|
|
|
109
107
|
<ToolbarPanels
|
|
110
108
|
activePanel={activePanel}
|
|
111
109
|
theme={theme}
|
|
112
|
-
showLineNumbers={showLineNumbers}
|
|
113
110
|
/>
|
|
114
111
|
<Toolbar
|
|
115
112
|
context="simple"
|