@dxos/plugin-deck 0.8.4-main.bc674ce → 0.8.4-main.c351d160a8
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/Banner-AJW6225V.mjs +14 -0
- package/dist/lib/browser/Banner-AJW6225V.mjs.map +7 -0
- package/dist/lib/browser/DeckSettings-HSSQKFNE.mjs +96 -0
- package/dist/lib/browser/DeckSettings-HSSQKFNE.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-DTVCULQ4.mjs → app-graph-builder-MP6INIM2.mjs} +16 -13
- package/dist/lib/browser/app-graph-builder-MP6INIM2.mjs.map +7 -0
- package/dist/lib/browser/{check-app-scheme-JSRXXIYF.mjs → check-app-scheme-AUNCD2Y6.mjs} +9 -8
- package/dist/lib/browser/check-app-scheme-AUNCD2Y6.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ATFPDN6J.mjs → chunk-3P2FJVXC.mjs} +35 -49
- package/dist/lib/browser/chunk-3P2FJVXC.mjs.map +7 -0
- package/dist/lib/browser/chunk-BJDEG7YZ.mjs +74 -0
- package/dist/lib/browser/chunk-BJDEG7YZ.mjs.map +7 -0
- package/dist/lib/browser/chunk-L3RYMAV7.mjs +16 -0
- package/dist/lib/browser/chunk-L3RYMAV7.mjs.map +7 -0
- package/dist/lib/browser/{chunk-UNG4CLLP.mjs → chunk-TAHLKBDO.mjs} +46 -20
- package/dist/lib/browser/chunk-TAHLKBDO.mjs.map +7 -0
- package/dist/lib/browser/{chunk-S4A5UO4K.mjs → chunk-WTNYSXY5.mjs} +221 -281
- package/dist/lib/browser/chunk-WTNYSXY5.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +39 -35
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{operation-resolver-CDYBLZJ4.mjs → operation-resolver-2TEGT4PG.mjs} +166 -122
- package/dist/lib/browser/operation-resolver-2TEGT4PG.mjs.map +7 -0
- package/dist/lib/browser/{react-root-XDCMNENQ.mjs → react-root-XBFHPSCP.mjs} +8 -7
- package/dist/lib/browser/react-root-XBFHPSCP.mjs.map +7 -0
- package/dist/lib/browser/react-surface-4J3BZNT2.mjs +44 -0
- package/dist/lib/browser/react-surface-4J3BZNT2.mjs.map +7 -0
- package/dist/lib/browser/{settings-OMHVGZ6V.mjs → settings-PTMGCSJH.mjs} +8 -5
- package/dist/lib/browser/settings-PTMGCSJH.mjs.map +7 -0
- package/dist/lib/browser/{state-OC3BSB6E.mjs → state-MA4SQ7BE.mjs} +11 -8
- package/dist/lib/browser/state-MA4SQ7BE.mjs.map +7 -0
- package/dist/lib/browser/{toolkit-R53LD3EA.mjs → toolkit-6B34QFU3.mjs} +10 -8
- package/dist/lib/browser/toolkit-6B34QFU3.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +4 -5
- package/dist/lib/browser/{url-handler-53TE6JZO.mjs → url-handler-FEUFPQIP.mjs} +22 -17
- package/dist/lib/browser/url-handler-FEUFPQIP.mjs.map +7 -0
- package/dist/lib/node-esm/Banner-XBH2IIDR.mjs +15 -0
- package/dist/lib/node-esm/Banner-XBH2IIDR.mjs.map +7 -0
- package/dist/lib/node-esm/DeckSettings-DJRFLKQS.mjs +97 -0
- package/dist/lib/node-esm/DeckSettings-DJRFLKQS.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-473BNZDJ.mjs → app-graph-builder-ACHG5HY7.mjs} +16 -13
- package/dist/lib/node-esm/app-graph-builder-ACHG5HY7.mjs.map +7 -0
- package/dist/lib/node-esm/{check-app-scheme-IVYRHKRH.mjs → check-app-scheme-WN76GWVC.mjs} +9 -8
- package/dist/lib/node-esm/check-app-scheme-WN76GWVC.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-D34L3ECT.mjs → chunk-CQ3XYTNJ.mjs} +220 -280
- package/dist/lib/node-esm/chunk-CQ3XYTNJ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DGTRKKWZ.mjs +76 -0
- package/dist/lib/node-esm/chunk-DGTRKKWZ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-SKEVPQ7E.mjs → chunk-EMU4VIPH.mjs} +46 -20
- package/dist/lib/node-esm/chunk-EMU4VIPH.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-XAKTY3EB.mjs → chunk-GZJAQ5IP.mjs} +34 -49
- package/dist/lib/node-esm/chunk-GZJAQ5IP.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XCNF4COU.mjs +18 -0
- package/dist/lib/node-esm/chunk-XCNF4COU.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +39 -35
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{operation-resolver-WUOE33ID.mjs → operation-resolver-GCMCCI7A.mjs} +166 -122
- package/dist/lib/node-esm/operation-resolver-GCMCCI7A.mjs.map +7 -0
- package/dist/lib/node-esm/{react-root-O6GZO62Z.mjs → react-root-32LZ6APH.mjs} +8 -7
- package/dist/lib/node-esm/react-root-32LZ6APH.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-IHDJDGC5.mjs → react-surface-CO4ZDZKM.mjs} +18 -16
- package/dist/lib/node-esm/react-surface-CO4ZDZKM.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-2HB6FKIK.mjs → settings-LPPFLXNJ.mjs} +8 -5
- package/dist/lib/node-esm/settings-LPPFLXNJ.mjs.map +7 -0
- package/dist/lib/node-esm/{state-JRQ45ACJ.mjs → state-KNRU3GDC.mjs} +11 -8
- package/dist/lib/node-esm/state-KNRU3GDC.mjs.map +7 -0
- package/dist/lib/node-esm/{toolkit-JLPZNNKB.mjs → toolkit-SOWYKJY3.mjs} +10 -8
- package/dist/lib/node-esm/toolkit-SOWYKJY3.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +4 -5
- package/dist/lib/node-esm/{url-handler-QGF2R24T.mjs → url-handler-4LEB7UWF.mjs} +22 -17
- package/dist/lib/node-esm/url-handler-4LEB7UWF.mjs.map +7 -0
- package/dist/types/src/DeckPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts +1 -1
- package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root/react-root.d.ts +1 -1
- package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings/index.d.ts +1 -1
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings/settings.d.ts +4 -3
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state/index.d.ts +6 -6
- package/dist/types/src/capabilities/state/state.d.ts +7 -7
- package/dist/types/src/capabilities/state/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit/index.d.ts +1 -1
- package/dist/types/src/capabilities/toolkit/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts +4 -3
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -1
- package/dist/types/src/capabilities/tools/tools.d.ts +1 -1
- package/dist/types/src/capabilities/tools/tools.d.ts.map +1 -1
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts +1 -1
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/ActiveNode.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts +1 -0
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckMain.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Fallback.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Popover.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Toast.d.ts +3 -3
- package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.d.ts +2 -2
- package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.stories.d.ts +3 -2
- package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankControls.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankError.d.ts +5 -3
- package/dist/types/src/components/Plank/PlankError.d.ts.map +1 -1
- 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/fragments.d.ts +4 -1
- package/dist/types/src/components/fragments.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/Banner/Banner.d.ts +2 -0
- package/dist/types/src/containers/Banner/Banner.d.ts.map +1 -0
- package/dist/types/src/containers/Banner/index.d.ts +3 -0
- package/dist/types/src/containers/Banner/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/DeckSettings/DeckSettings.d.ts.map +1 -1
- package/dist/types/src/containers/DeckSettings/index.d.ts +3 -0
- package/dist/types/src/containers/DeckSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +4 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts +0 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useMainSize.d.ts +2 -2
- package/dist/types/src/hooks/useSelectedCompanion.d.ts +13 -0
- package/dist/types/src/hooks/useSelectedCompanion.d.ts.map +1 -0
- package/dist/types/src/layout.d.ts +1 -7
- package/dist/types/src/layout.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +6 -6
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/events.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +18 -16
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +48 -44
- package/src/DeckPlugin.ts +12 -11
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +11 -10
- package/src/capabilities/check-app-scheme/check-app-scheme.ts +12 -8
- package/src/capabilities/operation-resolver/operation-resolver.ts +110 -107
- package/src/capabilities/react-root/react-root.tsx +2 -2
- package/src/capabilities/react-surface/react-surface.tsx +11 -10
- package/src/capabilities/settings/settings.ts +3 -2
- package/src/capabilities/state/state.ts +6 -5
- package/src/capabilities/toolkit/toolkit.ts +7 -6
- package/src/capabilities/tools/tools.ts +0 -1
- package/src/capabilities/url-handler/url-handler.ts +16 -13
- package/src/components/DeckLayout/ActiveNode.tsx +3 -2
- package/src/components/DeckLayout/Banner.tsx +8 -8
- package/src/components/DeckLayout/ContentEmpty.tsx +3 -3
- package/src/components/DeckLayout/DeckLayout.stories.tsx +8 -6
- package/src/components/DeckLayout/DeckMain.tsx +26 -25
- package/src/components/DeckLayout/Dialog.tsx +10 -4
- package/src/components/DeckLayout/Fallback.tsx +2 -6
- package/src/components/DeckLayout/Popover.tsx +46 -14
- package/src/components/DeckLayout/StatusBar.tsx +4 -4
- package/src/components/DeckLayout/Toast.tsx +3 -3
- package/src/components/Plank/Plank.stories.tsx +7 -5
- package/src/components/Plank/Plank.tsx +32 -24
- package/src/components/Plank/PlankControls.tsx +6 -8
- package/src/components/Plank/PlankError.tsx +29 -15
- package/src/components/Plank/PlankHeading.tsx +24 -26
- package/src/components/Plank/PlankLoading.tsx +1 -1
- package/src/components/Sidebar/ComplementarySidebar.tsx +50 -51
- package/src/components/Sidebar/Sidebar.tsx +4 -4
- package/src/components/Sidebar/SidebarButton.tsx +12 -12
- package/src/components/fragments.ts +9 -4
- package/src/components/index.ts +0 -1
- package/src/containers/Banner/Banner.tsx +5 -0
- package/src/containers/Banner/index.ts +7 -0
- package/src/{components → containers}/DeckSettings/DeckSettings.tsx +23 -23
- package/src/containers/DeckSettings/index.ts +7 -0
- package/src/containers/index.ts +8 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useCompanions.ts +2 -2
- package/src/hooks/useDeckCompanions.ts +3 -8
- package/src/hooks/useDeckState.ts +3 -3
- package/src/hooks/useHoistStatusbar.ts +1 -1
- package/src/hooks/useMainSize.ts +2 -2
- package/src/hooks/useNodeActionExpander.ts +1 -1
- package/src/hooks/useSelectedCompanion.ts +32 -0
- package/src/layout.ts +1 -14
- package/src/meta.ts +1 -1
- package/src/translations.ts +1 -0
- package/src/types/capabilities.ts +5 -5
- package/src/types/events.ts +5 -4
- package/src/types/schema.ts +22 -21
- package/src/util/overscroll.ts +3 -3
- package/dist/lib/browser/app-graph-builder-DTVCULQ4.mjs.map +0 -7
- package/dist/lib/browser/check-app-scheme-JSRXXIYF.mjs.map +0 -7
- package/dist/lib/browser/chunk-ATFPDN6J.mjs.map +0 -7
- package/dist/lib/browser/chunk-NHABISX2.mjs +0 -152
- package/dist/lib/browser/chunk-NHABISX2.mjs.map +0 -7
- package/dist/lib/browser/chunk-S4A5UO4K.mjs.map +0 -7
- package/dist/lib/browser/chunk-UNG4CLLP.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-CDYBLZJ4.mjs.map +0 -7
- package/dist/lib/browser/react-root-XDCMNENQ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-HODERLOL.mjs +0 -42
- package/dist/lib/browser/react-surface-HODERLOL.mjs.map +0 -7
- package/dist/lib/browser/settings-OMHVGZ6V.mjs.map +0 -7
- package/dist/lib/browser/state-OC3BSB6E.mjs.map +0 -7
- package/dist/lib/browser/toolkit-R53LD3EA.mjs.map +0 -7
- package/dist/lib/browser/url-handler-53TE6JZO.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-473BNZDJ.mjs.map +0 -7
- package/dist/lib/node-esm/check-app-scheme-IVYRHKRH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ADPMWKLL.mjs +0 -154
- package/dist/lib/node-esm/chunk-ADPMWKLL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-D34L3ECT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SKEVPQ7E.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XAKTY3EB.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-WUOE33ID.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-O6GZO62Z.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-IHDJDGC5.mjs.map +0 -7
- package/dist/lib/node-esm/settings-2HB6FKIK.mjs.map +0 -7
- package/dist/lib/node-esm/state-JRQ45ACJ.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-JLPZNNKB.mjs.map +0 -7
- package/dist/lib/node-esm/url-handler-QGF2R24T.mjs.map +0 -7
- package/dist/types/src/components/DeckSettings/index.d.ts +0 -2
- package/dist/types/src/components/DeckSettings/index.d.ts.map +0 -1
- package/src/components/DeckSettings/index.ts +0 -5
- /package/dist/types/src/{components → containers}/DeckSettings/DeckSettings.d.ts +0 -0
|
@@ -4,24 +4,24 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
8
|
+
import { LayoutOperation, getCompanionVariant } from '@dxos/app-toolkit';
|
|
9
9
|
import { IconButton, type IconButtonProps, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { useDeckCompanions, useDeckState } from '../../hooks';
|
|
12
12
|
import { meta } from '../../meta';
|
|
13
13
|
|
|
14
14
|
export const ToggleSidebarButton = ({
|
|
15
15
|
classNames,
|
|
16
16
|
variant = 'ghost',
|
|
17
17
|
}: ThemedClassName<Pick<IconButtonProps, 'variant'>>) => {
|
|
18
|
-
const {
|
|
18
|
+
const { updateState } = useDeckState();
|
|
19
19
|
const { t } = useTranslation(meta.id);
|
|
20
20
|
|
|
21
21
|
const handleClick = useCallback(() => {
|
|
22
|
-
updateState((
|
|
23
|
-
...
|
|
24
|
-
sidebarState:
|
|
22
|
+
updateState((state) => ({
|
|
23
|
+
...state,
|
|
24
|
+
sidebarState: state.sidebarState === 'expanded' ? 'collapsed' : 'expanded',
|
|
25
25
|
}));
|
|
26
26
|
}, [updateState]);
|
|
27
27
|
|
|
@@ -43,7 +43,7 @@ export const CloseSidebarButton = () => {
|
|
|
43
43
|
const { t } = useTranslation(meta.id);
|
|
44
44
|
|
|
45
45
|
const handleClick = useCallback(() => {
|
|
46
|
-
updateState((
|
|
46
|
+
updateState((state) => ({ ...state, sidebarState: 'collapsed' }));
|
|
47
47
|
}, [updateState]);
|
|
48
48
|
|
|
49
49
|
return (
|
|
@@ -54,7 +54,7 @@ export const CloseSidebarButton = () => {
|
|
|
54
54
|
size={4}
|
|
55
55
|
label={t('close navigation sidebar label')}
|
|
56
56
|
onClick={handleClick}
|
|
57
|
-
classNames='rounded-none
|
|
57
|
+
classNames='rounded-none px-1 dx-focus-ring-inset pe-[max(.5rem,env(safe-area-inset-left))]'
|
|
58
58
|
/>
|
|
59
59
|
);
|
|
60
60
|
};
|
|
@@ -71,11 +71,11 @@ export const ToggleComplementarySidebarButton = ({
|
|
|
71
71
|
const companions = useDeckCompanions();
|
|
72
72
|
const handleClick = useCallback(() => {
|
|
73
73
|
const nextState = state.complementarySidebarState === 'expanded' ? 'collapsed' : 'expanded';
|
|
74
|
-
updateState((
|
|
74
|
+
updateState((state) => ({ ...state, complementarySidebarState: nextState }));
|
|
75
75
|
|
|
76
|
-
const subject = state.complementarySidebarPanel ?? (companions[0] &&
|
|
76
|
+
const subject = state.complementarySidebarPanel ?? (companions[0] && getCompanionVariant(companions[0].id));
|
|
77
77
|
if (nextState === 'expanded' && !current && subject) {
|
|
78
|
-
invokeSync(
|
|
78
|
+
invokeSync(LayoutOperation.UpdateComplementary, { subject });
|
|
79
79
|
}
|
|
80
80
|
}, [state, updateState, current, companions, invokeSync]);
|
|
81
81
|
|
|
@@ -4,11 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import { mx } from '@dxos/ui-theme';
|
|
6
6
|
|
|
7
|
+
// TODO(burdon): Move to these as dx-components?
|
|
8
|
+
|
|
9
|
+
/** @private */
|
|
7
10
|
export const soloInlinePadding =
|
|
8
|
-
'
|
|
11
|
+
'ps-[calc(env(safe-area-inset-left)+.25rem)] pe-[calc(env(safe-area-inset-right)+.25rem)]';
|
|
9
12
|
|
|
10
|
-
const sidebarToggleStyles = '
|
|
13
|
+
const sidebarToggleStyles = 'h-(--dx-rail-item) w-(--dx-rail-item) absolute bottom-2 z-[1] !bg-deck-surface lg:hidden';
|
|
11
14
|
|
|
12
|
-
|
|
15
|
+
/** @private */
|
|
16
|
+
export const fixedSidebarToggleStyles = mx(sidebarToggleStyles, 'left-2');
|
|
13
17
|
|
|
14
|
-
|
|
18
|
+
/** @private */
|
|
19
|
+
export const fixedComplementarySidebarToggleStyles = mx(sidebarToggleStyles, 'right-2');
|
package/src/components/index.ts
CHANGED
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { Input, Select, useTranslation } from '@dxos/react-ui';
|
|
8
|
-
import {
|
|
8
|
+
import { Settings } from '@dxos/react-ui-form';
|
|
9
9
|
|
|
10
10
|
import { meta } from '../../meta';
|
|
11
11
|
import {
|
|
12
12
|
type DeckSettingsProps,
|
|
13
13
|
type NewPlankPositioning,
|
|
14
14
|
NewPlankPositions,
|
|
15
|
+
OverScrollToProps,
|
|
15
16
|
type Overscroll,
|
|
16
|
-
OverscrollOptions,
|
|
17
17
|
} from '../../types';
|
|
18
18
|
|
|
19
19
|
const isSocket = !!(globalThis as any).__args;
|
|
@@ -27,22 +27,22 @@ export const DeckSettings = ({ settings, onSettingsChange }: DeckSettingsCompone
|
|
|
27
27
|
const { t } = useTranslation(meta.id);
|
|
28
28
|
|
|
29
29
|
return (
|
|
30
|
-
<
|
|
31
|
-
<
|
|
32
|
-
<
|
|
33
|
-
<
|
|
30
|
+
<Settings.Root>
|
|
31
|
+
<Settings.Section title={t('settings title', { ns: meta.id })}>
|
|
32
|
+
<Settings.Group>
|
|
33
|
+
<Settings.ItemInput title={t('settings enable deck label')}>
|
|
34
34
|
<Input.Switch
|
|
35
35
|
checked={settings.enableDeck}
|
|
36
36
|
onCheckedChange={(checked) => onSettingsChange((s) => ({ ...s, enableDeck: checked }))}
|
|
37
37
|
/>
|
|
38
|
-
</
|
|
39
|
-
<
|
|
38
|
+
</Settings.ItemInput>
|
|
39
|
+
<Settings.ItemInput title={t('settings encapsulated planks label')}>
|
|
40
40
|
<Input.Switch
|
|
41
41
|
checked={settings.encapsulatedPlanks ?? false}
|
|
42
42
|
onCheckedChange={(checked) => onSettingsChange((s) => ({ ...s, encapsulatedPlanks: checked }))}
|
|
43
43
|
/>
|
|
44
|
-
</
|
|
45
|
-
<
|
|
44
|
+
</Settings.ItemInput>
|
|
45
|
+
<Settings.ItemInput title={t('select new plank positioning label')}>
|
|
46
46
|
<Select.Root
|
|
47
47
|
disabled={!settings.enableDeck}
|
|
48
48
|
value={settings.newPlankPositioning ?? 'start'}
|
|
@@ -64,8 +64,8 @@ export const DeckSettings = ({ settings, onSettingsChange }: DeckSettingsCompone
|
|
|
64
64
|
</Select.Content>
|
|
65
65
|
</Select.Portal>
|
|
66
66
|
</Select.Root>
|
|
67
|
-
</
|
|
68
|
-
<
|
|
67
|
+
</Settings.ItemInput>
|
|
68
|
+
<Settings.ItemInput title={t('settings overscroll label')}>
|
|
69
69
|
<Select.Root
|
|
70
70
|
disabled={!settings.enableDeck}
|
|
71
71
|
value={settings.overscroll ?? 'none'}
|
|
@@ -75,7 +75,7 @@ export const DeckSettings = ({ settings, onSettingsChange }: DeckSettingsCompone
|
|
|
75
75
|
<Select.Portal>
|
|
76
76
|
<Select.Content>
|
|
77
77
|
<Select.Viewport>
|
|
78
|
-
{
|
|
78
|
+
{OverScrollToProps.map((option) => (
|
|
79
79
|
<Select.Option key={option} value={option}>
|
|
80
80
|
{t(`settings overscroll ${option} label`)}
|
|
81
81
|
</Select.Option>
|
|
@@ -85,29 +85,29 @@ export const DeckSettings = ({ settings, onSettingsChange }: DeckSettingsCompone
|
|
|
85
85
|
</Select.Content>
|
|
86
86
|
</Select.Portal>
|
|
87
87
|
</Select.Root>
|
|
88
|
-
</
|
|
89
|
-
<
|
|
88
|
+
</Settings.ItemInput>
|
|
89
|
+
<Settings.ItemInput title={t('settings enable statusbar label')}>
|
|
90
90
|
<Input.Switch
|
|
91
91
|
checked={settings.enableStatusbar}
|
|
92
92
|
onCheckedChange={(checked) => onSettingsChange((s) => ({ ...s, enableStatusbar: checked }))}
|
|
93
93
|
/>
|
|
94
|
-
</
|
|
95
|
-
<
|
|
94
|
+
</Settings.ItemInput>
|
|
95
|
+
<Settings.ItemInput title={t('settings show hints label')}>
|
|
96
96
|
<Input.Switch
|
|
97
97
|
checked={settings.showHints}
|
|
98
98
|
onCheckedChange={(checked) => onSettingsChange((s) => ({ ...s, showHints: checked }))}
|
|
99
99
|
/>
|
|
100
|
-
</
|
|
100
|
+
</Settings.ItemInput>
|
|
101
101
|
{!isSocket && (
|
|
102
|
-
<
|
|
102
|
+
<Settings.ItemInput title={t('settings native redirect label')}>
|
|
103
103
|
<Input.Switch
|
|
104
104
|
checked={settings.enableNativeRedirect}
|
|
105
105
|
onCheckedChange={(checked) => onSettingsChange((s) => ({ ...s, enableNativeRedirect: checked }))}
|
|
106
106
|
/>
|
|
107
|
-
</
|
|
107
|
+
</Settings.ItemInput>
|
|
108
108
|
)}
|
|
109
|
-
</
|
|
110
|
-
</
|
|
111
|
-
</
|
|
109
|
+
</Settings.Group>
|
|
110
|
+
</Settings.Section>
|
|
111
|
+
</Settings.Root>
|
|
112
112
|
);
|
|
113
113
|
};
|
package/src/hooks/index.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { useAppGraph } from '@dxos/app-
|
|
7
|
+
import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
8
8
|
import { useConnections } from '@dxos/plugin-graph';
|
|
9
9
|
import { byPosition } from '@dxos/util';
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@ import { PLANK_COMPANION_TYPE } from '../types';
|
|
|
12
12
|
|
|
13
13
|
export const useCompanions = (id?: string) => {
|
|
14
14
|
const { graph } = useAppGraph();
|
|
15
|
-
const nodes = useConnections(graph, id);
|
|
15
|
+
const nodes = useConnections(graph, id, 'child');
|
|
16
16
|
const companions = nodes.filter((node) => node.type === PLANK_COMPANION_TYPE);
|
|
17
17
|
return useMemo(() => companions.toSorted((a, b) => byPosition(a.properties, b.properties)), [companions]);
|
|
18
18
|
};
|
|
@@ -2,18 +2,13 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { useAppGraph } from '@dxos/app-
|
|
5
|
+
import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
6
6
|
import { Node, type Node as NodeType } from '@dxos/plugin-graph';
|
|
7
7
|
import { useConnections } from '@dxos/plugin-graph';
|
|
8
8
|
import { type Label } from '@dxos/ui-types';
|
|
9
9
|
import { type Position, byPosition } from '@dxos/util';
|
|
10
10
|
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
export const getCompanionId = (id: string) => {
|
|
14
|
-
const [_, companionId] = id.split(ATTENDABLE_PATH_SEPARATOR);
|
|
15
|
-
return companionId ?? 'never';
|
|
16
|
-
};
|
|
11
|
+
import { DECK_COMPANION_TYPE } from '../types';
|
|
17
12
|
|
|
18
13
|
export type DeckCompanion = NodeType.Node<
|
|
19
14
|
any,
|
|
@@ -29,7 +24,7 @@ export type DeckCompanion = NodeType.Node<
|
|
|
29
24
|
|
|
30
25
|
export const useDeckCompanions = (): DeckCompanion[] => {
|
|
31
26
|
const { graph } = useAppGraph();
|
|
32
|
-
const connections = useConnections(graph, Node.RootId);
|
|
27
|
+
const connections = useConnections(graph, Node.RootId, 'child');
|
|
33
28
|
const companions = connections.filter((node) => node.type === DECK_COMPANION_TYPE) as DeckCompanion[];
|
|
34
29
|
return companions.toSorted((a, b) => byPosition(a.properties, b.properties));
|
|
35
30
|
};
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import { useAtomValue } from '@effect-atom/atom-react';
|
|
6
6
|
import { useCallback, useMemo } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import { useCapability } from '@dxos/app-framework/
|
|
8
|
+
import { Capabilities } from '@dxos/app-framework';
|
|
9
|
+
import { useCapability } from '@dxos/app-framework/ui';
|
|
10
10
|
import { invariant } from '@dxos/invariant';
|
|
11
11
|
|
|
12
12
|
import {
|
|
@@ -33,7 +33,7 @@ export type DeckStateHook = {
|
|
|
33
33
|
* Returns the combined state, the active deck, and update functions for each atom.
|
|
34
34
|
*/
|
|
35
35
|
export const useDeckState = (): DeckStateHook => {
|
|
36
|
-
const registry = useCapability(
|
|
36
|
+
const registry = useCapability(Capabilities.AtomRegistry);
|
|
37
37
|
const stateAtom = useCapability(DeckCapabilities.State);
|
|
38
38
|
const ephemeralAtom = useCapability(DeckCapabilities.EphemeralState);
|
|
39
39
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { useAtomCapability } from '@dxos/app-framework/
|
|
7
|
+
import { useAtomCapability } from '@dxos/app-framework/ui';
|
|
8
8
|
import { useThemeContext } from '@dxos/react-ui';
|
|
9
9
|
|
|
10
10
|
import { DeckCapabilities, type LayoutMode } from '../types';
|
package/src/hooks/useMainSize.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { useMainContext } from '@dxos/react-ui';
|
|
|
7
7
|
export const useMainSize = () => {
|
|
8
8
|
const { navigationSidebarState, complementarySidebarState } = useMainContext('DeckPluginPlank');
|
|
9
9
|
return {
|
|
10
|
-
'data-sidebar-
|
|
11
|
-
'data-sidebar-
|
|
10
|
+
'data-sidebar-left-state': navigationSidebarState,
|
|
11
|
+
'data-sidebar-right-state': complementarySidebarState,
|
|
12
12
|
};
|
|
13
13
|
};
|
|
@@ -11,7 +11,7 @@ export const useNodeActionExpander = (node?: Node.Node) => {
|
|
|
11
11
|
if (node) {
|
|
12
12
|
const frame = requestAnimationFrame(() => {
|
|
13
13
|
const graph = Graph.getGraph(node);
|
|
14
|
-
void Graph.expand(graph, node.id);
|
|
14
|
+
void Graph.expand(graph, node.id, 'action');
|
|
15
15
|
});
|
|
16
16
|
return () => cancelAnimationFrame(frame);
|
|
17
17
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { getCompanionVariant } from '@dxos/app-toolkit';
|
|
8
|
+
import { type Node } from '@dxos/plugin-graph';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Resolves which companion to show based on variant preference.
|
|
12
|
+
* Falls back to first available if preferred variant not found.
|
|
13
|
+
*/
|
|
14
|
+
export const useSelectedCompanion = (companions: Node.Node[], preferredVariant?: string) => {
|
|
15
|
+
return useMemo(() => {
|
|
16
|
+
if (companions.length === 0) {
|
|
17
|
+
return { companionId: undefined, variant: undefined };
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Try to find companion matching the preferred variant.
|
|
21
|
+
if (preferredVariant) {
|
|
22
|
+
const preferred = companions.find((companion) => getCompanionVariant(companion.id) === preferredVariant);
|
|
23
|
+
if (preferred) {
|
|
24
|
+
return { companionId: preferred.id, variant: getCompanionVariant(preferred.id) };
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Fallback to first companion.
|
|
29
|
+
const first = companions[0];
|
|
30
|
+
return { companionId: first.id, variant: getCompanionVariant(first.id) };
|
|
31
|
+
}, [companions, preferredVariant]);
|
|
32
|
+
};
|
package/src/layout.ts
CHANGED
|
@@ -4,29 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import { produce } from 'immer';
|
|
6
6
|
|
|
7
|
-
import { ATTENDABLE_PATH_SEPARATOR } from '@dxos/react-ui-attention';
|
|
8
|
-
|
|
9
7
|
import { type DeckAction, type NewPlankPositioning } from './types';
|
|
10
8
|
|
|
11
|
-
export const createEntryId = (entryId: string, variant?: string) =>
|
|
12
|
-
variant ? `${entryId}${ATTENDABLE_PATH_SEPARATOR}${variant}` : entryId;
|
|
13
|
-
|
|
14
|
-
export const parseEntryId = (entryId: string) => {
|
|
15
|
-
const [id, variant] = entryId.split(ATTENDABLE_PATH_SEPARATOR);
|
|
16
|
-
return { id, variant };
|
|
17
|
-
};
|
|
18
|
-
|
|
19
9
|
type OpenLayoutEntryOptions = {
|
|
20
10
|
key?: string;
|
|
21
11
|
positioning?: NewPlankPositioning;
|
|
22
12
|
pivotId?: string;
|
|
23
|
-
variant?: string;
|
|
24
13
|
};
|
|
25
14
|
|
|
26
|
-
export const openEntry = (deck: string[],
|
|
15
|
+
export const openEntry = (deck: string[], entryId: string, options?: OpenLayoutEntryOptions): string[] => {
|
|
27
16
|
return produce(deck, (draft) => {
|
|
28
|
-
const entryId = createEntryId(_entryId, options?.variant);
|
|
29
|
-
|
|
30
17
|
// Check that the entry is not already in the part
|
|
31
18
|
if (draft.find((id) => id === entryId)) {
|
|
32
19
|
return;
|
package/src/meta.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { type Plugin } from '@dxos/app-framework';
|
|
|
6
6
|
import { trim } from '@dxos/util';
|
|
7
7
|
|
|
8
8
|
export const meta: Plugin.Meta = {
|
|
9
|
-
id: 'dxos.
|
|
9
|
+
id: 'org.dxos.plugin.deck',
|
|
10
10
|
name: 'Layout',
|
|
11
11
|
description: trim`
|
|
12
12
|
Flexible layout system for arranging workspace views in tabs, splits, and panels.
|
package/src/translations.ts
CHANGED
|
@@ -5,27 +5,27 @@
|
|
|
5
5
|
import { type Atom } from '@effect-atom/atom-react';
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
9
|
import { invariant } from '@dxos/invariant';
|
|
10
10
|
|
|
11
11
|
import { meta } from '../meta';
|
|
12
12
|
import { type DeckEphemeralStateProps, type DeckSettingsProps, type DeckState, type DeckStateProps } from '../types';
|
|
13
13
|
|
|
14
14
|
export namespace DeckCapabilities {
|
|
15
|
-
export const Settings = Capability.make<Atom.Writable<DeckSettingsProps>>(`${meta.id}
|
|
15
|
+
export const Settings = Capability.make<Atom.Writable<DeckSettingsProps>>(`${meta.id}.capability.settings`);
|
|
16
16
|
|
|
17
17
|
/** Persisted state (stored in KVS/localStorage). */
|
|
18
|
-
export const State = Capability.make<Atom.Writable<DeckStateProps>>(`${meta.id}
|
|
18
|
+
export const State = Capability.make<Atom.Writable<DeckStateProps>>(`${meta.id}.capability.state`);
|
|
19
19
|
|
|
20
20
|
/** Transient/ephemeral state (not persisted). */
|
|
21
21
|
export const EphemeralState = Capability.make<Atom.Writable<DeckEphemeralStateProps>>(
|
|
22
|
-
`${meta.id}
|
|
22
|
+
`${meta.id}.capability.ephemeral-state`,
|
|
23
23
|
);
|
|
24
24
|
|
|
25
25
|
/** Get the current active deck from state. */
|
|
26
26
|
export const getDeck = (): Effect.Effect<DeckState, Error, Capability.Service> =>
|
|
27
27
|
Effect.gen(function* () {
|
|
28
|
-
const state = yield*
|
|
28
|
+
const state = yield* Capabilities.getAtomValue(State);
|
|
29
29
|
const deck = state.decks[state.activeDeck];
|
|
30
30
|
invariant(deck, `Deck not found: ${state.activeDeck}`);
|
|
31
31
|
return deck;
|
package/src/types/events.ts
CHANGED
|
@@ -2,19 +2,20 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type ActivationEvent
|
|
5
|
+
import { type ActivationEvent } from '@dxos/app-framework';
|
|
6
|
+
import { AppActivationEvents } from '@dxos/app-toolkit';
|
|
6
7
|
|
|
7
8
|
import { meta } from '../meta';
|
|
8
9
|
|
|
9
10
|
import { DeckCapabilities } from './capabilities';
|
|
10
11
|
|
|
11
12
|
export namespace DeckEvents {
|
|
12
|
-
export const StateReady: ActivationEvent.ActivationEvent =
|
|
13
|
-
`${meta.id}
|
|
13
|
+
export const StateReady: ActivationEvent.ActivationEvent = AppActivationEvents.createStateEvent(
|
|
14
|
+
`${meta.id}.state-ready`,
|
|
14
15
|
);
|
|
15
16
|
|
|
16
17
|
/** Fired when DeckSettings capability is ready. */
|
|
17
|
-
export const SettingsReady: ActivationEvent.ActivationEvent =
|
|
18
|
+
export const SettingsReady: ActivationEvent.ActivationEvent = AppActivationEvents.createSettingsEvent(
|
|
18
19
|
DeckCapabilities.Settings.identifier,
|
|
19
20
|
);
|
|
20
21
|
}
|
package/src/types/schema.ts
CHANGED
|
@@ -4,23 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import { Capability
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Label, LayoutOperation } from '@dxos/app-toolkit';
|
|
8
9
|
import { Operation } from '@dxos/operation';
|
|
9
10
|
import { type DeepReadonly } from '@dxos/util';
|
|
10
11
|
|
|
11
12
|
import { meta } from '../meta';
|
|
12
13
|
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
export const PLANK_COMPANION_TYPE = `${meta.id}/plank-companion`;
|
|
16
|
-
export const DECK_COMPANION_TYPE = `${meta.id}/deck-companion`;
|
|
14
|
+
export const PLANK_COMPANION_TYPE = `${meta.id}.plank-companion`;
|
|
15
|
+
export const DECK_COMPANION_TYPE = `${meta.id}.deck-companion`;
|
|
17
16
|
|
|
18
17
|
// TODO(Zan): In the future we should consider adding new planks adjacent to the attended plank.
|
|
19
18
|
export const NewPlankPositions = ['start', 'end'] as const;
|
|
20
19
|
export type NewPlankPositioning = (typeof NewPlankPositions)[number];
|
|
21
20
|
|
|
22
|
-
export const
|
|
23
|
-
export type Overscroll = (typeof
|
|
21
|
+
export const OverScrollToProps = ['none', 'centering'] as const;
|
|
22
|
+
export type Overscroll = (typeof OverScrollToProps)[number];
|
|
24
23
|
|
|
25
24
|
export type Part = 'solo' | 'deck' | 'complementary';
|
|
26
25
|
export type ResolvedPart = Part | 'solo-primary' | 'solo-companion';
|
|
@@ -31,7 +30,7 @@ export const DeckSettingsSchema = Schema.Struct({
|
|
|
31
30
|
enableStatusbar: Schema.optional(Schema.Boolean),
|
|
32
31
|
enableNativeRedirect: Schema.optional(Schema.Boolean),
|
|
33
32
|
newPlankPositioning: Schema.optional(Schema.Literal(...NewPlankPositions)),
|
|
34
|
-
overscroll: Schema.optional(Schema.Literal(...
|
|
33
|
+
overscroll: Schema.optional(Schema.Literal(...OverScrollToProps)),
|
|
35
34
|
// TODO(burdon): Rename layoutMode? (e.g., bento | encapsulated?)
|
|
36
35
|
encapsulatedPlanks: Schema.optional(Schema.Boolean),
|
|
37
36
|
}).pipe(Schema.mutable);
|
|
@@ -45,8 +44,8 @@ export const DeckState = Schema.Struct({
|
|
|
45
44
|
/** If false, the deck has not yet left solo mode and new planks should be soloed. */
|
|
46
45
|
initialized: Schema.Boolean,
|
|
47
46
|
active: Schema.mutable(Schema.Array(Schema.String)),
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
companionOpen: Schema.Boolean,
|
|
48
|
+
companionVariant: Schema.optional(Schema.String),
|
|
50
49
|
inactive: Schema.mutable(Schema.Array(Schema.String)),
|
|
51
50
|
solo: Schema.optional(Schema.String),
|
|
52
51
|
fullscreen: Schema.Boolean,
|
|
@@ -58,7 +57,8 @@ export type DeckState = Schema.Schema.Type<typeof DeckState>;
|
|
|
58
57
|
export const defaultDeck: DeckState = {
|
|
59
58
|
initialized: false,
|
|
60
59
|
active: [],
|
|
61
|
-
|
|
60
|
+
companionOpen: false,
|
|
61
|
+
companionVariant: undefined,
|
|
62
62
|
inactive: [],
|
|
63
63
|
solo: undefined,
|
|
64
64
|
fullscreen: false,
|
|
@@ -90,6 +90,7 @@ export const DeckStateSchema = Schema.Struct({
|
|
|
90
90
|
}).pipe(Schema.mutable);
|
|
91
91
|
export type DeckStateProps = Schema.Schema.Type<typeof DeckStateSchema>;
|
|
92
92
|
|
|
93
|
+
// TODO(burdon): Factor out state (in common with other layouts?)
|
|
93
94
|
// Transient/ephemeral plugin state (not persisted).
|
|
94
95
|
export const DeckEphemeralStateSchema = Schema.Struct({
|
|
95
96
|
dialogOpen: Schema.Boolean,
|
|
@@ -105,11 +106,13 @@ export const DeckEphemeralStateSchema = Schema.Struct({
|
|
|
105
106
|
popoverAnchor: Schema.optional(Schema.Any),
|
|
106
107
|
popoverAnchorId: Schema.optional(Schema.String),
|
|
107
108
|
popoverKind: Schema.optional(Schema.Literal('base', 'card')),
|
|
108
|
-
popoverTitle: Schema.optional(
|
|
109
|
+
popoverTitle: Schema.optional(Label.annotations({ description: 'The title of the popover.' })),
|
|
110
|
+
/** Ref of the subject to be passed to the popover Surface. */
|
|
111
|
+
popoverContentRef: Schema.optional(Schema.String),
|
|
109
112
|
/** Data to be passed to the popover Surface. */
|
|
110
113
|
popoverContent: Schema.optional(Schema.Any),
|
|
111
114
|
|
|
112
|
-
toasts: Schema.mutable(Schema.Array(
|
|
115
|
+
toasts: Schema.mutable(Schema.Array(LayoutOperation.Toast)),
|
|
113
116
|
currentUndoId: Schema.optional(Schema.String),
|
|
114
117
|
|
|
115
118
|
/** The identifier of a component to scroll into view when it is mounted. */
|
|
@@ -134,12 +137,12 @@ export namespace DeckAction {
|
|
|
134
137
|
export type Adjustment = Schema.Schema.Type<typeof Adjustment>;
|
|
135
138
|
|
|
136
139
|
// An atomic transaction to apply to the deck, describing which element to move to which location.
|
|
137
|
-
export class Adjust extends Schema.TaggedClass<Adjust>()(`${meta.id}
|
|
140
|
+
export class Adjust extends Schema.TaggedClass<Adjust>()(`${meta.id}.action.adjust`, {
|
|
138
141
|
input: Adjustment,
|
|
139
142
|
output: Schema.Void,
|
|
140
143
|
}) {}
|
|
141
144
|
|
|
142
|
-
export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(`${meta.id}
|
|
145
|
+
export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(`${meta.id}.action.update-plank-size`, {
|
|
143
146
|
input: Schema.Struct({
|
|
144
147
|
id: Schema.String,
|
|
145
148
|
size: Schema.Number,
|
|
@@ -147,9 +150,8 @@ export namespace DeckAction {
|
|
|
147
150
|
output: Schema.Void,
|
|
148
151
|
}) {}
|
|
149
152
|
|
|
150
|
-
export class ChangeCompanion extends Schema.TaggedClass<ChangeCompanion>()(`${meta.id}
|
|
153
|
+
export class ChangeCompanion extends Schema.TaggedClass<ChangeCompanion>()(`${meta.id}.action.change-companion`, {
|
|
151
154
|
input: Schema.Struct({
|
|
152
|
-
primary: Schema.String,
|
|
153
155
|
companion: Schema.Union(Schema.String, Schema.Null),
|
|
154
156
|
}),
|
|
155
157
|
output: Schema.Void,
|
|
@@ -172,7 +174,7 @@ export namespace DeckOperation {
|
|
|
172
174
|
|
|
173
175
|
export const Adjust = Operation.make({
|
|
174
176
|
meta: {
|
|
175
|
-
key: `${meta.id}
|
|
177
|
+
key: `${meta.id}.operation.adjust`,
|
|
176
178
|
name: 'Adjust',
|
|
177
179
|
description: 'Adjust the layout of a plank.',
|
|
178
180
|
},
|
|
@@ -188,7 +190,7 @@ export namespace DeckOperation {
|
|
|
188
190
|
|
|
189
191
|
export const UpdatePlankSize = Operation.make({
|
|
190
192
|
meta: {
|
|
191
|
-
key: `${meta.id}
|
|
193
|
+
key: `${meta.id}.operation.update-plank-size`,
|
|
192
194
|
name: 'Update Plank Size',
|
|
193
195
|
description: 'Update the size of a plank.',
|
|
194
196
|
},
|
|
@@ -204,14 +206,13 @@ export namespace DeckOperation {
|
|
|
204
206
|
|
|
205
207
|
export const ChangeCompanion = Operation.make({
|
|
206
208
|
meta: {
|
|
207
|
-
key: `${meta.id}
|
|
209
|
+
key: `${meta.id}.operation.change-companion`,
|
|
208
210
|
name: 'Change Companion',
|
|
209
211
|
description: 'Change the companion plank for a primary plank.',
|
|
210
212
|
},
|
|
211
213
|
services: [Capability.Service],
|
|
212
214
|
schema: {
|
|
213
215
|
input: Schema.Struct({
|
|
214
|
-
primary: Schema.String,
|
|
215
216
|
companion: Schema.Union(Schema.String, Schema.Null),
|
|
216
217
|
}),
|
|
217
218
|
output: Schema.Void,
|
package/src/util/overscroll.ts
CHANGED
|
@@ -56,14 +56,14 @@ export const calculateOverscroll = (
|
|
|
56
56
|
}
|
|
57
57
|
if (planksCount === 1) {
|
|
58
58
|
const overscrollPadding =
|
|
59
|
-
'max(0px, calc(((100dvw - var(--dx-main-
|
|
59
|
+
'max(0px, calc(((100dvw - var(--dx-main-sidebar-width) - var(--dx-main-complementary-width) - (var(--dx-main-content-first-width) + 1px)) / 2)))';
|
|
60
60
|
return { paddingInlineStart: overscrollPadding, paddingInlineEnd: overscrollPadding };
|
|
61
61
|
} else {
|
|
62
62
|
return {
|
|
63
63
|
paddingInlineStart:
|
|
64
|
-
'max(0px, calc(((100dvw - (var(--dx-main-
|
|
64
|
+
'max(0px, calc(((100dvw - (var(--dx-main-content-first-width) + 1px)) / 2) - var(--dx-main-sidebar-width)))',
|
|
65
65
|
paddingInlineEnd:
|
|
66
|
-
'max(0px, calc(((100dvw - (var(--dx-main-
|
|
66
|
+
'max(0px, calc(((100dvw - (var(--dx-main-content-last-width) + 1px)) / 2) - var(--dx-main-complementary-width)))',
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
};
|