@dxos/plugin-testing 0.0.0 → 0.8.4-main.1c7ec43d41

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 (90) hide show
  1. package/dist/lib/browser/harness.mjs +35 -0
  2. package/dist/lib/browser/harness.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +41 -0
  4. package/dist/lib/browser/index.mjs.map +7 -0
  5. package/dist/lib/browser/meta.json +1 -0
  6. package/dist/lib/node-esm/harness.mjs +37 -0
  7. package/dist/lib/node-esm/harness.mjs.map +7 -0
  8. package/dist/lib/node-esm/index.mjs +43 -0
  9. package/dist/lib/node-esm/index.mjs.map +7 -0
  10. package/dist/lib/node-esm/meta.json +1 -0
  11. package/dist/types/src/StorybookPlugin.d.ts +8 -0
  12. package/dist/types/src/StorybookPlugin.d.ts.map +1 -0
  13. package/dist/types/src/capabilities/index.d.ts +16 -0
  14. package/dist/types/src/capabilities/index.d.ts.map +1 -0
  15. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  16. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  17. package/dist/types/src/capabilities/state.d.ts +18 -0
  18. package/dist/types/src/capabilities/state.d.ts.map +1 -0
  19. package/dist/types/src/components/Layout/Layout.d.ts +6 -0
  20. package/dist/types/src/components/Layout/Layout.d.ts.map +1 -0
  21. package/dist/types/src/components/Layout/index.d.ts +2 -0
  22. package/dist/types/src/components/Layout/index.d.ts.map +1 -0
  23. package/dist/types/src/components/index.d.ts +2 -0
  24. package/dist/types/src/components/index.d.ts.map +1 -0
  25. package/dist/types/src/core.d.ts +8 -0
  26. package/dist/types/src/core.d.ts.map +1 -0
  27. package/dist/types/src/harness.d.ts +20 -0
  28. package/dist/types/src/harness.d.ts.map +1 -0
  29. package/dist/types/src/index.d.ts +6 -0
  30. package/dist/types/src/index.d.ts.map +1 -0
  31. package/dist/types/src/meta.d.ts +3 -0
  32. package/dist/types/src/meta.d.ts.map +1 -0
  33. package/dist/types/src/operations/add-toast.d.ts +5 -0
  34. package/dist/types/src/operations/add-toast.d.ts.map +1 -0
  35. package/dist/types/src/operations/close.d.ts +5 -0
  36. package/dist/types/src/operations/close.d.ts.map +1 -0
  37. package/dist/types/src/operations/index.d.ts +3 -0
  38. package/dist/types/src/operations/index.d.ts.map +1 -0
  39. package/dist/types/src/operations/open.d.ts +5 -0
  40. package/dist/types/src/operations/open.d.ts.map +1 -0
  41. package/dist/types/src/operations/scroll-into-view.d.ts +5 -0
  42. package/dist/types/src/operations/scroll-into-view.d.ts.map +1 -0
  43. package/dist/types/src/operations/set-layout-mode.d.ts +5 -0
  44. package/dist/types/src/operations/set-layout-mode.d.ts.map +1 -0
  45. package/dist/types/src/operations/switch-workspace.d.ts +5 -0
  46. package/dist/types/src/operations/switch-workspace.d.ts.map +1 -0
  47. package/dist/types/src/operations/update-complementary.d.ts +5 -0
  48. package/dist/types/src/operations/update-complementary.d.ts.map +1 -0
  49. package/dist/types/src/operations/update-dialog.d.ts +5 -0
  50. package/dist/types/src/operations/update-dialog.d.ts.map +1 -0
  51. package/dist/types/src/operations/update-popover.d.ts +5 -0
  52. package/dist/types/src/operations/update-popover.d.ts.map +1 -0
  53. package/dist/types/src/operations/update-sidebar.d.ts +5 -0
  54. package/dist/types/src/operations/update-sidebar.d.ts.map +1 -0
  55. package/dist/types/src/operations/update-state.d.ts +5 -0
  56. package/dist/types/src/operations/update-state.d.ts.map +1 -0
  57. package/dist/types/src/types/capabilities.d.ts +27 -0
  58. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  59. package/dist/types/src/types/index.d.ts +2 -0
  60. package/dist/types/src/types/index.d.ts.map +1 -0
  61. package/dist/types/tsconfig.tsbuildinfo +1 -0
  62. package/package.json +37 -17
  63. package/src/StorybookPlugin.ts +20 -17
  64. package/src/capabilities/index.ts +8 -2
  65. package/src/capabilities/operation-handler.ts +16 -0
  66. package/src/capabilities/state.tsx +42 -0
  67. package/src/components/Layout/Layout.tsx +236 -0
  68. package/src/components/Layout/index.ts +5 -0
  69. package/src/core.ts +20 -16
  70. package/src/harness.ts +52 -0
  71. package/src/index.ts +6 -1
  72. package/src/meta.ts +1 -1
  73. package/src/operations/add-toast.ts +22 -0
  74. package/src/operations/close.ts +14 -0
  75. package/src/operations/index.ts +18 -0
  76. package/src/operations/open.ts +18 -0
  77. package/src/operations/scroll-into-view.ts +14 -0
  78. package/src/operations/set-layout-mode.ts +14 -0
  79. package/src/operations/switch-workspace.ts +20 -0
  80. package/src/operations/update-complementary.ts +27 -0
  81. package/src/operations/update-dialog.ts +27 -0
  82. package/src/operations/update-popover.ts +37 -0
  83. package/src/operations/update-sidebar.ts +26 -0
  84. package/src/operations/update-state.ts +17 -0
  85. package/src/types/capabilities.ts +11 -3
  86. package/src/capabilities/operation-resolver/index.ts +0 -7
  87. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -82
  88. package/src/capabilities/state/index.ts +0 -7
  89. package/src/capabilities/state/state.tsx +0 -53
  90. package/src/components/Layout.tsx +0 -132
@@ -0,0 +1,14 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { LayoutOperation } from '@dxos/app-toolkit';
8
+ import { Operation } from '@dxos/compute';
9
+
10
+ const handler: Operation.WithHandler<typeof LayoutOperation.ScrollIntoView> = LayoutOperation.ScrollIntoView.pipe(
11
+ Operation.withHandler(() => Effect.void),
12
+ );
13
+
14
+ export default handler;
@@ -0,0 +1,14 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { LayoutOperation } from '@dxos/app-toolkit';
8
+ import { Operation } from '@dxos/compute';
9
+
10
+ const handler: Operation.WithHandler<typeof LayoutOperation.SetLayoutMode> = LayoutOperation.SetLayoutMode.pipe(
11
+ Operation.withHandler(() => Effect.void),
12
+ );
13
+
14
+ export default handler;
@@ -0,0 +1,20 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { LayoutOperation } from '@dxos/app-toolkit';
8
+ import { Operation } from '@dxos/compute';
9
+
10
+ import { updateState } from './update-state';
11
+
12
+ const handler: Operation.WithHandler<typeof LayoutOperation.SwitchWorkspace> = LayoutOperation.SwitchWorkspace.pipe(
13
+ Operation.withHandler(
14
+ Effect.fnUntraced(function* ({ subject }) {
15
+ yield* updateState(() => ({ workspace: subject }));
16
+ }),
17
+ ),
18
+ );
19
+
20
+ export default handler;
@@ -0,0 +1,27 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { LayoutOperation } from '@dxos/app-toolkit';
8
+ import { Operation } from '@dxos/compute';
9
+
10
+ import { updateState } from './update-state';
11
+
12
+ const handler: Operation.WithHandler<typeof LayoutOperation.UpdateComplementary> =
13
+ LayoutOperation.UpdateComplementary.pipe(
14
+ Operation.withHandler(
15
+ Effect.fnUntraced(function* ({ state }) {
16
+ yield* updateState((layout) => {
17
+ const next = state ?? layout.complementarySidebarState;
18
+ if (next !== layout.complementarySidebarState) {
19
+ return { complementarySidebarState: next };
20
+ }
21
+ return {};
22
+ });
23
+ }),
24
+ ),
25
+ );
26
+
27
+ export default handler;
@@ -0,0 +1,27 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { LayoutOperation } from '@dxos/app-toolkit';
8
+ import { Operation } from '@dxos/compute';
9
+
10
+ import { updateState } from './update-state';
11
+
12
+ const handler: Operation.WithHandler<typeof LayoutOperation.UpdateDialog> = LayoutOperation.UpdateDialog.pipe(
13
+ Operation.withHandler(
14
+ Effect.fnUntraced(function* ({ subject, state, type, blockAlign, overlayClasses, overlayStyle, props }) {
15
+ yield* updateState(() => ({
16
+ dialogOpen: state ?? Boolean(subject),
17
+ dialogType: type ?? 'default',
18
+ dialogBlockAlign: blockAlign ?? 'center',
19
+ dialogOverlayClasses: overlayClasses,
20
+ dialogOverlayStyle: overlayStyle,
21
+ dialogContent: subject ? { component: subject, props } : null,
22
+ }));
23
+ }),
24
+ ),
25
+ );
26
+
27
+ export default handler;
@@ -0,0 +1,37 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { LayoutOperation } from '@dxos/app-toolkit';
8
+ import { Operation } from '@dxos/compute';
9
+
10
+ import { type LayoutStateProps } from '../types';
11
+ import { updateState } from './update-state';
12
+
13
+ const handler: Operation.WithHandler<typeof LayoutOperation.UpdatePopover> = LayoutOperation.UpdatePopover.pipe(
14
+ Operation.withHandler(
15
+ Effect.fnUntraced(function* (input) {
16
+ const { subject, state, side, kind, props } = input;
17
+ yield* updateState(() => {
18
+ const base: Partial<LayoutStateProps> = {
19
+ popoverKind: kind ?? 'base',
20
+ popoverTitle: kind === 'card' ? input.title : undefined,
21
+ popoverContent:
22
+ typeof subject === 'string' ? { component: subject, props } : subject ? { subject } : undefined,
23
+ popoverOpen: state ?? Boolean(subject),
24
+ popoverSide: side,
25
+ };
26
+ if ('variant' in input && input.variant === 'virtual') {
27
+ return { ...base, popoverVariant: 'virtual', popoverAnchor: input.anchor };
28
+ } else if ('anchorId' in input) {
29
+ return { ...base, popoverVariant: 'react', popoverAnchorId: input.anchorId };
30
+ }
31
+ return base;
32
+ });
33
+ }),
34
+ ),
35
+ );
36
+
37
+ export default handler;
@@ -0,0 +1,26 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { LayoutOperation } from '@dxos/app-toolkit';
8
+ import { Operation } from '@dxos/compute';
9
+
10
+ import { updateState } from './update-state';
11
+
12
+ const handler: Operation.WithHandler<typeof LayoutOperation.UpdateSidebar> = LayoutOperation.UpdateSidebar.pipe(
13
+ Operation.withHandler(
14
+ Effect.fnUntraced(function* ({ state }) {
15
+ yield* updateState((layout) => {
16
+ const next = state ?? layout.sidebarState;
17
+ if (next !== layout.sidebarState) {
18
+ return { sidebarState: next };
19
+ }
20
+ return {};
21
+ });
22
+ }),
23
+ ),
24
+ );
25
+
26
+ export default handler;
@@ -0,0 +1,17 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capabilities, Capability } from '@dxos/app-framework';
8
+
9
+ import { LayoutState, type LayoutStateProps } from '../types';
10
+
11
+ export const updateState = (fn: (state: LayoutStateProps) => Partial<LayoutStateProps>) =>
12
+ Effect.gen(function* () {
13
+ const registry = yield* Capability.get(Capabilities.AtomRegistry);
14
+ const stateAtom = yield* Capability.get(LayoutState);
15
+ const current = registry.get(stateAtom);
16
+ registry.set(stateAtom, { ...current, ...fn(current) });
17
+ });
@@ -2,11 +2,15 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import { type Atom } from '@effect-atom/atom-react';
6
+
5
7
  import { Capability } from '@dxos/app-framework';
8
+ import { type LayoutOperation } from '@dxos/app-toolkit';
9
+ import { type Label } from '@dxos/react-ui';
6
10
 
7
- import { meta } from '../meta';
11
+ import { meta } from '#meta';
8
12
 
9
- export type LayoutState = {
13
+ export type LayoutStateProps = {
10
14
  sidebarState?: 'expanded' | 'collapsed' | 'closed';
11
15
  complementarySidebarState?: 'expanded' | 'collapsed' | 'closed';
12
16
 
@@ -23,9 +27,13 @@ export type LayoutState = {
23
27
  popoverVariant?: 'virtual' | 'react';
24
28
  popoverAnchor?: HTMLButtonElement;
25
29
  popoverAnchorId?: string;
30
+ popoverKind?: 'base' | 'card';
31
+ popoverTitle?: Label;
26
32
  popoverContent?: any;
27
33
 
34
+ toasts: LayoutOperation.Toast[];
35
+
28
36
  workspace: string;
29
37
  };
30
38
 
31
- export const LayoutState = Capability.make<LayoutState>(`${meta.id}/state`);
39
+ export const LayoutState = Capability.make<Atom.Writable<LayoutStateProps>>(`${meta.id}.state`);
@@ -1,7 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Capability } from '@dxos/app-framework';
6
-
7
- export const OperationResolver = Capability.lazy('OperationResolver', () => import('./operation-resolver'));
@@ -1,82 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import * as Effect from 'effect/Effect';
6
-
7
- import { Capability, Common } from '@dxos/app-framework';
8
- import { OperationResolver } from '@dxos/operation';
9
-
10
- import { LayoutState } from '../../types';
11
-
12
- export default Capability.makeModule(
13
- Effect.fnUntraced(function* () {
14
- return Capability.contributes(Common.Capability.OperationResolver, [
15
- OperationResolver.make({
16
- operation: Common.LayoutOperation.UpdateSidebar,
17
- handler: Effect.fnUntraced(function* ({ state }) {
18
- const layout = yield* Capability.get(LayoutState);
19
- const next = state ?? layout.sidebarState;
20
- if (next !== layout.sidebarState) {
21
- layout.sidebarState = next;
22
- }
23
- }),
24
- }),
25
- OperationResolver.make({
26
- operation: Common.LayoutOperation.UpdateComplementary,
27
- handler: Effect.fnUntraced(function* ({ state }) {
28
- const layout = yield* Capability.get(LayoutState);
29
- const next = state ?? layout.complementarySidebarState;
30
- if (next !== layout.complementarySidebarState) {
31
- layout.complementarySidebarState = next;
32
- }
33
- }),
34
- }),
35
- OperationResolver.make({
36
- operation: Common.LayoutOperation.UpdateDialog,
37
- handler: Effect.fnUntraced(function* ({
38
- subject,
39
- state,
40
- type,
41
- blockAlign,
42
- overlayClasses,
43
- overlayStyle,
44
- props,
45
- }) {
46
- const layout = yield* Capability.get(LayoutState);
47
- layout.dialogOpen = state ?? Boolean(subject);
48
- layout.dialogType = type ?? 'default';
49
- layout.dialogBlockAlign = blockAlign ?? 'center';
50
- layout.dialogOverlayClasses = overlayClasses;
51
- layout.dialogOverlayStyle = overlayStyle;
52
- layout.dialogContent = subject ? { component: subject, props } : null;
53
- }),
54
- }),
55
- OperationResolver.make({
56
- operation: Common.LayoutOperation.UpdatePopover,
57
- handler: Effect.fnUntraced(function* (input) {
58
- const layout = yield* Capability.get(LayoutState);
59
- const { subject, state, side, props } = input;
60
- layout.popoverContent =
61
- typeof subject === 'string' ? { component: subject, props } : subject ? { subject } : undefined;
62
- layout.popoverOpen = state ?? Boolean(subject);
63
- layout.popoverSide = side;
64
- if ('variant' in input && input.variant === 'virtual') {
65
- layout.popoverVariant = 'virtual';
66
- layout.popoverAnchor = input.anchor;
67
- } else if ('anchorId' in input) {
68
- layout.popoverVariant = 'react';
69
- layout.popoverAnchorId = input.anchorId;
70
- }
71
- }),
72
- }),
73
- OperationResolver.make({
74
- operation: Common.LayoutOperation.SwitchWorkspace,
75
- handler: Effect.fnUntraced(function* ({ subject }) {
76
- const layout = yield* Capability.get(LayoutState);
77
- layout.workspace = subject;
78
- }),
79
- }),
80
- ]);
81
- }),
82
- );
@@ -1,7 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Capability } from '@dxos/app-framework';
6
-
7
- export const State = Capability.lazy('State', () => import('./state'));
@@ -1,53 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import * as Effect from 'effect/Effect';
6
-
7
- import { Capability, Common } from '@dxos/app-framework';
8
- import { live } from '@dxos/live-object';
9
-
10
- import { LayoutState } from '../../types';
11
-
12
- const defaultState: LayoutState = {
13
- sidebarState: 'closed',
14
- complementarySidebarState: 'closed',
15
- dialogOpen: false,
16
- workspace: 'default',
17
- };
18
-
19
- export default Capability.makeModule(
20
- Effect.fnUntraced(function* (props?: { initialState?: Partial<LayoutState> }) {
21
- const { initialState } = props ?? {};
22
- const state = live<LayoutState>({ ...defaultState, ...initialState });
23
-
24
- const layout = live<Common.Capability.Layout>({
25
- get mode() {
26
- return 'storybook';
27
- },
28
- get dialogOpen() {
29
- return state.dialogOpen;
30
- },
31
- get sidebarOpen() {
32
- return state.sidebarState === 'expanded';
33
- },
34
- get complementarySidebarOpen() {
35
- return state.complementarySidebarState === 'expanded';
36
- },
37
- get workspace() {
38
- return state.workspace;
39
- },
40
- get active() {
41
- return [];
42
- },
43
- get inactive() {
44
- return [];
45
- },
46
- get scrollIntoView() {
47
- return undefined;
48
- },
49
- });
50
-
51
- return [Capability.contributes(LayoutState, state), Capability.contributes(Common.Capability.Layout, layout)];
52
- }),
53
- );
@@ -1,132 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React, { type PropsWithChildren, useCallback, useEffect, useRef, useState } from 'react';
6
-
7
- import { Surface, useCapability } from '@dxos/app-framework/react';
8
- import {
9
- AlertDialog,
10
- Dialog,
11
- Main,
12
- Popover,
13
- type PopoverContentInteractOutsideEvent,
14
- useTranslation,
15
- } from '@dxos/react-ui';
16
- import { descriptionMessage, mx } from '@dxos/ui-theme';
17
-
18
- import { meta } from '../meta';
19
- import { LayoutState } from '../types';
20
-
21
- const debounce_delay = 100;
22
-
23
- // TODO(wittjosiah): Support dialogs, tooltips, maybe toast.
24
- export const Layout = ({ children }: PropsWithChildren<{}>) => {
25
- const trigger = useRef<HTMLButtonElement | null>(null);
26
- const layout = useCapability(LayoutState);
27
- const [iter, setIter] = useState(0);
28
- const [open, setOpen] = useState(false);
29
- const debounceRef = useRef<NodeJS.Timeout | null>(null);
30
-
31
- useEffect(() => {
32
- setOpen(false);
33
- if (debounceRef.current) {
34
- clearTimeout(debounceRef.current);
35
- debounceRef.current = null;
36
- }
37
- trigger.current = layout.popoverAnchor ?? null;
38
- setIter((iter) => iter + 1);
39
- if (layout.popoverOpen) {
40
- debounceRef.current = setTimeout(() => setOpen(true), debounce_delay);
41
- }
42
- }, [layout.popoverAnchor, layout.popoverContent, layout.popoverOpen]);
43
-
44
- const handleInteractOutside = useCallback((event: KeyboardEvent | PopoverContentInteractOutsideEvent) => {
45
- if (
46
- // TODO(thure): CodeMirror should not focus itself when it updates.
47
- event.type === 'dismissableLayer.focusOutside' &&
48
- (event.currentTarget as HTMLElement | undefined)?.classList.contains('cm-content')
49
- ) {
50
- event.preventDefault();
51
- } else {
52
- setOpen(false);
53
- layout.popoverOpen = false;
54
- layout.popoverAnchor = undefined;
55
- layout.popoverAnchorId = undefined;
56
- layout.popoverSide = undefined;
57
- }
58
- }, []);
59
-
60
- const DialogRoot = layout.dialogType === 'alert' ? AlertDialog.Root : Dialog.Root;
61
- const DialogOverlay = layout.dialogType === 'alert' ? AlertDialog.Overlay : Dialog.Overlay;
62
-
63
- return (
64
- <div role='none' className='fixed inset-0 flex overflow-hidden'>
65
- <Popover.Root open={open}>
66
- <Main.Root
67
- navigationSidebarState={layout.sidebarState}
68
- complementarySidebarState={layout.complementarySidebarState}
69
- onNavigationSidebarStateChange={(next) => (layout.sidebarState = next)}
70
- onComplementarySidebarStateChange={(next) => (layout.complementarySidebarState = next)}
71
- >
72
- {children}
73
- </Main.Root>
74
-
75
- <DialogRoot
76
- modal={layout.dialogBlockAlign !== 'end'}
77
- open={layout.dialogOpen}
78
- onOpenChange={(nextOpen) => (layout.dialogOpen = nextOpen)}
79
- >
80
- {layout.dialogBlockAlign === 'end' ? (
81
- <Surface
82
- role='dialog'
83
- data={layout.dialogContent}
84
- limit={1}
85
- fallback={ContentError}
86
- placeholder={<div />}
87
- />
88
- ) : (
89
- <DialogOverlay
90
- blockAlign={layout.dialogBlockAlign}
91
- classNames={layout.dialogOverlayClasses}
92
- style={layout.dialogOverlayStyle}
93
- >
94
- <Surface role='dialog' data={layout.dialogContent} limit={1} fallback={ContentError} />
95
- </DialogOverlay>
96
- )}
97
- </DialogRoot>
98
-
99
- <Popover.VirtualTrigger key={iter} virtualRef={trigger} />
100
- <Popover.Portal>
101
- <Popover.Content
102
- side={layout.popoverSide}
103
- onInteractOutside={handleInteractOutside}
104
- onEscapeKeyDown={handleInteractOutside}
105
- sticky='always'
106
- hideWhenDetached
107
- >
108
- <Popover.Viewport>
109
- <Surface role='card--popover' data={layout.popoverContent} limit={1} />
110
- </Popover.Viewport>
111
- <Popover.Arrow />
112
- </Popover.Content>
113
- </Popover.Portal>
114
- </Popover.Root>
115
- </div>
116
- );
117
- };
118
-
119
- export const ContentError = ({ error }: { error?: Error }) => {
120
- const { t } = useTranslation(meta.id);
121
- const errorString = error?.toString() ?? '';
122
- return (
123
- <div role='none' className='overflow-auto p-8 attention-surface grid place-items-center'>
124
- <p
125
- role='alert'
126
- className={mx(descriptionMessage, 'break-words rounded-md p-8', errorString.length < 256 && 'text-lg')}
127
- >
128
- {error ? errorString : t('error fallback message')}
129
- </p>
130
- </div>
131
- );
132
- };