@dxos/plugin-deck 0.8.2-main.fbd8ed0 → 0.8.2-staging.7ac8446
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/lib/browser/{app-graph-builder-R7COZ4A6.mjs → app-graph-builder-VYZ4IWI3.mjs} +15 -16
- package/dist/lib/browser/app-graph-builder-VYZ4IWI3.mjs.map +7 -0
- package/dist/lib/browser/{check-app-scheme-7AXGR6UT.mjs → check-app-scheme-SEYECDHI.mjs} +3 -2
- package/dist/lib/browser/check-app-scheme-SEYECDHI.mjs.map +7 -0
- package/dist/lib/browser/chunk-6ZSOFCPP.mjs +117 -0
- package/dist/lib/browser/chunk-6ZSOFCPP.mjs.map +7 -0
- package/dist/lib/browser/chunk-B4LOJUWW.mjs +24 -0
- package/dist/lib/browser/chunk-B4LOJUWW.mjs.map +7 -0
- package/dist/lib/browser/{chunk-KIGMELV2.mjs → chunk-FJBMNSUC.mjs} +336 -366
- package/dist/lib/browser/chunk-FJBMNSUC.mjs.map +7 -0
- package/dist/lib/browser/chunk-FLOVGNYB.mjs +81 -0
- package/dist/lib/browser/chunk-FLOVGNYB.mjs.map +7 -0
- package/dist/lib/browser/chunk-RJNCG4ND.mjs +154 -0
- package/dist/lib/browser/chunk-RJNCG4ND.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +5 -6
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/{intent-resolver-MAKOS57L.mjs → intent-resolver-UDYKO2QW.mjs} +89 -130
- package/dist/lib/browser/intent-resolver-UDYKO2QW.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-DGQVIHXP.mjs → react-root-XLXN2VEW.mjs} +6 -6
- package/dist/lib/browser/{react-surface-PXBXIOPU.mjs → react-surface-WNGMZL7I.mjs} +6 -6
- package/dist/lib/browser/{settings-UBWJF7J7.mjs → settings-HMDGSBGO.mjs} +6 -6
- package/dist/lib/browser/settings-HMDGSBGO.mjs.map +7 -0
- package/dist/lib/browser/{chunk-OF5RIATN.mjs → state-7TN26M42.mjs} +7 -10
- package/dist/lib/browser/state-7TN26M42.mjs.map +7 -0
- package/dist/lib/browser/{tools-IVPIPTVA.mjs → tools-SC6QEN7R.mjs} +7 -7
- package/dist/lib/browser/tools-SC6QEN7R.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +1 -1
- package/dist/lib/browser/{url-handler-JSYGSVSB.mjs → url-handler-ODG4B6NX.mjs} +4 -4
- package/dist/lib/browser/url-handler-ODG4B6NX.mjs.map +7 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +179 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +6 -8
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/check-app-scheme.d.ts +2 -2
- package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +182 -7
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +6 -7
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/tools.d.ts.map +1 -1
- package/dist/types/src/capabilities/url-handler.d.ts +2 -2
- package/dist/types/src/capabilities/url-handler.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Banner.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Fullscreen.d.ts +5 -0
- package/dist/types/src/components/DeckLayout/Fullscreen.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/StatusBar.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.d.ts +5 -18
- package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.stories.d.ts +3 -3
- package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankControls.d.ts +2 -3
- package/dist/types/src/components/Plank/PlankControls.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankError.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankHeading.d.ts +2 -3
- package/dist/types/src/components/Plank/PlankHeading.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/Sidebar.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/SidebarButton.d.ts +1 -2
- package/dist/types/src/components/Sidebar/SidebarButton.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +1 -5
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useNodeActionExpander.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/layout.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +0 -2
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +104 -106
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +4 -1
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/layoutAppliesTopbar.d.ts +1 -2
- package/dist/types/src/util/layoutAppliesTopbar.d.ts.map +1 -1
- package/dist/types/src/util/overscroll.d.ts.map +1 -1
- package/dist/types/src/util/set-active.d.ts.map +1 -1
- package/dist/types/src/util/useBreakpoints.d.ts.map +1 -0
- package/dist/types/src/util/useCompanions.d.ts.map +1 -0
- package/dist/types/src/util/useHoistStatusbar.d.ts +2 -0
- package/dist/types/src/util/useHoistStatusbar.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +29 -36
- package/src/capabilities/app-graph-builder.ts +92 -120
- package/src/capabilities/check-app-scheme.ts +7 -3
- package/src/capabilities/index.ts +2 -3
- package/src/capabilities/intent-resolver.ts +133 -175
- package/src/capabilities/settings.ts +4 -4
- package/src/capabilities/state.ts +4 -7
- package/src/capabilities/tools.ts +3 -4
- package/src/capabilities/url-handler.ts +4 -4
- package/src/components/DeckLayout/ContentEmpty.tsx +4 -9
- package/src/components/DeckLayout/DeckLayout.tsx +188 -123
- package/src/components/DeckLayout/Fullscreen.tsx +31 -0
- package/src/components/Plank/Plank.stories.tsx +8 -20
- package/src/components/Plank/Plank.tsx +68 -104
- package/src/components/Plank/PlankControls.tsx +57 -53
- package/src/components/Plank/PlankError.tsx +6 -2
- package/src/components/Plank/PlankHeading.tsx +12 -29
- package/src/components/Sidebar/ComplementarySidebar.tsx +54 -33
- package/src/components/Sidebar/Sidebar.tsx +4 -7
- package/src/components/Sidebar/SidebarButton.tsx +7 -30
- package/src/components/fragments.ts +1 -1
- package/src/hooks/index.ts +1 -5
- package/src/hooks/useNodeActionExpander.ts +8 -3
- package/src/index.ts +1 -1
- package/src/translations.ts +0 -2
- package/src/types.ts +71 -75
- package/src/util/index.ts +4 -1
- package/src/util/layoutAppliesTopbar.ts +2 -8
- package/src/{hooks → util}/useCompanions.ts +3 -3
- package/src/{hooks → util}/useHoistStatusbar.ts +4 -9
- package/dist/lib/browser/app-graph-builder-R7COZ4A6.mjs.map +0 -7
- package/dist/lib/browser/check-app-scheme-7AXGR6UT.mjs.map +0 -7
- package/dist/lib/browser/chunk-3O2UZVBA.mjs +0 -121
- package/dist/lib/browser/chunk-3O2UZVBA.mjs.map +0 -7
- package/dist/lib/browser/chunk-JAYQ5BTF.mjs +0 -157
- package/dist/lib/browser/chunk-JAYQ5BTF.mjs.map +0 -7
- package/dist/lib/browser/chunk-KIGMELV2.mjs.map +0 -7
- package/dist/lib/browser/chunk-OF5RIATN.mjs.map +0 -7
- package/dist/lib/browser/chunk-TRFYUEBA.mjs +0 -145
- package/dist/lib/browser/chunk-TRFYUEBA.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-MAKOS57L.mjs.map +0 -7
- package/dist/lib/browser/settings-UBWJF7J7.mjs.map +0 -7
- package/dist/lib/browser/state-4WFB4SDO.mjs +0 -10
- package/dist/lib/browser/state-4WFB4SDO.mjs.map +0 -7
- package/dist/lib/browser/tools-IVPIPTVA.mjs.map +0 -7
- package/dist/lib/browser/url-handler-JSYGSVSB.mjs.map +0 -7
- package/dist/types/src/components/DeckLayout/Dialog.d.ts +0 -3
- package/dist/types/src/components/DeckLayout/Dialog.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Popover.d.ts +0 -5
- package/dist/types/src/components/DeckLayout/Popover.d.ts.map +0 -1
- package/dist/types/src/hooks/useBreakpoints.d.ts.map +0 -1
- package/dist/types/src/hooks/useCompanions.d.ts.map +0 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts +0 -13
- package/dist/types/src/hooks/useDeckCompanions.d.ts.map +0 -1
- package/dist/types/src/hooks/useHoistStatusbar.d.ts +0 -3
- package/dist/types/src/hooks/useHoistStatusbar.d.ts.map +0 -1
- package/src/components/DeckLayout/Dialog.tsx +0 -36
- package/src/components/DeckLayout/Popover.tsx +0 -104
- package/src/hooks/useDeckCompanions.ts +0 -33
- /package/dist/lib/browser/{react-root-DGQVIHXP.mjs.map → react-root-XLXN2VEW.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-PXBXIOPU.mjs.map → react-surface-WNGMZL7I.mjs.map} +0 -0
- /package/dist/types/src/{hooks → util}/useBreakpoints.d.ts +0 -0
- /package/dist/types/src/{hooks → util}/useCompanions.d.ts +0 -0
- /package/src/{hooks → util}/useBreakpoints.ts +0 -0
|
@@ -12,20 +12,51 @@ import React, {
|
|
|
12
12
|
useState,
|
|
13
13
|
} from 'react';
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
LayoutAction,
|
|
17
|
+
Surface,
|
|
18
|
+
createIntent,
|
|
19
|
+
useAppGraph,
|
|
20
|
+
useCapability,
|
|
21
|
+
useIntentDispatcher,
|
|
22
|
+
} from '@dxos/app-framework';
|
|
23
|
+
import { type Node } from '@dxos/plugin-graph';
|
|
16
24
|
import { Main, useTranslation, toLocalizedString, IconButton, type Label } from '@dxos/react-ui';
|
|
17
25
|
import { Tabs } from '@dxos/react-ui-tabs';
|
|
26
|
+
import { byPosition, type Position } from '@dxos/util';
|
|
18
27
|
|
|
19
28
|
import { ToggleComplementarySidebarButton } from './SidebarButton';
|
|
20
29
|
import { DeckCapabilities } from '../../capabilities';
|
|
21
|
-
import { type DeckCompanion, getCompanionId, useDeckCompanions, useBreakpoints, useHoistStatusbar } from '../../hooks';
|
|
22
30
|
import { DECK_PLUGIN } from '../../meta';
|
|
23
|
-
import {
|
|
24
|
-
import { layoutAppliesTopbar } from '../../util';
|
|
31
|
+
import { ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE } from '../../types';
|
|
32
|
+
import { layoutAppliesTopbar, useBreakpoints, useHoistStatusbar } from '../../util';
|
|
25
33
|
import { PlankContentError, PlankLoading } from '../Plank';
|
|
26
34
|
|
|
27
35
|
const label = ['complementary sidebar title', { ns: DECK_PLUGIN }] satisfies Label;
|
|
28
36
|
|
|
37
|
+
const getCompanionId = (id: string) => {
|
|
38
|
+
const [_, companionId] = id.split(ATTENDABLE_PATH_SEPARATOR);
|
|
39
|
+
return companionId ?? 'never';
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
type DeckCompanion = Node<
|
|
43
|
+
any,
|
|
44
|
+
{
|
|
45
|
+
label: Label;
|
|
46
|
+
icon: string;
|
|
47
|
+
// TODO(burdon): Scroll area should be controlled by surface.
|
|
48
|
+
/** If true, the panel will not be wrapped in a scroll area. */
|
|
49
|
+
fixed?: boolean;
|
|
50
|
+
position?: Position;
|
|
51
|
+
}
|
|
52
|
+
>;
|
|
53
|
+
|
|
54
|
+
const useDeckCompanions = (): DeckCompanion[] => {
|
|
55
|
+
const { graph } = useAppGraph();
|
|
56
|
+
const companions = graph.nodes(graph.root, { type: DECK_COMPANION_TYPE }) as DeckCompanion[];
|
|
57
|
+
return companions.toSorted((a, b) => byPosition(a.properties, b.properties));
|
|
58
|
+
};
|
|
59
|
+
|
|
29
60
|
export type ComplementarySidebarProps = {
|
|
30
61
|
current?: string;
|
|
31
62
|
};
|
|
@@ -34,14 +65,13 @@ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) =>
|
|
|
34
65
|
const { t } = useTranslation(DECK_PLUGIN);
|
|
35
66
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
36
67
|
const layout = useCapability(DeckCapabilities.MutableDeckState);
|
|
37
|
-
const layoutMode = getMode(layout.deck);
|
|
38
68
|
const breakpoint = useBreakpoints();
|
|
39
|
-
const topbar = layoutAppliesTopbar(breakpoint
|
|
40
|
-
const hoistStatusbar = useHoistStatusbar(breakpoint
|
|
69
|
+
const topbar = layoutAppliesTopbar(breakpoint);
|
|
70
|
+
const hoistStatusbar = useHoistStatusbar(breakpoint);
|
|
41
71
|
|
|
42
72
|
const companions = useDeckCompanions();
|
|
43
|
-
const activeCompanion = companions.find((companion) => getCompanionId(companion.id) === current);
|
|
44
|
-
const activeId =
|
|
73
|
+
const activeCompanion = companions.find((companion) => getCompanionId(companion.id) === current) ?? companions.at(0);
|
|
74
|
+
const activeId = getCompanionId(activeCompanion?.id ?? 'never');
|
|
45
75
|
const [internalValue, setInternalValue] = useState(activeId);
|
|
46
76
|
|
|
47
77
|
useEffect(() => {
|
|
@@ -71,14 +101,6 @@ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) =>
|
|
|
71
101
|
[activeCompanion?.id, activeCompanion?.data],
|
|
72
102
|
);
|
|
73
103
|
|
|
74
|
-
useEffect(() => {
|
|
75
|
-
if (!activeId) {
|
|
76
|
-
void dispatch(
|
|
77
|
-
createIntent(LayoutAction.UpdateComplementary, { part: 'complementary', options: { state: 'collapsed' } }),
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
}, [activeId, dispatch]);
|
|
81
|
-
|
|
82
104
|
return (
|
|
83
105
|
<Main.ComplementarySidebar
|
|
84
106
|
label={label}
|
|
@@ -123,22 +145,21 @@ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) =>
|
|
|
123
145
|
<ToggleComplementarySidebarButton />
|
|
124
146
|
</div>
|
|
125
147
|
</div>
|
|
126
|
-
{
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
))}
|
|
148
|
+
{companions.map((companion) => (
|
|
149
|
+
<Tabs.Tabpanel
|
|
150
|
+
key={getCompanionId(companion.id)}
|
|
151
|
+
value={getCompanionId(companion.id)}
|
|
152
|
+
classNames='absolute data-[state="inactive"]:-z-[1] inset-block-0 inline-start-0 is-[calc(100%-var(--r0-size))] lg:is-[--r1-size] grid grid-cols-1 grid-rows-[var(--rail-size)_1fr_min-content] pbs-[env(safe-area-inset-top)]'
|
|
153
|
+
{...(layout.complementarySidebarState !== 'expanded' && { inert: 'true' })}
|
|
154
|
+
>
|
|
155
|
+
<ComplementarySidebarPanel
|
|
156
|
+
companion={companion}
|
|
157
|
+
activeId={activeId}
|
|
158
|
+
data={data}
|
|
159
|
+
hoistStatusbar={hoistStatusbar}
|
|
160
|
+
/>
|
|
161
|
+
</Tabs.Tabpanel>
|
|
162
|
+
))}
|
|
142
163
|
</Tabs.Root>
|
|
143
164
|
</Main.ComplementarySidebar>
|
|
144
165
|
);
|
|
@@ -8,19 +8,16 @@ import { Surface, useCapability } from '@dxos/app-framework';
|
|
|
8
8
|
import { type Label, Main } from '@dxos/react-ui';
|
|
9
9
|
|
|
10
10
|
import { DeckCapabilities } from '../../capabilities';
|
|
11
|
-
import { useBreakpoints, useHoistStatusbar } from '../../hooks';
|
|
12
11
|
import { DECK_PLUGIN } from '../../meta';
|
|
13
|
-
import {
|
|
14
|
-
import { layoutAppliesTopbar } from '../../util';
|
|
12
|
+
import { layoutAppliesTopbar, useBreakpoints, useHoistStatusbar } from '../../util';
|
|
15
13
|
|
|
16
14
|
const label = ['sidebar title', { ns: DECK_PLUGIN }] satisfies Label;
|
|
17
15
|
|
|
18
16
|
export const Sidebar = () => {
|
|
19
|
-
const { popoverAnchorId, activeDeck: current
|
|
17
|
+
const { popoverAnchorId, activeDeck: current } = useCapability(DeckCapabilities.DeckState);
|
|
20
18
|
const breakpoint = useBreakpoints();
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
|
|
19
|
+
const topbar = layoutAppliesTopbar(breakpoint);
|
|
20
|
+
const hoistStatusbar = useHoistStatusbar(breakpoint);
|
|
24
21
|
|
|
25
22
|
const navigationData = useMemo(
|
|
26
23
|
() => ({ popoverAnchorId, topbar, hoistStatusbar, current }),
|
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React
|
|
5
|
+
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { useCapability } from '@dxos/app-framework';
|
|
8
8
|
import { IconButton, type IconButtonProps, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
9
9
|
|
|
10
10
|
import { DeckCapabilities } from '../../capabilities';
|
|
11
|
-
import { useDeckCompanions } from '../../hooks';
|
|
12
|
-
import { getCompanionId } from '../../hooks/useDeckCompanions';
|
|
13
11
|
import { DECK_PLUGIN } from '../../meta';
|
|
14
12
|
|
|
15
13
|
export const ToggleSidebarButton = ({
|
|
@@ -49,37 +47,16 @@ export const CloseSidebarButton = () => {
|
|
|
49
47
|
);
|
|
50
48
|
};
|
|
51
49
|
|
|
52
|
-
export const ToggleComplementarySidebarButton = ({
|
|
53
|
-
inR0,
|
|
54
|
-
classNames,
|
|
55
|
-
current,
|
|
56
|
-
}: ThemedClassName<{ inR0?: boolean; current?: string }>) => {
|
|
57
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
50
|
+
export const ToggleComplementarySidebarButton = ({ inR0, classNames }: ThemedClassName<{ inR0?: boolean }>) => {
|
|
58
51
|
const layoutContext = useCapability(DeckCapabilities.MutableDeckState);
|
|
59
52
|
const { t } = useTranslation(DECK_PLUGIN);
|
|
60
|
-
|
|
61
|
-
const companions = useDeckCompanions();
|
|
62
|
-
const handleClick = useCallback(async () => {
|
|
63
|
-
layoutContext.complementarySidebarState =
|
|
64
|
-
layoutContext.complementarySidebarState === 'expanded' ? 'collapsed' : 'expanded';
|
|
65
|
-
const firstCompanion = companions[0];
|
|
66
|
-
if (layoutContext.complementarySidebarState === 'expanded' && !current && firstCompanion) {
|
|
67
|
-
await dispatch(
|
|
68
|
-
createIntent(LayoutAction.UpdateComplementary, {
|
|
69
|
-
part: 'complementary',
|
|
70
|
-
subject: getCompanionId(firstCompanion.id),
|
|
71
|
-
}),
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
}, [layoutContext, current, companions, dispatch]);
|
|
75
|
-
|
|
76
|
-
// TODO(thure): This should have a tooltip but is suppressed because focus is getting set on this twice when the app
|
|
77
|
-
// first mounts, causing even `suppressNextTooltip` not to have the intended effect.
|
|
78
53
|
return (
|
|
79
54
|
<IconButton
|
|
80
|
-
noTooltip
|
|
81
55
|
iconOnly
|
|
82
|
-
onClick={
|
|
56
|
+
onClick={() =>
|
|
57
|
+
(layoutContext.complementarySidebarState =
|
|
58
|
+
layoutContext.complementarySidebarState === 'expanded' ? 'collapsed' : 'expanded')
|
|
59
|
+
}
|
|
83
60
|
variant='ghost'
|
|
84
61
|
label={t('open complementary sidebar label')}
|
|
85
62
|
classNames={['[&>svg]:-scale-x-100', classNames]}
|
|
@@ -7,7 +7,7 @@ import { mx } from '@dxos/react-ui-theme';
|
|
|
7
7
|
export const soloInlinePadding =
|
|
8
8
|
'pis-[calc(env(safe-area-inset-left)+.25rem)] pie-[calc(env(safe-area-inset-left)+.25rem)]';
|
|
9
9
|
|
|
10
|
-
const sidebarToggleStyles = 'bs-[--rail-item] is-[--rail-item] absolute block-end-2 z-[1] !bg-
|
|
10
|
+
const sidebarToggleStyles = 'bs-[--rail-item] is-[--rail-item] absolute block-end-2 z-[1] !bg-deck lg:hidden';
|
|
11
11
|
|
|
12
12
|
export const fixedSidebarToggleStyles = mx(sidebarToggleStyles, 'inline-start-2');
|
|
13
13
|
|
package/src/hooks/index.ts
CHANGED
|
@@ -2,9 +2,5 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export * from './useBreakpoints';
|
|
6
|
-
export * from './useCompanions';
|
|
7
|
-
export * from './useDeckCompanions';
|
|
8
|
-
export * from './useHoistStatusbar';
|
|
9
|
-
export * from './useMainSize';
|
|
10
5
|
export * from './useNodeActionExpander';
|
|
6
|
+
export * from './useMainSize';
|
|
@@ -4,14 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
import { useEffect } from 'react';
|
|
6
6
|
|
|
7
|
-
import { getGraph, type Node } from '@dxos/plugin-graph';
|
|
7
|
+
import { ACTION_GROUP_TYPE, ACTION_TYPE, getGraph, type Node } from '@dxos/plugin-graph';
|
|
8
|
+
|
|
9
|
+
const expandNodeActions = async (node: Node) => {
|
|
10
|
+
const graph = getGraph(node);
|
|
11
|
+
await graph.expand(node, 'outbound', ACTION_GROUP_TYPE);
|
|
12
|
+
await graph.expand(node, 'outbound', ACTION_TYPE);
|
|
13
|
+
};
|
|
8
14
|
|
|
9
15
|
export const useNodeActionExpander = (node?: Node) => {
|
|
10
16
|
useEffect(() => {
|
|
11
17
|
if (node) {
|
|
12
18
|
const frame = requestAnimationFrame(() => {
|
|
13
|
-
|
|
14
|
-
graph.expand(node.id);
|
|
19
|
+
void expandNodeActions(node);
|
|
15
20
|
});
|
|
16
21
|
return () => cancelAnimationFrame(frame);
|
|
17
22
|
}
|
package/src/index.ts
CHANGED
package/src/translations.ts
CHANGED
|
@@ -45,8 +45,6 @@ export default [
|
|
|
45
45
|
'increment end label': 'Move to the right',
|
|
46
46
|
'show deck plank label': 'Return to deck',
|
|
47
47
|
'show solo plank label': 'Maximize',
|
|
48
|
-
'exit fullscreen label': 'Exit fullscreen',
|
|
49
|
-
'show fullscreen plank label': 'Fullscreen',
|
|
50
48
|
'close label': 'Close',
|
|
51
49
|
'minify label': 'Minify',
|
|
52
50
|
'open companion label': 'Open companion',
|
package/src/types.ts
CHANGED
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Schema } from 'effect';
|
|
6
|
-
|
|
7
5
|
import { LayoutAction } from '@dxos/app-framework';
|
|
8
|
-
import {
|
|
6
|
+
import { S } from '@dxos/echo-schema';
|
|
9
7
|
|
|
10
8
|
import { DECK_PLUGIN } from './meta';
|
|
11
9
|
|
|
@@ -24,33 +22,33 @@ export type Overscroll = (typeof OverscrollOptions)[number];
|
|
|
24
22
|
export type Part = 'solo' | 'deck' | 'complementary';
|
|
25
23
|
export type ResolvedPart = Part | 'solo-primary' | 'solo-companion';
|
|
26
24
|
|
|
27
|
-
export const DeckSettingsSchema =
|
|
28
|
-
showHints:
|
|
29
|
-
enableDeck:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
newPlankPositioning:
|
|
33
|
-
overscroll:
|
|
34
|
-
}).pipe(
|
|
35
|
-
export type DeckSettingsProps =
|
|
25
|
+
export const DeckSettingsSchema = S.Struct({
|
|
26
|
+
showHints: S.optional(S.Boolean),
|
|
27
|
+
enableDeck: S.optional(S.Boolean),
|
|
28
|
+
enableNativeRedirect: S.optional(S.Boolean),
|
|
29
|
+
enableStatusbar: S.optional(S.Boolean),
|
|
30
|
+
newPlankPositioning: S.optional(S.Literal(...NewPlankPositions)),
|
|
31
|
+
overscroll: S.optional(S.Literal(...OverscrollOptions)),
|
|
32
|
+
}).pipe(S.mutable);
|
|
33
|
+
export type DeckSettingsProps = S.Schema.Type<typeof DeckSettingsSchema>;
|
|
36
34
|
|
|
37
|
-
export const PlankSizing =
|
|
38
|
-
export type PlankSizing =
|
|
35
|
+
export const PlankSizing = S.Record({ key: S.String, value: S.Number });
|
|
36
|
+
export type PlankSizing = S.Schema.Type<typeof PlankSizing>;
|
|
39
37
|
|
|
40
38
|
// State of an individual deck.
|
|
41
|
-
export const DeckState =
|
|
39
|
+
export const DeckState = S.Struct({
|
|
42
40
|
/** If false, the deck has not yet left solo mode and new planks should be soloed. */
|
|
43
|
-
initialized:
|
|
44
|
-
active:
|
|
41
|
+
initialized: S.Boolean,
|
|
42
|
+
active: S.mutable(S.Array(S.String)),
|
|
45
43
|
// TODO(wittjosiah): Piping into both mutable and optional caused invalid typescript output.
|
|
46
|
-
activeCompanions:
|
|
47
|
-
inactive:
|
|
48
|
-
solo:
|
|
49
|
-
fullscreen:
|
|
50
|
-
plankSizing:
|
|
51
|
-
companionFrameSizing:
|
|
44
|
+
activeCompanions: S.optional(S.mutable(S.Record({ key: S.String, value: S.String }))),
|
|
45
|
+
inactive: S.mutable(S.Array(S.String)),
|
|
46
|
+
solo: S.optional(S.String),
|
|
47
|
+
fullscreen: S.Boolean,
|
|
48
|
+
plankSizing: S.mutable(PlankSizing),
|
|
49
|
+
companionFrameSizing: S.mutable(PlankSizing),
|
|
52
50
|
});
|
|
53
|
-
export type DeckState =
|
|
51
|
+
export type DeckState = S.Schema.Type<typeof DeckState>;
|
|
54
52
|
|
|
55
53
|
export const defaultDeck: DeckState = {
|
|
56
54
|
initialized: false,
|
|
@@ -63,86 +61,84 @@ export const defaultDeck: DeckState = {
|
|
|
63
61
|
companionFrameSizing: {},
|
|
64
62
|
};
|
|
65
63
|
|
|
66
|
-
const LayoutMode =
|
|
67
|
-
export type LayoutMode =
|
|
68
|
-
export const isLayoutMode = (value: any): value is LayoutMode =>
|
|
64
|
+
const LayoutMode = S.Literal('deck', 'solo', 'fullscreen');
|
|
65
|
+
export type LayoutMode = S.Schema.Type<typeof LayoutMode>;
|
|
66
|
+
export const isLayoutMode = (value: any): value is LayoutMode => S.is(LayoutMode)(value);
|
|
69
67
|
|
|
70
|
-
export const getMode = (deck: DeckState
|
|
68
|
+
export const getMode = (deck: DeckState): LayoutMode => {
|
|
71
69
|
if (deck.solo) {
|
|
72
|
-
return deck.fullscreen ? '
|
|
70
|
+
return deck.fullscreen ? 'fullscreen' : 'solo';
|
|
73
71
|
}
|
|
74
72
|
|
|
75
73
|
return 'deck';
|
|
76
74
|
};
|
|
77
75
|
|
|
78
76
|
// State of the deck plugin.
|
|
79
|
-
export const DeckPluginState =
|
|
80
|
-
sidebarState:
|
|
81
|
-
complementarySidebarState:
|
|
82
|
-
complementarySidebarPanel:
|
|
83
|
-
|
|
84
|
-
dialogOpen:
|
|
85
|
-
dialogBlockAlign: Schema.optional(Schema.Literal('start', 'center', 'end')),
|
|
86
|
-
dialogType: Schema.optional(Schema.Literal('default', 'alert')),
|
|
77
|
+
export const DeckPluginState = S.Struct({
|
|
78
|
+
sidebarState: S.Literal('closed', 'collapsed', 'expanded'),
|
|
79
|
+
complementarySidebarState: S.Literal('closed', 'collapsed', 'expanded'),
|
|
80
|
+
complementarySidebarPanel: S.optional(S.String),
|
|
81
|
+
|
|
82
|
+
dialogOpen: S.Boolean,
|
|
87
83
|
/** Data to be passed to the dialog Surface. */
|
|
88
|
-
dialogContent:
|
|
84
|
+
dialogContent: S.optional(S.Any),
|
|
85
|
+
dialogBlockAlign: S.optional(S.Literal('start', 'center', 'end')),
|
|
86
|
+
dialogType: S.optional(S.Literal('default', 'alert')),
|
|
89
87
|
|
|
90
|
-
popoverOpen:
|
|
91
|
-
popoverSide:
|
|
92
|
-
popoverAnchor: Schema.optional(Schema.Any),
|
|
93
|
-
popoverAnchorId: Schema.optional(Schema.String),
|
|
88
|
+
popoverOpen: S.Boolean,
|
|
89
|
+
popoverSide: S.optional(S.Literal('top', 'right', 'bottom', 'left')),
|
|
94
90
|
/** Data to be passed to the popover Surface. */
|
|
95
|
-
popoverContent:
|
|
91
|
+
popoverContent: S.optional(S.Any),
|
|
92
|
+
popoverAnchorId: S.optional(S.String),
|
|
96
93
|
|
|
97
|
-
toasts:
|
|
98
|
-
currentUndoId:
|
|
94
|
+
toasts: S.mutable(S.Array(LayoutAction.Toast)),
|
|
95
|
+
currentUndoId: S.optional(S.String),
|
|
99
96
|
|
|
100
|
-
activeDeck:
|
|
101
|
-
previousDeck:
|
|
102
|
-
decks:
|
|
103
|
-
previousMode:
|
|
104
|
-
deck:
|
|
97
|
+
activeDeck: S.String,
|
|
98
|
+
previousDeck: S.String,
|
|
99
|
+
decks: S.mutable(S.Record({ key: S.String, value: S.mutable(DeckState) })),
|
|
100
|
+
previousMode: S.mutable(S.Record({ key: S.String, value: LayoutMode })),
|
|
101
|
+
deck: S.mutable(DeckState),
|
|
105
102
|
|
|
106
103
|
/** The identifier of a component to scroll into view when it is mounted. */
|
|
107
|
-
scrollIntoView:
|
|
108
|
-
}).pipe(
|
|
104
|
+
scrollIntoView: S.optional(S.String),
|
|
105
|
+
}).pipe(S.mutable);
|
|
109
106
|
|
|
110
|
-
export type DeckPluginState =
|
|
107
|
+
export type DeckPluginState = S.Schema.Type<typeof DeckPluginState>;
|
|
111
108
|
|
|
112
109
|
export const DECK_ACTION = `${DECK_PLUGIN}/action`;
|
|
113
110
|
|
|
114
111
|
export namespace DeckAction {
|
|
115
|
-
const PartAdjustmentSchema =
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
Schema.Literal('increment-end').annotations({ description: 'Move the plank towards the end of the deck.' }),
|
|
112
|
+
const PartAdjustmentSchema = S.Union(
|
|
113
|
+
S.Literal('close').annotations({ description: 'Close the plank.' }),
|
|
114
|
+
S.Literal('companion').annotations({ description: 'Open the companion plank.' }),
|
|
115
|
+
S.Literal('solo').annotations({ description: 'Solo the plank.' }),
|
|
116
|
+
S.Literal('increment-start').annotations({ description: 'Move the plank towards the start of the deck.' }),
|
|
117
|
+
S.Literal('increment-end').annotations({ description: 'Move the plank towards the end of the deck.' }),
|
|
122
118
|
);
|
|
123
|
-
export type PartAdjustment =
|
|
124
|
-
export const Adjustment =
|
|
125
|
-
export type Adjustment =
|
|
119
|
+
export type PartAdjustment = S.Schema.Type<typeof PartAdjustmentSchema>;
|
|
120
|
+
export const Adjustment = S.mutable(S.Struct({ id: S.String, type: PartAdjustmentSchema }));
|
|
121
|
+
export type Adjustment = S.Schema.Type<typeof Adjustment>;
|
|
126
122
|
|
|
127
123
|
// An atomic transaction to apply to the deck, describing which element to move to which location.
|
|
128
|
-
export class Adjust extends
|
|
124
|
+
export class Adjust extends S.TaggedClass<Adjust>()(`${DECK_ACTION}/adjust`, {
|
|
129
125
|
input: Adjustment,
|
|
130
|
-
output:
|
|
126
|
+
output: S.Void,
|
|
131
127
|
}) {}
|
|
132
128
|
|
|
133
|
-
export class UpdatePlankSize extends
|
|
134
|
-
input:
|
|
135
|
-
id:
|
|
136
|
-
size:
|
|
129
|
+
export class UpdatePlankSize extends S.TaggedClass<UpdatePlankSize>()(`${DECK_ACTION}/update-plank-size`, {
|
|
130
|
+
input: S.Struct({
|
|
131
|
+
id: S.String,
|
|
132
|
+
size: S.Number,
|
|
137
133
|
}),
|
|
138
|
-
output:
|
|
134
|
+
output: S.Void,
|
|
139
135
|
}) {}
|
|
140
136
|
|
|
141
|
-
export class ChangeCompanion extends
|
|
142
|
-
input:
|
|
143
|
-
primary:
|
|
144
|
-
companion:
|
|
137
|
+
export class ChangeCompanion extends S.TaggedClass<ChangeCompanion>()(`${DECK_ACTION}/change-companion`, {
|
|
138
|
+
input: S.Struct({
|
|
139
|
+
primary: S.String,
|
|
140
|
+
companion: S.Union(S.String, S.Null),
|
|
145
141
|
}),
|
|
146
|
-
output:
|
|
142
|
+
output: S.Void,
|
|
147
143
|
}) {}
|
|
148
144
|
}
|
package/src/util/index.ts
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export * from './layoutAppliesTopbar';
|
|
6
5
|
export * from './overscroll';
|
|
7
6
|
export * from './set-active';
|
|
7
|
+
export * from './useBreakpoints';
|
|
8
|
+
export * from './layoutAppliesTopbar';
|
|
9
|
+
export * from './useHoistStatusbar';
|
|
10
|
+
export * from './useCompanions';
|
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export const layoutAppliesTopbar = (breakpoint: string, layoutMode?: LayoutMode) => {
|
|
8
|
-
return (
|
|
9
|
-
document.body.getAttribute('data-platform') === 'win' &&
|
|
10
|
-
breakpoint === 'desktop' &&
|
|
11
|
-
layoutMode !== 'solo--fullscreen'
|
|
12
|
-
);
|
|
5
|
+
export const layoutAppliesTopbar = (breakpoint: string) => {
|
|
6
|
+
return document.body.getAttribute('data-platform') === 'win' && breakpoint === 'desktop';
|
|
13
7
|
};
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
import { useMemo } from 'react';
|
|
6
6
|
|
|
7
7
|
import { useAppGraph } from '@dxos/app-framework';
|
|
8
|
-
import {
|
|
8
|
+
import { useNode } from '@dxos/plugin-graph';
|
|
9
9
|
import { byPosition } from '@dxos/util';
|
|
10
10
|
|
|
11
11
|
import { PLANK_COMPANION_TYPE } from '../types';
|
|
12
12
|
|
|
13
13
|
export const useCompanions = (id?: string) => {
|
|
14
14
|
const { graph } = useAppGraph();
|
|
15
|
-
const
|
|
16
|
-
const companions = nodes
|
|
15
|
+
const node = useNode(graph, id);
|
|
16
|
+
const companions = node ? graph.nodes(node, { type: PLANK_COMPANION_TYPE }) : [];
|
|
17
17
|
return useMemo(() => companions.toSorted((a, b) => byPosition(a.properties, b.properties)), [companions]);
|
|
18
18
|
};
|
|
@@ -8,18 +8,13 @@ import { Capabilities, useCapability } from '@dxos/app-framework';
|
|
|
8
8
|
import { useThemeContext } from '@dxos/react-ui';
|
|
9
9
|
|
|
10
10
|
import { DECK_PLUGIN } from '../meta';
|
|
11
|
-
import type { DeckSettingsProps
|
|
11
|
+
import type { DeckSettingsProps } from '../types';
|
|
12
12
|
|
|
13
|
-
export const useHoistStatusbar = (breakpoint: string
|
|
13
|
+
export const useHoistStatusbar = (breakpoint: string): boolean => {
|
|
14
14
|
const enableStatusbar = useCapability(Capabilities.SettingsStore).getStore<DeckSettingsProps>(DECK_PLUGIN)!.value
|
|
15
15
|
.enableStatusbar;
|
|
16
16
|
const { safeAreaPadding } = useThemeContext();
|
|
17
17
|
return useMemo(() => {
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
layoutMode !== 'solo--fullscreen' &&
|
|
21
|
-
!!enableStatusbar &&
|
|
22
|
-
safeAreaPadding?.bottom === 0
|
|
23
|
-
);
|
|
24
|
-
}, [enableStatusbar, breakpoint, safeAreaPadding?.bottom, layoutMode]);
|
|
18
|
+
return breakpoint === 'desktop' && !!enableStatusbar && safeAreaPadding?.bottom === 0;
|
|
19
|
+
}, [enableStatusbar, breakpoint, safeAreaPadding?.bottom]);
|
|
25
20
|
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { Capabilities, contributes, createIntent, LayoutAction, type PluginContext } from '@dxos/app-framework';\nimport { AttentionCapabilities } from '@dxos/plugin-attention';\nimport { createExtension, ROOT_ID, rxFromSignal } from '@dxos/plugin-graph';\n\nimport { DeckCapabilities } from './capabilities';\nimport { DECK_PLUGIN } from '../meta';\n\nexport default (context: PluginContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: DECK_PLUGIN,\n actions: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),\n Option.map(() => {\n const state = context.getCapability(DeckCapabilities.MutableDeckState);\n\n // NOTE(Zan): This is currently disabled.\n // TODO(Zan): Fullscreen needs to know the active node and provide that to the layout part.\n const _fullscreen = {\n id: `${LayoutAction.UpdateLayout._tag}/fullscreen`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(\n createIntent(LayoutAction.SetLayoutMode, { part: 'mode', options: { mode: 'fullscreen' } }),\n );\n },\n properties: {\n label: ['toggle fullscreen label', { ns: DECK_PLUGIN }],\n icon: 'ph--arrows-out--regular',\n keyBinding: {\n macos: 'ctrl+meta+f',\n windows: 'shift+ctrl+f',\n },\n },\n };\n\n const closeCurrent = {\n id: `${LayoutAction.Close._tag}/current`,\n data: async () => {\n const attention = context.getCapability(AttentionCapabilities.Attention);\n const attended = attention.current.at(-1);\n if (attended) {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(\n createIntent(LayoutAction.Close, {\n part: 'main',\n subject: [attended],\n options: { state: false },\n }),\n );\n }\n },\n properties: {\n label: ['close current label', { ns: DECK_PLUGIN }],\n icon: 'ph--x--regular',\n },\n };\n\n const closeOthers = {\n id: `${LayoutAction.Close._tag}/others`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n const attention = context.getCapability(AttentionCapabilities.Attention);\n const attended = attention.current.at(-1);\n const ids = state.deck.active.filter((id) => id !== attended) ?? [];\n await dispatch(\n createIntent(LayoutAction.Close, { part: 'main', subject: ids, options: { state: false } }),\n );\n },\n properties: {\n label: ['close others label', { ns: DECK_PLUGIN }],\n icon: 'ph--x-square--regular',\n },\n };\n\n const closeAll = {\n id: `${LayoutAction.Close._tag}/all`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(\n createIntent(LayoutAction.Close, {\n part: 'main',\n subject: state.deck.active,\n options: { state: false },\n }),\n );\n },\n properties: {\n label: ['close all label', { ns: DECK_PLUGIN }],\n icon: 'ph--x-circle--regular',\n },\n };\n\n const toggleSidebar = {\n id: `${LayoutAction.UpdateSidebar._tag}/nav`,\n data: async () => {\n state.sidebarState = state.sidebarState === 'expanded' ? 'collapsed' : 'expanded';\n },\n properties: {\n label: [\n get(\n rxFromSignal(() =>\n state.sidebarState === 'expanded'\n ? 'collapse navigation sidebar label'\n : 'open navigation sidebar label',\n ),\n ),\n { ns: DECK_PLUGIN },\n ],\n icon: 'ph--sidebar--regular',\n keyBinding: {\n macos: 'meta+b',\n },\n disposition: 'pin-end',\n position: 'hoist',\n l0Breakpoint: 'lg',\n },\n };\n\n return get(\n rxFromSignal(() =>\n !state.deck.solo ? [closeCurrent, closeOthers, closeAll, toggleSidebar] : [toggleSidebar],\n ),\n );\n }),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n );\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["Rx", "Option", "pipe", "Capabilities", "contributes", "createIntent", "LayoutAction", "AttentionCapabilities", "createExtension", "ROOT_ID", "rxFromSignal", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "DECK_PLUGIN", "actions", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "ROOT_ID", "some", "none", "map", "state", "getCapability", "DeckCapabilities", "MutableDeckState", "_fullscreen", "LayoutAction", "UpdateLayout", "_tag", "data", "dispatchPromise", "dispatch", "IntentDispatcher", "createIntent", "SetLayoutMode", "part", "options", "mode", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "closeCurrent", "Close", "attention", "AttentionCapabilities", "Attention", "attended", "current", "at", "subject", "closeOthers", "ids", "deck", "active", "filter", "closeAll", "toggleSidebar", "UpdateSidebar", "sidebarState", "rxFromSignal", "disposition", "position", "l0Breakpoint", "solo", "getOrElse"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/check-app-scheme.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, type PluginContext } from '@dxos/app-framework';\n\nimport { DECK_PLUGIN } from '../meta';\nimport { type DeckSettingsProps } from '../types';\n\nconst isSocket = !!(globalThis as any).__args;\n\n// TODO(mjamesderocher): Can we get this directly from Socket?\nconst appScheme = 'composer://';\n\n// TODO(mjamesderocher): Factor out as part of NavigationPlugin.\nconst checkAppScheme = (url: string) => {\n const iframe = document.createElement('iframe');\n iframe.style.display = 'none';\n document.body.appendChild(iframe);\n\n iframe.src = url + window.location.pathname.replace(/^\\/+/, '') + window.location.search;\n\n const timer = setTimeout(() => {\n document.body.removeChild(iframe);\n }, 3000);\n\n window.addEventListener('pagehide', (event) => {\n clearTimeout(timer);\n document.body.removeChild(iframe);\n });\n};\n\nexport default async (context: PluginContext) => {\n const settings = context.getCapability(Capabilities.SettingsStore).getStore<DeckSettingsProps>(DECK_PLUGIN)?.value;\n if (!isSocket && settings?.enableNativeRedirect) {\n checkAppScheme(appScheme);\n }\n\n return contributes(Capabilities.Null, null);\n};\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,SAASA,cAAcC,mBAAuC;AAK9D,IAAMC,WAAW,CAAC,CAAEC,WAAmBC;AAGvC,IAAMC,YAAY;AAGlB,IAAMC,iBAAiB,CAACC,QAAAA;AACtB,QAAMC,SAASC,SAASC,cAAc,QAAA;AACtCF,SAAOG,MAAMC,UAAU;AACvBH,WAASI,KAAKC,YAAYN,MAAAA;AAE1BA,SAAOO,MAAMR,MAAMS,OAAOC,SAASC,SAASC,QAAQ,QAAQ,EAAA,IAAMH,OAAOC,SAASG;AAElF,QAAMC,QAAQC,WAAW,MAAA;AACvBb,aAASI,KAAKU,YAAYf,MAAAA;EAC5B,GAAG,GAAA;AAEHQ,SAAOQ,iBAAiB,YAAY,CAACC,UAAAA;AACnCC,iBAAaL,KAAAA;AACbZ,aAASI,KAAKU,YAAYf,MAAAA;EAC5B,CAAA;AACF;AAEA,IAAA,2BAAe,OAAOmB,YAAAA;AACpB,QAAMC,WAAWD,QAAQE,cAAcC,aAAaC,aAAa,EAAEC,SAA4BC,WAAAA,GAAcC;AAC7G,MAAI,CAAChC,YAAY0B,UAAUO,sBAAsB;AAC/C7B,mBAAeD,SAAAA;EACjB;AAEA,SAAO+B,YAAYN,aAAaO,MAAM,IAAA;AACxC;",
|
|
6
|
-
"names": ["Capabilities", "contributes", "isSocket", "globalThis", "__args", "appScheme", "checkAppScheme", "url", "iframe", "document", "createElement", "style", "display", "body", "appendChild", "src", "window", "location", "pathname", "replace", "search", "timer", "setTimeout", "removeChild", "addEventListener", "event", "clearTimeout", "context", "settings", "getCapability", "Capabilities", "SettingsStore", "getStore", "DECK_PLUGIN", "value", "enableNativeRedirect", "contributes", "Null"]
|
|
7
|
-
}
|