@dxos/plugin-simple-layout 0.0.0
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/LICENSE +8 -0
- package/package.json +66 -0
- package/src/SimpleLayoutPlugin.ts +31 -0
- package/src/capabilities/index.ts +7 -0
- package/src/capabilities/operation-resolver/index.ts +10 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +135 -0
- package/src/capabilities/react-root/index.ts +7 -0
- package/src/capabilities/react-root/react-root.tsx +22 -0
- package/src/capabilities/state/index.ts +9 -0
- package/src/capabilities/state/state.tsx +60 -0
- package/src/components/ContentError.stories.tsx +41 -0
- package/src/components/ContentError.tsx +23 -0
- package/src/components/ContentLoading.stories.tsx +24 -0
- package/src/components/ContentLoading.tsx +10 -0
- package/src/components/Dialog/Dialog.tsx +38 -0
- package/src/components/Dialog/index.ts +5 -0
- package/src/components/Home/Home.tsx +138 -0
- package/src/components/Home/index.ts +5 -0
- package/src/components/Popover/Popover.tsx +102 -0
- package/src/components/Popover/index.ts +5 -0
- package/src/components/SimpleLayout/Banner.tsx +60 -0
- package/src/components/SimpleLayout/Main.tsx +85 -0
- package/src/components/SimpleLayout/NavBar.tsx +97 -0
- package/src/components/SimpleLayout/NavBarstories.tsx +59 -0
- package/src/components/SimpleLayout/SimpleLayout.stories.tsx +107 -0
- package/src/components/SimpleLayout/SimpleLayout.tsx +21 -0
- package/src/components/SimpleLayout/index.ts +5 -0
- package/src/components/index.ts +8 -0
- package/src/hooks/index.ts +5 -0
- package/src/hooks/useSpotlightDismiss.ts +95 -0
- package/src/index.ts +5 -0
- package/src/meta.ts +16 -0
- package/src/translations.ts +28 -0
- package/src/types/capabilities.ts +37 -0
- package/src/types/index.ts +5 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Resource } from '@dxos/react-ui';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export const translations = [
|
|
10
|
+
{
|
|
11
|
+
'en-US': {
|
|
12
|
+
[meta.id]: {
|
|
13
|
+
'plugin name': 'Simple layout',
|
|
14
|
+
'settings title': 'Simple layout settings',
|
|
15
|
+
'workspaces heading': 'Workspaces',
|
|
16
|
+
'settings heading': 'Settings',
|
|
17
|
+
'back label': 'Back',
|
|
18
|
+
'browse label': 'Browse',
|
|
19
|
+
'notifications label': 'Notifications',
|
|
20
|
+
'profile label': 'Profile',
|
|
21
|
+
'app menu label': 'App menu',
|
|
22
|
+
'main menu label': 'Main menu',
|
|
23
|
+
'error fallback message': 'An error occurred',
|
|
24
|
+
'search placeholder': 'Search...',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
] as const satisfies Resource[];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from '../meta';
|
|
8
|
+
|
|
9
|
+
// TODO(wittjosiah): Handle toasts.
|
|
10
|
+
export type SimpleLayoutState = {
|
|
11
|
+
/** Data to be passed to the main content Surface. */
|
|
12
|
+
content?: any;
|
|
13
|
+
|
|
14
|
+
dialogOpen: boolean;
|
|
15
|
+
dialogType?: 'default' | 'alert';
|
|
16
|
+
dialogBlockAlign?: 'start' | 'center' | 'end';
|
|
17
|
+
dialogOverlayClasses?: string;
|
|
18
|
+
dialogOverlayStyle?: Record<string, any>;
|
|
19
|
+
/** Data to be passed to the dialog Surface. */
|
|
20
|
+
dialogContent?: any;
|
|
21
|
+
|
|
22
|
+
popoverOpen?: boolean;
|
|
23
|
+
popoverSide?: 'top' | 'right' | 'bottom' | 'left';
|
|
24
|
+
popoverVariant?: 'virtual' | 'react';
|
|
25
|
+
popoverAnchor?: HTMLButtonElement;
|
|
26
|
+
popoverAnchorId?: string;
|
|
27
|
+
popoverContent?: any;
|
|
28
|
+
|
|
29
|
+
workspace: string;
|
|
30
|
+
previousWorkspace: string;
|
|
31
|
+
active?: string;
|
|
32
|
+
|
|
33
|
+
/** Whether running in popover window context (hides mobile-specific UI). */
|
|
34
|
+
isPopover?: boolean;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const SimpleLayoutState = Capability.make<SimpleLayoutState>(`${meta.id}/state`);
|