@dxos/plugin-simple-layout 0.8.4-main.fcc0d83b33 → 0.8.4-staging.60fe92afc8
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 +102 -5
- package/dist/lib/{node-esm/index.mjs → neutral/SimpleLayoutPlugin.mjs} +6 -4
- package/dist/lib/{node-esm/index.mjs.map → neutral/SimpleLayoutPlugin.mjs.map} +3 -3
- package/dist/lib/neutral/app-graph-builder-MSPO34DT.mjs +21 -0
- package/dist/lib/neutral/app-graph-builder-MSPO34DT.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +21 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-7UDV3JDT.mjs +22 -0
- package/dist/lib/neutral/chunk-7UDV3JDT.mjs.map +7 -0
- package/dist/lib/neutral/chunk-FD2CAY4Q.mjs +26 -0
- package/dist/lib/neutral/chunk-FD2CAY4Q.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/neutral/chunk-NKAPURKM.mjs +8 -0
- package/dist/lib/neutral/chunk-NKAPURKM.mjs.map +7 -0
- package/dist/lib/neutral/chunk-OK5336TS.mjs +22 -0
- package/dist/lib/neutral/chunk-OK5336TS.mjs.map +7 -0
- package/dist/lib/neutral/close-WKMURGUB.mjs +35 -0
- package/dist/lib/neutral/close-WKMURGUB.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +929 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +332 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +14 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/open-Y4KNROHW.mjs +62 -0
- package/dist/lib/neutral/open-Y4KNROHW.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-EAIE7KPR.mjs +13 -0
- package/dist/lib/neutral/operation-handler-EAIE7KPR.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-root-VE265VX4.mjs +18 -0
- package/dist/lib/neutral/react-root-VE265VX4.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-N3PGKIYV.mjs +46 -0
- package/dist/lib/neutral/react-surface-N3PGKIYV.mjs.map +7 -0
- package/dist/lib/neutral/revert-workspace-ST6NZUNG.mjs +22 -0
- package/dist/lib/neutral/revert-workspace-ST6NZUNG.mjs.map +7 -0
- package/dist/lib/neutral/set-6ZRLWPJS.mjs +22 -0
- package/dist/lib/neutral/set-6ZRLWPJS.mjs.map +7 -0
- package/dist/lib/neutral/set-layout-mode-L22HRCKS.mjs +13 -0
- package/dist/lib/neutral/set-layout-mode-L22HRCKS.mjs.map +7 -0
- package/dist/lib/neutral/spotlight-dismiss-EIYW5E7M.mjs +58 -0
- package/dist/lib/neutral/spotlight-dismiss-EIYW5E7M.mjs.map +7 -0
- package/dist/lib/neutral/state-7NXKBLPY.mjs +47 -0
- package/dist/lib/neutral/state-7NXKBLPY.mjs.map +7 -0
- package/dist/lib/neutral/switch-workspace-PYWPTMFO.mjs +25 -0
- package/dist/lib/neutral/switch-workspace-PYWPTMFO.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/translations.mjs +2 -0
- package/dist/lib/neutral/types/index.mjs +10 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/lib/neutral/update-complementary-HKWF5OXT.mjs +33 -0
- package/dist/lib/neutral/update-complementary-HKWF5OXT.mjs.map +7 -0
- package/dist/lib/neutral/update-dialog-P4ASXCE7.mjs +30 -0
- package/dist/lib/neutral/update-dialog-P4ASXCE7.mjs.map +7 -0
- package/dist/lib/neutral/update-popover-REAKC2GN.mjs +34 -0
- package/dist/lib/neutral/update-popover-REAKC2GN.mjs.map +7 -0
- package/dist/lib/neutral/update-sidebar-O5SQPR6Q.mjs +12 -0
- package/dist/lib/neutral/update-sidebar-O5SQPR6Q.mjs.map +7 -0
- package/dist/lib/neutral/url-handler-DGZ4WISE.mjs +129 -0
- package/dist/lib/neutral/url-handler-DGZ4WISE.mjs.map +7 -0
- package/dist/types/src/SimpleLayoutPlugin.d.ts +1 -0
- package/dist/types/src/SimpleLayoutPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts +3 -3
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/MobileLayout/MobileLayout.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/AppBar.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/NavBar.d.ts.map +1 -1
- package/dist/types/src/hooks/actions.d.ts +3 -3
- package/dist/types/src/hooks/actions.d.ts.map +1 -1
- package/dist/types/src/hooks/useSimpleLayoutState.d.ts +3 -3
- package/dist/types/src/hooks/useSimpleLayoutState.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/open.d.ts.map +1 -1
- package/dist/types/src/operations/state-access.d.ts +3 -3
- package/dist/types/src/operations/state-access.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/types/{capabilities.d.ts → SimpleLayoutCapabilities.d.ts} +2 -8
- package/dist/types/src/types/SimpleLayoutCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/SimpleLayoutEvents.d.ts +4 -0
- package/dist/types/src/types/SimpleLayoutEvents.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +81 -48
- package/src/SimpleLayoutPlugin.ts +3 -1
- package/src/capabilities/app-graph-builder.ts +1 -1
- package/src/capabilities/react-surface.tsx +3 -3
- package/src/capabilities/state.tsx +5 -6
- package/src/capabilities/url-handler.ts +18 -15
- package/src/components/Home/Home.tsx +3 -3
- package/src/components/Loading/Loading.tsx +1 -1
- package/src/components/MobileLayout/MobileLayout.tsx +0 -2
- package/src/components/NavBranch/NavBranch.tsx +3 -3
- package/src/components/Popover/Popover.tsx +7 -5
- package/src/components/SimpleLayout/AppBar.tsx +44 -41
- package/src/components/SimpleLayout/NavBar.tsx +1 -1
- package/src/components/SimpleLayout/SimpleLayout.stories.tsx +3 -3
- package/src/hooks/actions.ts +6 -4
- package/src/hooks/useAppBarProps.ts +2 -2
- package/src/hooks/useDrawerActions.ts +2 -2
- package/src/hooks/useNavbarActions.ts +2 -2
- package/src/hooks/useSimpleLayoutState.ts +7 -5
- package/src/index.ts +2 -1
- package/src/meta.ts +7 -4
- package/src/operations/open.ts +24 -5
- package/src/operations/state-access.ts +5 -3
- package/src/plugin.ts +11 -0
- package/src/types/{capabilities.ts → SimpleLayoutCapabilities.ts} +3 -15
- package/src/types/SimpleLayoutEvents.ts +15 -0
- package/src/types/index.ts +2 -2
- package/dist/lib/browser/index.mjs +0 -48
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/translations.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/translations.mjs +0 -36
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/dist/types/src/types/events.d.ts +0 -6
- package/dist/types/src/types/events.d.ts.map +0 -1
- package/src/types/events.ts +0 -15
- /package/dist/lib/{node-esm → neutral}/translations.mjs.map +0 -0
|
@@ -7,20 +7,22 @@ import { useCallback, useContext } from 'react';
|
|
|
7
7
|
|
|
8
8
|
import { useCapability } from '@dxos/app-framework/ui';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { SimpleLayoutCapabilities } from '#types';
|
|
11
11
|
|
|
12
12
|
export type UseSimpleLayoutState = {
|
|
13
|
-
state: SimpleLayoutState;
|
|
14
|
-
updateState: (
|
|
13
|
+
state: SimpleLayoutCapabilities.SimpleLayoutState;
|
|
14
|
+
updateState: (
|
|
15
|
+
fn: (current: SimpleLayoutCapabilities.SimpleLayoutState) => SimpleLayoutCapabilities.SimpleLayoutState,
|
|
16
|
+
) => void;
|
|
15
17
|
};
|
|
16
18
|
|
|
17
19
|
export const useSimpleLayoutState = (): UseSimpleLayoutState => {
|
|
18
20
|
const registry = useContext(RegistryContext);
|
|
19
|
-
const stateAtom = useCapability(
|
|
21
|
+
const stateAtom = useCapability(SimpleLayoutCapabilities.State);
|
|
20
22
|
const state = useAtomValue(stateAtom);
|
|
21
23
|
|
|
22
24
|
const updateState = useCallback(
|
|
23
|
-
(fn: (current: SimpleLayoutState) => SimpleLayoutState) => {
|
|
25
|
+
(fn: (current: SimpleLayoutCapabilities.SimpleLayoutState) => SimpleLayoutCapabilities.SimpleLayoutState) => {
|
|
24
26
|
registry.set(stateAtom, fn(registry.get(stateAtom)));
|
|
25
27
|
},
|
|
26
28
|
[registry, stateAtom],
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -2,15 +2,18 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { DXN } from '@dxos/keys';
|
|
6
7
|
import { trim } from '@dxos/util';
|
|
7
8
|
|
|
8
|
-
export const meta
|
|
9
|
-
|
|
9
|
+
export const meta = Plugin.makeMeta({
|
|
10
|
+
key: DXN.make('org.dxos.plugin.simpleLayout'),
|
|
10
11
|
name: 'Simple Layout',
|
|
12
|
+
author: 'DXOS',
|
|
11
13
|
description: trim`
|
|
12
14
|
Minimal layout plugin for simplified UI contexts like popover windows.
|
|
13
15
|
Provides basic content rendering without sidebars or complex navigation.
|
|
14
16
|
`,
|
|
15
17
|
icon: 'ph--layout--regular',
|
|
16
|
-
|
|
18
|
+
tags: ['system'],
|
|
19
|
+
});
|
package/src/operations/open.ts
CHANGED
|
@@ -11,13 +11,16 @@ import {
|
|
|
11
11
|
} from '@dxos/app-toolkit';
|
|
12
12
|
import { Operation } from '@dxos/compute';
|
|
13
13
|
import { Context } from '@dxos/context';
|
|
14
|
-
import {
|
|
14
|
+
import { Database, EID } from '@dxos/echo';
|
|
15
|
+
import { log } from '@dxos/log';
|
|
16
|
+
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
15
17
|
|
|
16
18
|
import { layoutStateAccess } from './state-access';
|
|
17
19
|
|
|
18
20
|
const handler: Operation.WithHandler<typeof LayoutOperation.Open> = LayoutOperation.Open.pipe(
|
|
19
21
|
Operation.withHandler(
|
|
20
22
|
Effect.fnUntraced(function* (input) {
|
|
23
|
+
log('LayoutOperation.Open handler start');
|
|
21
24
|
const { graph } = yield* Capability.get(AppCapabilities.AppGraph);
|
|
22
25
|
const { updateState } = yield* layoutStateAccess;
|
|
23
26
|
const id = input.subject[0];
|
|
@@ -25,12 +28,27 @@ const handler: Operation.WithHandler<typeof LayoutOperation.Open> = LayoutOperat
|
|
|
25
28
|
// Validate navigation target, redirecting to 404 if not found.
|
|
26
29
|
const capabilities = yield* Capability.Service;
|
|
27
30
|
const pathResolvers = capabilities.getAll(AppCapabilities.NavigationPathResolver);
|
|
28
|
-
const
|
|
29
|
-
Effect.map((client) =>
|
|
30
|
-
createEdgeExistenceChecker((spaceId, body) => client.edge.http.execQuery(new Context(), spaceId, body)),
|
|
31
|
-
),
|
|
31
|
+
const client = yield* Capability.get(ClientCapabilities.Client).pipe(
|
|
32
32
|
Effect.catchAll(() => Effect.succeed(undefined)),
|
|
33
33
|
);
|
|
34
|
+
// Existence checkers for the resolved EID: local (load + catchTag) first, then remote (edge).
|
|
35
|
+
const checkLocalExistence = client
|
|
36
|
+
? (uri: EID.EID) => {
|
|
37
|
+
const spaceId = EID.getSpaceId(uri);
|
|
38
|
+
const space = spaceId ? client.spaces.get(spaceId) : undefined;
|
|
39
|
+
if (!space) {
|
|
40
|
+
return Effect.succeed(false);
|
|
41
|
+
}
|
|
42
|
+
return Database.load(space.db.makeRef(uri)).pipe(
|
|
43
|
+
Effect.as(true),
|
|
44
|
+
Effect.catchTag('EntityNotFoundError', () => Effect.succeed(false)),
|
|
45
|
+
Effect.catchAll(() => Effect.succeed(false)),
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
: undefined;
|
|
49
|
+
const checkRemoteExistence = client
|
|
50
|
+
? createEdgeExistenceChecker((spaceId, body) => client.edge.http.execQuery(new Context(), spaceId, body))
|
|
51
|
+
: undefined;
|
|
34
52
|
|
|
35
53
|
const validatedId =
|
|
36
54
|
input.navigation === 'immediate'
|
|
@@ -39,6 +57,7 @@ const handler: Operation.WithHandler<typeof LayoutOperation.Open> = LayoutOperat
|
|
|
39
57
|
graph,
|
|
40
58
|
subjectId: id,
|
|
41
59
|
pathResolvers,
|
|
60
|
+
checkLocalExistence,
|
|
42
61
|
checkRemoteExistence,
|
|
43
62
|
});
|
|
44
63
|
|
|
@@ -4,15 +4,17 @@ import * as Effect from 'effect/Effect';
|
|
|
4
4
|
|
|
5
5
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { SimpleLayoutCapabilities } from '../types';
|
|
8
8
|
|
|
9
9
|
export const layoutStateAccess = Effect.gen(function* () {
|
|
10
10
|
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
11
|
-
const stateAtom = yield* Capability.get(
|
|
11
|
+
const stateAtom = yield* Capability.get(SimpleLayoutCapabilities.State);
|
|
12
12
|
|
|
13
13
|
return {
|
|
14
14
|
getState: () => registry.get(stateAtom),
|
|
15
|
-
updateState: (
|
|
15
|
+
updateState: (
|
|
16
|
+
fn: (current: SimpleLayoutCapabilities.SimpleLayoutState) => SimpleLayoutCapabilities.SimpleLayoutState,
|
|
17
|
+
) => {
|
|
16
18
|
registry.set(stateAtom, fn(registry.get(stateAtom)));
|
|
17
19
|
},
|
|
18
20
|
};
|
package/src/plugin.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export const SimpleLayoutPlugin = Plugin.lazy(meta, () => import('#plugin'));
|
|
10
|
+
|
|
11
|
+
export { SimpleLayoutOperationHandlerSet } from './operations';
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
5
7
|
import { type Atom } from '@effect-atom/atom-react';
|
|
6
8
|
|
|
7
9
|
import { Capability } from '@dxos/app-framework';
|
|
@@ -11,23 +13,17 @@ import { meta } from '#meta';
|
|
|
11
13
|
|
|
12
14
|
export type DrawerState = 'closed' | 'open' | 'expanded';
|
|
13
15
|
|
|
14
|
-
// TODO(wittjosiah): Handle toasts.
|
|
15
16
|
export type SimpleLayoutState = {
|
|
16
|
-
/** Data to be passed to the main content Surface. */
|
|
17
17
|
content?: any;
|
|
18
|
-
|
|
19
18
|
previousWorkspace: string;
|
|
20
19
|
workspace: string;
|
|
21
20
|
active?: string;
|
|
22
|
-
|
|
23
21
|
dialogOpen: boolean;
|
|
24
22
|
dialogType?: 'default' | 'alert';
|
|
25
23
|
dialogBlockAlign?: 'start' | 'center' | 'end';
|
|
26
24
|
dialogOverlayClasses?: string;
|
|
27
25
|
dialogOverlayStyle?: Record<string, any>;
|
|
28
|
-
/** Data to be passed to the dialog Surface. */
|
|
29
26
|
dialogContent?: { component: string; props?: any } | null;
|
|
30
|
-
|
|
31
27
|
popoverOpen?: boolean;
|
|
32
28
|
popoverSide?: 'top' | 'right' | 'bottom' | 'left';
|
|
33
29
|
popoverVariant?: 'virtual' | 'react';
|
|
@@ -36,18 +32,10 @@ export type SimpleLayoutState = {
|
|
|
36
32
|
popoverKind?: 'base' | 'card';
|
|
37
33
|
popoverTitle?: Label;
|
|
38
34
|
popoverContent?: { component: string; props?: any } | { subject: any } | null;
|
|
39
|
-
|
|
40
|
-
/** Bottom drawer state. */
|
|
41
35
|
drawerState: DrawerState;
|
|
42
|
-
|
|
43
|
-
/** Stack of previously active item IDs for back navigation. */
|
|
44
36
|
history: string[];
|
|
45
|
-
|
|
46
|
-
/** Whether running in popover window context (hides mobile-specific UI). */
|
|
47
37
|
isPopover?: boolean;
|
|
48
|
-
|
|
49
|
-
/** Variant of the companion to display in the drawer (e.g., "comments", "assistant-chat"). */
|
|
50
38
|
companionVariant?: string;
|
|
51
39
|
};
|
|
52
40
|
|
|
53
|
-
export const
|
|
41
|
+
export const State = Capability.make<Atom.Writable<SimpleLayoutState>>(`${meta.id}.state`);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import { type ActivationEvent } from '@dxos/app-framework';
|
|
8
|
+
import { AppActivationEvents } from '@dxos/app-toolkit';
|
|
9
|
+
|
|
10
|
+
import * as SimpleLayoutCapabilities from './SimpleLayoutCapabilities';
|
|
11
|
+
|
|
12
|
+
/** Fired when State capability is ready. */
|
|
13
|
+
export const StateReady: ActivationEvent.ActivationEvent = AppActivationEvents.createStateEvent(
|
|
14
|
+
SimpleLayoutCapabilities.State.identifier,
|
|
15
|
+
);
|
package/src/types/index.ts
CHANGED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// src/SimpleLayoutPlugin.ts
|
|
2
|
-
import { ActivationEvent, ActivationEvents, Capability, Plugin } from "@dxos/app-framework";
|
|
3
|
-
import { AppActivationEvents, AppPlugin } from "@dxos/app-toolkit";
|
|
4
|
-
import { AppGraphBuilder, OperationHandler, ReactRoot, ReactSurface, SpotlightDismiss, State, UrlHandler } from "#capabilities";
|
|
5
|
-
import { meta } from "#meta";
|
|
6
|
-
import { translations } from "#translations";
|
|
7
|
-
import { SimpleLayoutEvents } from "#types";
|
|
8
|
-
var SimpleLayoutPlugin = Plugin.define(meta).pipe(AppPlugin.addAppGraphModule({
|
|
9
|
-
activate: AppGraphBuilder
|
|
10
|
-
}), AppPlugin.addOperationHandlerModule({
|
|
11
|
-
activate: OperationHandler
|
|
12
|
-
}), AppPlugin.addTranslationsModule({
|
|
13
|
-
translations
|
|
14
|
-
}), Plugin.addModule(({ isPopover = false }) => ({
|
|
15
|
-
id: Capability.getModuleTag(State),
|
|
16
|
-
activatesOn: ActivationEvents.Startup,
|
|
17
|
-
firesAfterActivation: [
|
|
18
|
-
SimpleLayoutEvents.StateReady,
|
|
19
|
-
AppActivationEvents.LayoutReady
|
|
20
|
-
],
|
|
21
|
-
activate: () => State({
|
|
22
|
-
initialState: {
|
|
23
|
-
isPopover
|
|
24
|
-
}
|
|
25
|
-
})
|
|
26
|
-
})), Plugin.addModule(({ isPopover = false }) => ({
|
|
27
|
-
id: Capability.getModuleTag(SpotlightDismiss),
|
|
28
|
-
activatesOn: ActivationEvents.Startup,
|
|
29
|
-
activate: () => SpotlightDismiss({
|
|
30
|
-
isPopover
|
|
31
|
-
})
|
|
32
|
-
})), Plugin.addModule({
|
|
33
|
-
id: Capability.getModuleTag(ReactRoot),
|
|
34
|
-
activatesOn: ActivationEvents.Startup,
|
|
35
|
-
activate: ReactRoot
|
|
36
|
-
}), Plugin.addModule({
|
|
37
|
-
id: Capability.getModuleTag(ReactSurface),
|
|
38
|
-
activatesOn: ActivationEvents.Startup,
|
|
39
|
-
activate: ReactSurface
|
|
40
|
-
}), Plugin.addModule({
|
|
41
|
-
id: Capability.getModuleTag(UrlHandler),
|
|
42
|
-
activatesOn: ActivationEvent.allOf(ActivationEvents.OperationInvokerReady, SimpleLayoutEvents.StateReady),
|
|
43
|
-
activate: UrlHandler
|
|
44
|
-
}), Plugin.make);
|
|
45
|
-
export {
|
|
46
|
-
SimpleLayoutPlugin
|
|
47
|
-
};
|
|
48
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/SimpleLayoutPlugin.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { ActivationEvent, ActivationEvents, Capability, Plugin } from '@dxos/app-framework';\nimport { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';\n\nimport {\n AppGraphBuilder,\n OperationHandler,\n ReactRoot,\n ReactSurface,\n SpotlightDismiss,\n State,\n UrlHandler,\n} from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\nimport { SimpleLayoutEvents } from '#types';\n\nexport type SimpleLayoutPluginOptions = {\n /** Determines if running in popover window context (hides mobile-specific UI). */\n isPopover?: boolean;\n};\n\nexport const SimpleLayoutPlugin = Plugin.define<SimpleLayoutPluginOptions>(meta).pipe(\n AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.addModule(({ isPopover = false }) => ({\n id: Capability.getModuleTag(State),\n activatesOn: ActivationEvents.Startup,\n firesAfterActivation: [SimpleLayoutEvents.StateReady, AppActivationEvents.LayoutReady],\n activate: () => State({ initialState: { isPopover } }),\n })),\n Plugin.addModule(({ isPopover = false }) => ({\n id: Capability.getModuleTag(SpotlightDismiss),\n activatesOn: ActivationEvents.Startup,\n activate: () => SpotlightDismiss({ isPopover }),\n })),\n Plugin.addModule({\n id: Capability.getModuleTag(ReactRoot),\n activatesOn: ActivationEvents.Startup,\n activate: ReactRoot,\n }),\n Plugin.addModule({\n id: Capability.getModuleTag(ReactSurface),\n activatesOn: ActivationEvents.Startup,\n activate: ReactSurface,\n }),\n Plugin.addModule({\n id: Capability.getModuleTag(UrlHandler),\n activatesOn: ActivationEvent.allOf(ActivationEvents.OperationInvokerReady, SimpleLayoutEvents.StateReady),\n activate: UrlHandler,\n }),\n Plugin.make,\n);\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,iBAAiBC,kBAAkBC,YAAYC,cAAc;AACtE,SAASC,qBAAqBC,iBAAiB;AAE/C,SACEC,iBACAC,kBACAC,WACAC,cACAC,kBACAC,OACAC,kBACK;AACP,SAASC,YAAY;AACrB,SAASC,oBAAoB;AAC7B,SAASC,0BAA0B;AAO5B,IAAMC,qBAAqBb,OAAOc,OAAkCJ,IAAAA,EAAMK,KAC/Eb,UAAUc,kBAAkB;EAAEC,UAAUd;AAAgB,CAAA,GACxDD,UAAUgB,0BAA0B;EAAED,UAAUb;AAAiB,CAAA,GACjEF,UAAUiB,sBAAsB;EAAER;AAAa,CAAA,GAC/CX,OAAOoB,UAAU,CAAC,EAAEC,YAAY,MAAK,OAAQ;EAC3CC,IAAIvB,WAAWwB,aAAaf,KAAAA;EAC5BgB,aAAa1B,iBAAiB2B;EAC9BC,sBAAsB;IAACd,mBAAmBe;IAAY1B,oBAAoB2B;;EAC1EX,UAAU,MAAMT,MAAM;IAAEqB,cAAc;MAAER;IAAU;EAAE,CAAA;AACtD,EAAA,GACArB,OAAOoB,UAAU,CAAC,EAAEC,YAAY,MAAK,OAAQ;EAC3CC,IAAIvB,WAAWwB,aAAahB,gBAAAA;EAC5BiB,aAAa1B,iBAAiB2B;EAC9BR,UAAU,MAAMV,iBAAiB;IAAEc;EAAU,CAAA;AAC/C,EAAA,GACArB,OAAOoB,UAAU;EACfE,IAAIvB,WAAWwB,aAAalB,SAAAA;EAC5BmB,aAAa1B,iBAAiB2B;EAC9BR,UAAUZ;AACZ,CAAA,GACAL,OAAOoB,UAAU;EACfE,IAAIvB,WAAWwB,aAAajB,YAAAA;EAC5BkB,aAAa1B,iBAAiB2B;EAC9BR,UAAUX;AACZ,CAAA,GACAN,OAAOoB,UAAU;EACfE,IAAIvB,WAAWwB,aAAad,UAAAA;EAC5Be,aAAa3B,gBAAgBiC,MAAMhC,iBAAiBiC,uBAAuBnB,mBAAmBe,UAAU;EACxGV,UAAUR;AACZ,CAAA,GACAT,OAAOgC,IAAI;",
|
|
6
|
-
"names": ["ActivationEvent", "ActivationEvents", "Capability", "Plugin", "AppActivationEvents", "AppPlugin", "AppGraphBuilder", "OperationHandler", "ReactRoot", "ReactSurface", "SpotlightDismiss", "State", "UrlHandler", "meta", "translations", "SimpleLayoutEvents", "SimpleLayoutPlugin", "define", "pipe", "addAppGraphModule", "activate", "addOperationHandlerModule", "addTranslationsModule", "addModule", "isPopover", "id", "getModuleTag", "activatesOn", "Startup", "firesAfterActivation", "StateReady", "LayoutReady", "initialState", "allOf", "OperationInvokerReady", "make"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"inputs":{"src/SimpleLayoutPlugin.ts":{"bytes":7032,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":402,"imports":[{"path":"src/SimpleLayoutPlugin.ts","kind":"import-statement","original":"./SimpleLayoutPlugin"}],"format":"esm"},"src/translations.ts":{"bytes":3537,"imports":[{"path":"@dxos/react-ui-search/translations","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3713},"dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["SimpleLayoutPlugin"],"entryPoint":"src/index.ts","inputs":{"src/SimpleLayoutPlugin.ts":{"bytesInOutput":1625},"src/index.ts":{"bytesInOutput":0}},"bytes":1722},"dist/lib/browser/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1667},"dist/lib/browser/translations.mjs":{"imports":[{"path":"@dxos/react-ui-search/translations","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"exports":["translations"],"entryPoint":"src/translations.ts","inputs":{"src/translations.ts":{"bytesInOutput":978}},"bytes":1070}}}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/translations.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\nimport { translations as searchTranslations } from '@dxos/react-ui-search/translations';\n\nimport { meta } from '#meta';\n\nexport const translations = [\n ...searchTranslations,\n {\n 'en-US': {\n [meta.id]: {\n 'plugin.name': 'Simple layout',\n 'settings.title': 'Simple layout settings',\n 'workspaces.heading': 'Workspaces',\n 'settings.heading': 'Settings',\n 'back.label': 'Back',\n 'browse.label': 'Browse',\n 'notifications.label': 'Notifications',\n 'profile.label': 'Profile',\n 'app-menu.label': 'App menu',\n 'main-menu.label': 'Main menu',\n 'companions-menu.label': 'Companions',\n 'error-fallback.message': 'An error occurred',\n 'drawer.label': 'Drawer',\n 'close-drawer.label': 'Close drawer',\n 'expand-drawer.label': 'Expand drawer',\n 'collapse-drawer.label': 'Collapse drawer',\n 'actions-menu.label': 'Actions',\n 'done.label': 'Done',\n },\n },\n },\n] as const satisfies Resource[];\n"],
|
|
5
|
-
"mappings": ";AAKA,SAASA,gBAAgBC,0BAA0B;AAEnD,SAASC,YAAY;AAEd,IAAMF,eAAe;KACvBC;EACH;IACE,SAAS;MACP,CAACC,KAAKC,EAAE,GAAG;QACT,eAAe;QACf,kBAAkB;QAClB,sBAAsB;QACtB,oBAAoB;QACpB,cAAc;QACd,gBAAgB;QAChB,uBAAuB;QACvB,iBAAiB;QACjB,kBAAkB;QAClB,mBAAmB;QACnB,yBAAyB;QACzB,0BAA0B;QAC1B,gBAAgB;QAChB,sBAAsB;QACtB,uBAAuB;QACvB,yBAAyB;QACzB,sBAAsB;QACtB,cAAc;MAChB;IACF;EACF;;",
|
|
6
|
-
"names": ["translations", "searchTranslations", "meta", "id"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"inputs":{"src/SimpleLayoutPlugin.ts":{"bytes":7032,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":402,"imports":[{"path":"src/SimpleLayoutPlugin.ts","kind":"import-statement","original":"./SimpleLayoutPlugin"}],"format":"esm"},"src/translations.ts":{"bytes":3537,"imports":[{"path":"@dxos/react-ui-search/translations","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3715},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["SimpleLayoutPlugin"],"entryPoint":"src/index.ts","inputs":{"src/SimpleLayoutPlugin.ts":{"bytesInOutput":1625},"src/index.ts":{"bytesInOutput":0}},"bytes":1815},"dist/lib/node-esm/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1669},"dist/lib/node-esm/translations.mjs":{"imports":[{"path":"@dxos/react-ui-search/translations","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"exports":["translations"],"entryPoint":"src/translations.ts","inputs":{"src/translations.ts":{"bytesInOutput":978}},"bytes":1163}}}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// src/translations.ts
|
|
4
|
-
import { translations as searchTranslations } from "@dxos/react-ui-search/translations";
|
|
5
|
-
import { meta } from "#meta";
|
|
6
|
-
var translations = [
|
|
7
|
-
...searchTranslations,
|
|
8
|
-
{
|
|
9
|
-
"en-US": {
|
|
10
|
-
[meta.id]: {
|
|
11
|
-
"plugin.name": "Simple layout",
|
|
12
|
-
"settings.title": "Simple layout settings",
|
|
13
|
-
"workspaces.heading": "Workspaces",
|
|
14
|
-
"settings.heading": "Settings",
|
|
15
|
-
"back.label": "Back",
|
|
16
|
-
"browse.label": "Browse",
|
|
17
|
-
"notifications.label": "Notifications",
|
|
18
|
-
"profile.label": "Profile",
|
|
19
|
-
"app-menu.label": "App menu",
|
|
20
|
-
"main-menu.label": "Main menu",
|
|
21
|
-
"companions-menu.label": "Companions",
|
|
22
|
-
"error-fallback.message": "An error occurred",
|
|
23
|
-
"drawer.label": "Drawer",
|
|
24
|
-
"close-drawer.label": "Close drawer",
|
|
25
|
-
"expand-drawer.label": "Expand drawer",
|
|
26
|
-
"collapse-drawer.label": "Collapse drawer",
|
|
27
|
-
"actions-menu.label": "Actions",
|
|
28
|
-
"done.label": "Done"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
];
|
|
33
|
-
export {
|
|
34
|
-
translations
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=translations.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../../src/types/capabilities.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAI5C,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;AAGzD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,qDAAqD;IACrD,OAAO,CAAC,EAAE,GAAG,CAAC;IAEd,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IACjC,gBAAgB,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAC9C,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACzC,+CAA+C;IAC/C,aAAa,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,GAAG,CAAA;KAAE,GAAG,IAAI,CAAC;IAE1D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAClD,cAAc,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IACrC,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,cAAc,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,GAAG,CAAA;KAAE,GAAG;QAAE,OAAO,EAAE,GAAG,CAAA;KAAE,GAAG,IAAI,CAAC;IAE9E,2BAA2B;IAC3B,WAAW,EAAE,WAAW,CAAC;IAEzB,+DAA+D;IAC/D,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,8FAA8F;IAC9F,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,iBAAiB,8EAAwE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/types/events.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAK3D,yBAAiB,kBAAkB,CAAC,CAAC;IACnC,wDAAwD;IACjD,MAAM,UAAU,EAAE,eAAe,CAAC,eAExC,CAAC;CACH"}
|
package/src/types/events.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type ActivationEvent } from '@dxos/app-framework';
|
|
6
|
-
import { AppActivationEvents } from '@dxos/app-toolkit';
|
|
7
|
-
|
|
8
|
-
import { SimpleLayoutState } from './capabilities';
|
|
9
|
-
|
|
10
|
-
export namespace SimpleLayoutEvents {
|
|
11
|
-
/** Fired when SimpleLayoutState capability is ready. */
|
|
12
|
-
export const StateReady: ActivationEvent.ActivationEvent = AppActivationEvents.createStateEvent(
|
|
13
|
-
SimpleLayoutState.identifier,
|
|
14
|
-
);
|
|
15
|
-
}
|
|
File without changes
|