@dxos/plugin-deck 0.8.1 → 0.8.2-main.f081794
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/{chunk-B4LOJUWW.mjs → chunk-4QSEGMY3.mjs} +10 -10
- package/dist/lib/browser/{chunk-B4LOJUWW.mjs.map → chunk-4QSEGMY3.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-6ZSOFCPP.mjs → chunk-6HJZL3WT.mjs} +8 -7
- package/dist/lib/browser/{chunk-6ZSOFCPP.mjs.map → chunk-6HJZL3WT.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-FJBMNSUC.mjs → chunk-VP6FCWFV.mjs} +171 -151
- package/dist/lib/browser/chunk-VP6FCWFV.mjs.map +7 -0
- package/dist/lib/browser/{chunk-RJNCG4ND.mjs → chunk-ZMJMCN7O.mjs} +9 -6
- package/dist/lib/browser/chunk-ZMJMCN7O.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +5 -3
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/{intent-resolver-UDYKO2QW.mjs → intent-resolver-6AK45PT5.mjs} +49 -31
- package/dist/lib/browser/intent-resolver-6AK45PT5.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-XLXN2VEW.mjs → react-root-KA2IL5RA.mjs} +5 -5
- package/dist/lib/browser/{react-surface-WNGMZL7I.mjs → react-surface-LIPGYEYN.mjs} +5 -5
- package/dist/lib/browser/{settings-HMDGSBGO.mjs → settings-6NU7CF2B.mjs} +4 -4
- package/dist/lib/browser/settings-6NU7CF2B.mjs.map +7 -0
- package/dist/lib/browser/{state-7TN26M42.mjs → state-Z6UY2Z3M.mjs} +6 -5
- package/dist/lib/browser/state-Z6UY2Z3M.mjs.map +7 -0
- package/dist/lib/browser/{tools-SC6QEN7R.mjs → tools-VDVQTJMD.mjs} +2 -2
- package/dist/lib/browser/types.mjs +1 -1
- package/dist/lib/browser/{url-handler-ODG4B6NX.mjs → url-handler-3CARFXQK.mjs} +2 -2
- package/dist/types/src/capabilities/capabilities.d.ts +8 -6
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +2 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +5 -4
- package/dist/types/src/capabilities/state.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/Dialog.d.ts +3 -0
- package/dist/types/src/components/DeckLayout/Dialog.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/Popover.d.ts +5 -0
- package/dist/types/src/components/DeckLayout/Popover.d.ts.map +1 -0
- package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankControls.d.ts +2 -2
- package/dist/types/src/components/Plank/PlankControls.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankHeading.d.ts +3 -2
- 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/translations.d.ts +2 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +11 -9
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/util/layoutAppliesTopbar.d.ts +2 -1
- package/dist/types/src/util/layoutAppliesTopbar.d.ts.map +1 -1
- package/dist/types/src/util/useHoistStatusbar.d.ts +2 -1
- package/dist/types/src/util/useHoistStatusbar.d.ts.map +1 -1
- package/package.json +28 -28
- package/src/capabilities/index.ts +2 -2
- package/src/capabilities/intent-resolver.ts +36 -20
- package/src/capabilities/settings.ts +2 -2
- package/src/capabilities/state.ts +3 -2
- package/src/components/DeckLayout/ContentEmpty.tsx +6 -2
- package/src/components/DeckLayout/DeckLayout.tsx +114 -181
- package/src/components/DeckLayout/Dialog.tsx +36 -0
- package/src/components/DeckLayout/Popover.tsx +76 -0
- package/src/components/Plank/Plank.tsx +3 -2
- package/src/components/Plank/PlankControls.tsx +33 -33
- package/src/components/Plank/PlankHeading.tsx +6 -4
- package/src/components/Sidebar/ComplementarySidebar.tsx +30 -20
- package/src/components/Sidebar/Sidebar.tsx +5 -3
- package/src/translations.ts +2 -0
- package/src/types.ts +9 -6
- package/src/util/layoutAppliesTopbar.ts +8 -2
- package/src/util/useHoistStatusbar.ts +9 -4
- package/dist/lib/browser/chunk-FJBMNSUC.mjs.map +0 -7
- package/dist/lib/browser/chunk-RJNCG4ND.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-UDYKO2QW.mjs.map +0 -7
- package/dist/lib/browser/settings-HMDGSBGO.mjs.map +0 -7
- package/dist/lib/browser/state-7TN26M42.mjs.map +0 -7
- package/dist/types/src/components/DeckLayout/Fullscreen.d.ts +0 -5
- package/dist/types/src/components/DeckLayout/Fullscreen.d.ts.map +0 -1
- package/src/components/DeckLayout/Fullscreen.tsx +0 -31
- /package/dist/lib/browser/{react-root-XLXN2VEW.mjs.map → react-root-KA2IL5RA.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-WNGMZL7I.mjs.map → react-surface-LIPGYEYN.mjs.map} +0 -0
- /package/dist/lib/browser/{tools-SC6QEN7R.mjs.map → tools-VDVQTJMD.mjs.map} +0 -0
- /package/dist/lib/browser/{url-handler-ODG4B6NX.mjs.map → url-handler-3CARFXQK.mjs.map} +0 -0
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from '@dxos/react-ui';
|
|
18
18
|
|
|
19
19
|
import { DECK_PLUGIN } from '../../meta';
|
|
20
|
-
import { DeckAction } from '../../types';
|
|
20
|
+
import { DeckAction, type LayoutMode } from '../../types';
|
|
21
21
|
|
|
22
22
|
export type PlankControlHandler = (event: DeckAction.PartAdjustment) => void;
|
|
23
23
|
|
|
@@ -34,7 +34,7 @@ export type PlankControlsProps = Omit<ButtonGroupProps, 'onClick'> & {
|
|
|
34
34
|
variant?: 'hide-disabled' | 'default';
|
|
35
35
|
close?: boolean | 'minify-start' | 'minify-end';
|
|
36
36
|
capabilities: PlankCapabilities;
|
|
37
|
-
|
|
37
|
+
layoutMode?: LayoutMode;
|
|
38
38
|
pin?: 'start' | 'end' | 'both';
|
|
39
39
|
};
|
|
40
40
|
|
|
@@ -73,7 +73,6 @@ export const PlankCompanionControls = forwardRef<HTMLDivElement, PlankCompliment
|
|
|
73
73
|
<PlankControl
|
|
74
74
|
label={t('close companion label')}
|
|
75
75
|
variant='ghost'
|
|
76
|
-
// icon='ph--minus--regular'
|
|
77
76
|
icon='ph--caret-left--regular'
|
|
78
77
|
onClick={handleCloseCompanion}
|
|
79
78
|
classNames={plankControlSpacing}
|
|
@@ -88,35 +87,45 @@ export const PlankCompanionControls = forwardRef<HTMLDivElement, PlankCompliment
|
|
|
88
87
|
// NOTE(thure): Pinning & unpinning are disabled indefinitely.
|
|
89
88
|
export const PlankControls = forwardRef<HTMLDivElement, PlankControlsProps>(
|
|
90
89
|
(
|
|
91
|
-
{ children, classNames, variant = 'default', capabilities,
|
|
90
|
+
{ children, classNames, variant = 'default', capabilities, layoutMode, pin, close = false, onClick, ...props },
|
|
92
91
|
forwardedRef,
|
|
93
92
|
) => {
|
|
94
93
|
const { t } = useTranslation(DECK_PLUGIN);
|
|
95
94
|
const buttonClassNames =
|
|
96
95
|
variant === 'hide-disabled' ? `disabled:hidden ${plankControlSpacing}` : plankControlSpacing;
|
|
97
96
|
|
|
97
|
+
const layoutIsAnySolo = !!layoutMode?.startsWith('solo');
|
|
98
|
+
|
|
98
99
|
return (
|
|
99
100
|
<ButtonGroup {...props} classNames={['app-no-drag', classNames]} ref={forwardedRef}>
|
|
100
|
-
{
|
|
101
|
-
<PlankControl
|
|
102
|
-
label={t('pin start label')}
|
|
103
|
-
variant='ghost'
|
|
104
|
-
classNames={buttonClassNames}
|
|
105
|
-
onClick={() => onClick?.('pin-start')}
|
|
106
|
-
icon='ph--caret-line-left--regular'
|
|
107
|
-
/>
|
|
108
|
-
)} */}
|
|
109
|
-
|
|
110
|
-
{capabilities.deck && capabilities.solo && (
|
|
101
|
+
{capabilities.deck && (
|
|
111
102
|
<>
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
103
|
+
{capabilities.solo && (
|
|
104
|
+
<>
|
|
105
|
+
{layoutMode === 'solo' && (
|
|
106
|
+
<PlankControl
|
|
107
|
+
label={t('show fullscreen plank label')}
|
|
108
|
+
classNames={buttonClassNames}
|
|
109
|
+
icon='ph--corners-out--regular'
|
|
110
|
+
onClick={() => onClick?.('solo--fullscreen')}
|
|
111
|
+
/>
|
|
112
|
+
)}
|
|
113
|
+
<PlankControl
|
|
114
|
+
label={t(
|
|
115
|
+
layoutMode === 'solo--fullscreen'
|
|
116
|
+
? 'exit fullscreen label'
|
|
117
|
+
: !layoutIsAnySolo
|
|
118
|
+
? 'show solo plank label'
|
|
119
|
+
: 'show deck plank label',
|
|
120
|
+
)}
|
|
121
|
+
classNames={buttonClassNames}
|
|
122
|
+
icon={layoutIsAnySolo ? 'ph--corners-in--regular' : 'ph--corners-out--regular'}
|
|
123
|
+
onClick={() => onClick?.(layoutMode === 'solo--fullscreen' ? 'solo--fullscreen' : 'solo')}
|
|
124
|
+
/>
|
|
125
|
+
</>
|
|
126
|
+
)}
|
|
127
|
+
|
|
128
|
+
{!layoutIsAnySolo && (
|
|
120
129
|
<>
|
|
121
130
|
<PlankControl
|
|
122
131
|
label={t('increment start label')}
|
|
@@ -137,16 +146,7 @@ export const PlankControls = forwardRef<HTMLDivElement, PlankControlsProps>(
|
|
|
137
146
|
</>
|
|
138
147
|
)}
|
|
139
148
|
|
|
140
|
-
{
|
|
141
|
-
<PlankControl
|
|
142
|
-
label={t('pin end label')}
|
|
143
|
-
classNames={buttonClassNames}
|
|
144
|
-
icon='ph--caret-line-right--regular'
|
|
145
|
-
onClick={() => onClick?.('pin-end')}
|
|
146
|
-
/>
|
|
147
|
-
)} */}
|
|
148
|
-
|
|
149
|
-
{close && !isSolo && (
|
|
149
|
+
{close && !layoutIsAnySolo && (
|
|
150
150
|
<PlankControl
|
|
151
151
|
label={t(`${typeof close === 'string' ? 'minify' : 'close'} label`)}
|
|
152
152
|
classNames={buttonClassNames}
|
|
@@ -13,13 +13,14 @@ import { TextTooltip } from '@dxos/react-ui-text-tooltip';
|
|
|
13
13
|
import { PlankCompanionControls, PlankControls } from './PlankControls';
|
|
14
14
|
import { parseEntryId } from '../../layout';
|
|
15
15
|
import { DECK_PLUGIN } from '../../meta';
|
|
16
|
-
import { PLANK_COMPANION_TYPE, DeckAction, type ResolvedPart } from '../../types';
|
|
16
|
+
import { PLANK_COMPANION_TYPE, DeckAction, type ResolvedPart, type LayoutMode } from '../../types';
|
|
17
17
|
import { useBreakpoints } from '../../util';
|
|
18
18
|
import { soloInlinePadding } from '../fragments';
|
|
19
19
|
|
|
20
20
|
export type PlankHeadingProps = {
|
|
21
21
|
id: string;
|
|
22
22
|
part: ResolvedPart;
|
|
23
|
+
layoutMode?: LayoutMode;
|
|
23
24
|
node?: Node;
|
|
24
25
|
deckEnabled?: boolean;
|
|
25
26
|
canIncrementStart?: boolean;
|
|
@@ -45,6 +46,7 @@ export const PlankHeading = memo(
|
|
|
45
46
|
pending,
|
|
46
47
|
companioned,
|
|
47
48
|
companions,
|
|
49
|
+
layoutMode,
|
|
48
50
|
actions = [],
|
|
49
51
|
}: PlankHeadingProps) => {
|
|
50
52
|
const { t } = useTranslation(DECK_PLUGIN);
|
|
@@ -96,7 +98,7 @@ export const PlankHeading = memo(
|
|
|
96
98
|
|
|
97
99
|
const handlePlankAction = useCallback(
|
|
98
100
|
(eventType: DeckAction.PartAdjustment) => {
|
|
99
|
-
if (eventType
|
|
101
|
+
if (eventType.startsWith('solo')) {
|
|
100
102
|
return dispatch(createIntent(DeckAction.Adjust, { type: eventType, id }));
|
|
101
103
|
} else if (eventType === 'close') {
|
|
102
104
|
if (part === 'complementary') {
|
|
@@ -139,7 +141,7 @@ export const PlankHeading = memo(
|
|
|
139
141
|
return (
|
|
140
142
|
<StackItem.Heading
|
|
141
143
|
classNames={[
|
|
142
|
-
'plb-1 border-be border-separator items-stretch gap-1 sticky inline-start-12 app-drag min-is-0 layout
|
|
144
|
+
'plb-1 border-be border-separator items-stretch gap-1 sticky inline-start-12 app-drag min-is-0 contain-layout',
|
|
143
145
|
part === 'solo' ? soloInlinePadding : 'pli-1',
|
|
144
146
|
]}
|
|
145
147
|
>
|
|
@@ -196,7 +198,7 @@ export const PlankHeading = memo(
|
|
|
196
198
|
) : (
|
|
197
199
|
<PlankControls
|
|
198
200
|
capabilities={capabilities}
|
|
199
|
-
|
|
201
|
+
layoutMode={layoutMode}
|
|
200
202
|
close={part === 'complementary' ? 'minify-end' : true}
|
|
201
203
|
onClick={handlePlankAction}
|
|
202
204
|
/>
|
|
@@ -28,7 +28,7 @@ import { byPosition, type Position } from '@dxos/util';
|
|
|
28
28
|
import { ToggleComplementarySidebarButton } from './SidebarButton';
|
|
29
29
|
import { DeckCapabilities } from '../../capabilities';
|
|
30
30
|
import { DECK_PLUGIN } from '../../meta';
|
|
31
|
-
import { ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE } from '../../types';
|
|
31
|
+
import { ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE, getMode } from '../../types';
|
|
32
32
|
import { layoutAppliesTopbar, useBreakpoints, useHoistStatusbar } from '../../util';
|
|
33
33
|
import { PlankContentError, PlankLoading } from '../Plank';
|
|
34
34
|
|
|
@@ -65,13 +65,14 @@ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) =>
|
|
|
65
65
|
const { t } = useTranslation(DECK_PLUGIN);
|
|
66
66
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
67
67
|
const layout = useCapability(DeckCapabilities.MutableDeckState);
|
|
68
|
+
const layoutMode = getMode(layout.deck);
|
|
68
69
|
const breakpoint = useBreakpoints();
|
|
69
|
-
const topbar = layoutAppliesTopbar(breakpoint);
|
|
70
|
-
const hoistStatusbar = useHoistStatusbar(breakpoint);
|
|
70
|
+
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
71
|
+
const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
|
|
71
72
|
|
|
72
73
|
const companions = useDeckCompanions();
|
|
73
|
-
const activeCompanion = companions.find((companion) => getCompanionId(companion.id) === current)
|
|
74
|
-
const activeId = getCompanionId(activeCompanion
|
|
74
|
+
const activeCompanion = companions.find((companion) => getCompanionId(companion.id) === current);
|
|
75
|
+
const activeId = activeCompanion && getCompanionId(activeCompanion.id);
|
|
75
76
|
const [internalValue, setInternalValue] = useState(activeId);
|
|
76
77
|
|
|
77
78
|
useEffect(() => {
|
|
@@ -101,6 +102,14 @@ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) =>
|
|
|
101
102
|
[activeCompanion?.id, activeCompanion?.data],
|
|
102
103
|
);
|
|
103
104
|
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
if (!activeId) {
|
|
107
|
+
void dispatch(
|
|
108
|
+
createIntent(LayoutAction.UpdateComplementary, { part: 'complementary', options: { state: 'collapsed' } }),
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
}, [activeId, dispatch]);
|
|
112
|
+
|
|
104
113
|
return (
|
|
105
114
|
<Main.ComplementarySidebar
|
|
106
115
|
label={label}
|
|
@@ -145,21 +154,22 @@ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) =>
|
|
|
145
154
|
<ToggleComplementarySidebarButton />
|
|
146
155
|
</div>
|
|
147
156
|
</div>
|
|
148
|
-
{
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
157
|
+
{activeId &&
|
|
158
|
+
companions.map((companion) => (
|
|
159
|
+
<Tabs.Tabpanel
|
|
160
|
+
key={getCompanionId(companion.id)}
|
|
161
|
+
value={getCompanionId(companion.id)}
|
|
162
|
+
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)]'
|
|
163
|
+
{...(layout.complementarySidebarState !== 'expanded' && { inert: 'true' })}
|
|
164
|
+
>
|
|
165
|
+
<ComplementarySidebarPanel
|
|
166
|
+
companion={companion}
|
|
167
|
+
activeId={activeId}
|
|
168
|
+
data={data}
|
|
169
|
+
hoistStatusbar={hoistStatusbar}
|
|
170
|
+
/>
|
|
171
|
+
</Tabs.Tabpanel>
|
|
172
|
+
))}
|
|
163
173
|
</Tabs.Root>
|
|
164
174
|
</Main.ComplementarySidebar>
|
|
165
175
|
);
|
|
@@ -9,15 +9,17 @@ import { type Label, Main } from '@dxos/react-ui';
|
|
|
9
9
|
|
|
10
10
|
import { DeckCapabilities } from '../../capabilities';
|
|
11
11
|
import { DECK_PLUGIN } from '../../meta';
|
|
12
|
+
import { getMode } from '../../types';
|
|
12
13
|
import { layoutAppliesTopbar, useBreakpoints, useHoistStatusbar } from '../../util';
|
|
13
14
|
|
|
14
15
|
const label = ['sidebar title', { ns: DECK_PLUGIN }] satisfies Label;
|
|
15
16
|
|
|
16
17
|
export const Sidebar = () => {
|
|
17
|
-
const { popoverAnchorId, activeDeck: current } = useCapability(DeckCapabilities.DeckState);
|
|
18
|
+
const { popoverAnchorId, activeDeck: current, deck } = useCapability(DeckCapabilities.DeckState);
|
|
18
19
|
const breakpoint = useBreakpoints();
|
|
19
|
-
const
|
|
20
|
-
const
|
|
20
|
+
const layoutMode = getMode(deck);
|
|
21
|
+
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
22
|
+
const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
|
|
21
23
|
|
|
22
24
|
const navigationData = useMemo(
|
|
23
25
|
() => ({ popoverAnchorId, topbar, hoistStatusbar, current }),
|
package/src/translations.ts
CHANGED
|
@@ -45,6 +45,8 @@ 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',
|
|
48
50
|
'close label': 'Close',
|
|
49
51
|
'minify label': 'Minify',
|
|
50
52
|
'open companion label': 'Open companion',
|
package/src/types.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { LayoutAction } from '@dxos/app-framework';
|
|
6
6
|
import { S } from '@dxos/echo-schema';
|
|
7
|
+
import { type DeepReadonly } from '@dxos/util';
|
|
7
8
|
|
|
8
9
|
import { DECK_PLUGIN } from './meta';
|
|
9
10
|
|
|
@@ -61,13 +62,13 @@ export const defaultDeck: DeckState = {
|
|
|
61
62
|
companionFrameSizing: {},
|
|
62
63
|
};
|
|
63
64
|
|
|
64
|
-
const LayoutMode = S.Literal('deck', 'solo', 'fullscreen');
|
|
65
|
+
const LayoutMode = S.Literal('deck', 'solo', 'solo--fullscreen');
|
|
65
66
|
export type LayoutMode = S.Schema.Type<typeof LayoutMode>;
|
|
66
67
|
export const isLayoutMode = (value: any): value is LayoutMode => S.is(LayoutMode)(value);
|
|
67
68
|
|
|
68
|
-
export const getMode = (deck: DeckState): LayoutMode => {
|
|
69
|
+
export const getMode = (deck: DeckState | DeepReadonly<DeckState>): LayoutMode => {
|
|
69
70
|
if (deck.solo) {
|
|
70
|
-
return deck.fullscreen ? 'fullscreen' : 'solo';
|
|
71
|
+
return deck.fullscreen ? 'solo--fullscreen' : 'solo';
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
return 'deck';
|
|
@@ -80,16 +81,17 @@ export const DeckPluginState = S.Struct({
|
|
|
80
81
|
complementarySidebarPanel: S.optional(S.String),
|
|
81
82
|
|
|
82
83
|
dialogOpen: S.Boolean,
|
|
83
|
-
/** Data to be passed to the dialog Surface. */
|
|
84
|
-
dialogContent: S.optional(S.Any),
|
|
85
84
|
dialogBlockAlign: S.optional(S.Literal('start', 'center', 'end')),
|
|
86
85
|
dialogType: S.optional(S.Literal('default', 'alert')),
|
|
86
|
+
/** Data to be passed to the dialog Surface. */
|
|
87
|
+
dialogContent: S.optional(S.Any),
|
|
87
88
|
|
|
88
89
|
popoverOpen: S.Boolean,
|
|
89
90
|
popoverSide: S.optional(S.Literal('top', 'right', 'bottom', 'left')),
|
|
91
|
+
popoverAnchor: S.optional(S.Any),
|
|
92
|
+
popoverAnchorId: S.optional(S.String),
|
|
90
93
|
/** Data to be passed to the popover Surface. */
|
|
91
94
|
popoverContent: S.optional(S.Any),
|
|
92
|
-
popoverAnchorId: S.optional(S.String),
|
|
93
95
|
|
|
94
96
|
toasts: S.mutable(S.Array(LayoutAction.Toast)),
|
|
95
97
|
currentUndoId: S.optional(S.String),
|
|
@@ -113,6 +115,7 @@ export namespace DeckAction {
|
|
|
113
115
|
S.Literal('close').annotations({ description: 'Close the plank.' }),
|
|
114
116
|
S.Literal('companion').annotations({ description: 'Open the companion plank.' }),
|
|
115
117
|
S.Literal('solo').annotations({ description: 'Solo the plank.' }),
|
|
118
|
+
S.Literal('solo--fullscreen').annotations({ description: 'Fullscreen the plank.' }),
|
|
116
119
|
S.Literal('increment-start').annotations({ description: 'Move the plank towards the start of the deck.' }),
|
|
117
120
|
S.Literal('increment-end').annotations({ description: 'Move the plank towards the end of the deck.' }),
|
|
118
121
|
);
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { type LayoutMode } from '../types';
|
|
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
|
+
);
|
|
7
13
|
};
|
|
@@ -8,13 +8,18 @@ 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 } from '../types';
|
|
11
|
+
import type { DeckSettingsProps, LayoutMode } from '../types';
|
|
12
12
|
|
|
13
|
-
export const useHoistStatusbar = (breakpoint: string): boolean => {
|
|
13
|
+
export const useHoistStatusbar = (breakpoint: string, layoutMode?: LayoutMode): 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
|
-
|
|
18
|
+
return (
|
|
19
|
+
breakpoint === 'desktop' &&
|
|
20
|
+
layoutMode !== 'solo--fullscreen' &&
|
|
21
|
+
!!enableStatusbar &&
|
|
22
|
+
safeAreaPadding?.bottom === 0
|
|
23
|
+
);
|
|
24
|
+
}, [enableStatusbar, breakpoint, safeAreaPadding?.bottom, layoutMode]);
|
|
20
25
|
};
|